Package org.apache.guacamole.protocol
Class GuacamoleConfiguration
java.lang.Object
org.apache.guacamole.protocol.GuacamoleConfiguration
- All Implemented Interfaces:
Serializable
All information necessary to complete the initial protocol handshake of a
Guacamole session.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new, blank GuacamoleConfiguration with its protocol, connection ID, and parameters unset.Copies the given GuacamoleConfiguration, creating a new, indepedent GuacamoleConfiguration containing the same protocol, connection ID, and parameter values, if any. -
Method Summary
Modifier and TypeMethodDescriptionReturns the ID of the connection being joined, if any.getParameter
(String name) Returns the value set for the parameter with the given name, if any.Returns a set of all currently defined parameter names.Returns a map which contains parameter name/value pairs as key/value pairs.Returns the name of the protocol to be used.void
setConnectionID
(String connectionID) Sets the ID of the connection being joined, if any.void
setParameter
(String name, String value) Sets the value for the parameter with the given name.void
setParameters
(Map<String, String> parameters) Replaces all current parameters with the parameters defined within the given map.void
setProtocol
(String protocol) Sets the name of the protocol to be used.void
unsetParameter
(String name) Removes the value set for the parameter with the given name.
-
Constructor Details
-
GuacamoleConfiguration
public GuacamoleConfiguration()Creates a new, blank GuacamoleConfiguration with its protocol, connection ID, and parameters unset. -
GuacamoleConfiguration
Copies the given GuacamoleConfiguration, creating a new, indepedent GuacamoleConfiguration containing the same protocol, connection ID, and parameter values, if any.- Parameters:
config
- The GuacamoleConfiguration to copy.
-
-
Method Details
-
getConnectionID
Returns the ID of the connection being joined, if any. If no connection is being joined, this returns null, and the protocol must be set.- Returns:
- The ID of the connection being joined, or null if no connection is being joined.
-
setConnectionID
Sets the ID of the connection being joined, if any. If no connection is being joined, this value must be omitted.- Parameters:
connectionID
- The ID of the connection being joined.
-
getProtocol
Returns the name of the protocol to be used.- Returns:
- The name of the protocol to be used.
-
setProtocol
Sets the name of the protocol to be used. If no connection is being joined (a new connection is being established), this value must be set.If a connection is being joined, this value should still be set to ensure that protocol-specific responses like the "required" and "argv" instructions can be understood in their proper context by other code that may consume this GuacamoleConfiguration like
ConfiguredGuacamoleSocket
.If this value is unavailable or remains unset, it is still possible to join an established connection using
setConnectionID(java.lang.String)
, however protocol-specific responses like the "required" and "argv" instructions might not be possible to handle correctly if the underlying protocol is not made available through some other means to the client receiving those responses.- Parameters:
protocol
- The name of the protocol to be used.
-
getParameter
Returns the value set for the parameter with the given name, if any.- Parameters:
name
- The name of the parameter to return the value for.- Returns:
- The value of the parameter with the given name, or null if that parameter has not been set.
-
setParameter
Sets the value for the parameter with the given name.- Parameters:
name
- The name of the parameter to set the value for.value
- The value to set for the parameter with the given name.
-
unsetParameter
Removes the value set for the parameter with the given name.- Parameters:
name
- The name of the parameter to remove the value of.
-
getParameterNames
Returns a set of all currently defined parameter names. Each name corresponds to a parameter that has a value set on this GuacamoleConfiguration via setParameter().- Returns:
- A set of all currently defined parameter names.
-
getParameters
Returns a map which contains parameter name/value pairs as key/value pairs. Changes to this map will affect the parameters stored within this configuration.- Returns:
- A map which contains all parameter name/value pairs as key/value pairs.
-
setParameters
Replaces all current parameters with the parameters defined within the given map. Key/value pairs within the map represent parameter name/value pairs.- Parameters:
parameters
- A map which contains all parameter name/value pairs as key/value pairs.
-