Package org.apache.guacamole.net.auth
Class TokenInjectingConnectionGroup
java.lang.Object
org.apache.guacamole.net.auth.DelegatingConnectionGroup
org.apache.guacamole.net.auth.TokenInjectingConnectionGroup
- All Implemented Interfaces:
Attributes
,Connectable
,ConnectionGroup
,Identifiable
,Nameable
,ReadableAttributes
ConnectionGroup implementation which overrides the connect() function of an
underlying ConnectionGroup, adding a given set of parameter tokens to the
tokens already supplied. If not supplying a static set of tokens at
construction time, implementations should override either
addTokens(java.util.Map)
or getTokens()
to provide tokens
dynamically.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.guacamole.net.auth.ConnectionGroup
ConnectionGroup.Type
-
Constructor Summary
ConstructorsConstructorDescriptionTokenInjectingConnectionGroup
(ConnectionGroup connectionGroup) Wraps the given ConnectionGroup such that the additional parameter tokens added byaddTokens(java.util.Map)
or returned bygetTokens()
are included with each invocation of connect().TokenInjectingConnectionGroup
(ConnectionGroup connectionGroup, Map<String, String> tokens) Wraps the given ConnectionGroup, automatically adding the given tokens to each invocation of connect(). -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Adds tokens to an in-progress call to connect().org.apache.guacamole.net.GuacamoleTunnel
Establishes a connection to guacd using the information associated with this object.Returns the tokens which should be added to an in-progress call to connect().Methods inherited from class org.apache.guacamole.net.auth.DelegatingConnectionGroup
connect, getActiveConnections, getAttributes, getConnectionGroupIdentifiers, getConnectionIdentifiers, getDelegateConnectionGroup, getIdentifier, getName, getParentIdentifier, getType, setAttributes, setIdentifier, setName, setParentIdentifier, setType
-
Constructor Details
-
TokenInjectingConnectionGroup
Wraps the given ConnectionGroup, automatically adding the given tokens to each invocation of connect(). Any additional tokens which have the same name as existing tokens will override the existing values.- Parameters:
connectionGroup
- The ConnectionGroup to wrap.tokens
- The additional tokens to include with each call to connect().
-
TokenInjectingConnectionGroup
Wraps the given ConnectionGroup such that the additional parameter tokens added byaddTokens(java.util.Map)
or returned bygetTokens()
are included with each invocation of connect(). Any additional tokens which have the same name as existing tokens will override the existing values.- Parameters:
connectionGroup
- The ConnectionGroup to wrap.
-
-
Method Details
-
getTokens
Returns the tokens which should be added to an in-progress call to connect(). If not overridden, this function will return the tokens provided when this instance of TokenInjectingConnection was created. If the values of existing tokens need to be considered, implementations should overrideaddTokens(java.util.Map)
instead.- Returns:
- The tokens which should be added to the in-progress call to connect().
- Throws:
org.apache.guacamole.GuacamoleException
- If the applicable tokens cannot be generated.
-
addTokens
Adds tokens to an in-progress call to connect(). If not overridden, this function will add the tokens returned bygetTokens()
.- Parameters:
tokens
- A modifiable Map containing the tokens already supplied to connect().- Throws:
org.apache.guacamole.GuacamoleException
- If the applicable tokens cannot be generated.
-
connect
public org.apache.guacamole.net.GuacamoleTunnel connect(org.apache.guacamole.protocol.GuacamoleClientInformation info, Map<String, String> tokens) throws org.apache.guacamole.GuacamoleExceptionDescription copied from interface:Connectable
Establishes a connection to guacd using the information associated with this object. The connection will be provided the given client information. Implementations which support parameter tokens should apply the given tokens when configuring the connection, such as with aTokenFilter
.- Specified by:
connect
in interfaceConnectable
- Overrides:
connect
in classDelegatingConnectionGroup
- Parameters:
info
- Information associated with the connecting client.tokens
- A Map containing the token names and corresponding values to be applied as parameter tokens when establishing the connection. If the implementation does not support parameter tokens, this Map may be ignored.- Returns:
- A fully-established GuacamoleTunnel.
- Throws:
org.apache.guacamole.GuacamoleException
- If an error occurs while connecting to guacd, or if permission to connect is denied.- See Also:
-