Package com.shinyhut.vernacular.client
Class VernacularConfig
- java.lang.Object
-
- com.shinyhut.vernacular.client.VernacularConfig
-
public class VernacularConfig extends Object
-
-
Constructor Summary
Constructors Constructor Description VernacularConfig()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Consumer<Void>getBellListener()ColorDepthgetColorDepth()Consumer<VncException>getErrorListener()Supplier<String>getPasswordSupplier()Consumer<String>getRemoteClipboardListener()Consumer<Image>getScreenUpdateListener()intgetTargetFramesPerSecond()booleanisShared()voidsetBellListener(Consumer<Void> bellListener)Specifies a Consumer which will be invoked when the server triggers an alert soundvoidsetColorDepth(ColorDepth colorDepth)Specifies the color depth to request from the remote server.voidsetErrorListener(Consumer<VncException> errorListener)Specifies a Consumer which will be passed any Exception which occurs during the VNC session.voidsetPasswordSupplier(Supplier<String> passwordSupplier)Specifies a Supplier which will be called to find the VNC password if the remote host requires authentication.voidsetRemoteClipboardListener(Consumer<String> remoteClipboardListener)Specifies a Consumer which will be invoked when the sever wants to store text in the clipboardvoidsetScreenUpdateListener(Consumer<Image> screenUpdateListener)Specifies a Consumer which will be passed an Image representing the remote server's desktop every time we receive a screen update.voidsetShared(boolean shared)Specifies whether we should request 'shared' access to the remote server.voidsetTargetFramesPerSecond(int targetFramesPerSecond)Sets the target number of frames per second we wish to receive from the remote server.
-
-
-
Method Detail
-
setPasswordSupplier
public void setPasswordSupplier(Supplier<String> passwordSupplier)
Specifies a Supplier which will be called to find the VNC password if the remote host requires authentication.- Parameters:
passwordSupplier- A Supplier which when invoked will return the user's VNC password
-
getErrorListener
public Consumer<VncException> getErrorListener()
-
setErrorListener
public void setErrorListener(Consumer<VncException> errorListener)
Specifies a Consumer which will be passed any Exception which occurs during the VNC session.- Parameters:
errorListener- A Consumer which will receive any Exceptions which occur during the VNC session
-
setScreenUpdateListener
public void setScreenUpdateListener(Consumer<Image> screenUpdateListener)
Specifies a Consumer which will be passed an Image representing the remote server's desktop every time we receive a screen update.- Parameters:
screenUpdateListener- A Consumer which will receive Images representing the updated remote desktop- See Also:
Image
-
setRemoteClipboardListener
public void setRemoteClipboardListener(Consumer<String> remoteClipboardListener)
Specifies a Consumer which will be invoked when the sever wants to store text in the clipboard- Parameters:
remoteClipboardListener- A Consumer which will be invoked when the sever wants to store text in the clipboard
-
setBellListener
public void setBellListener(Consumer<Void> bellListener)
Specifies a Consumer which will be invoked when the server triggers an alert sound- Parameters:
bellListener- A Consumer which will be notified when the server triggers an alert sound
-
isShared
public boolean isShared()
-
setShared
public void setShared(boolean shared)
Specifies whether we should request 'shared' access to the remote server.If this is set to false, most servers will disconnect any other clients as soon as we connect.
Default: true
- Parameters:
shared- Should we request shared access to the remote server?
-
getTargetFramesPerSecond
public int getTargetFramesPerSecond()
-
setTargetFramesPerSecond
public void setTargetFramesPerSecond(int targetFramesPerSecond)
Sets the target number of frames per second we wish to receive from the remote server.Note that this is the maximum number of framebuffer updates we will request per second. The server does not have to honour our requests. The higher the number of frames per second, the more bandwidth we will consume.
Default: 30
- Parameters:
targetFramesPerSecond- The number of frames per second we want to receive from the remote server
-
getColorDepth
public ColorDepth getColorDepth()
-
setColorDepth
public void setColorDepth(ColorDepth colorDepth)
Specifies the color depth to request from the remote server. Note that the greater the color depth, the more bandwidth we will consume.Default: 8 bits per pixel
- Parameters:
colorDepth- The color depth for rendering the remote desktop- See Also:
ColorDepth
-
-