Package org.apache.guacamole.net.auth
Class TokenInjectingConnection
- java.lang.Object
-
- org.apache.guacamole.net.auth.DelegatingConnection
-
- org.apache.guacamole.net.auth.TokenInjectingConnection
-
- All Implemented Interfaces:
Attributes
,Connectable
,Connection
,Identifiable
public class TokenInjectingConnection extends DelegatingConnection
Connection implementation which overrides the connect() function of an underlying Connection, adding a given set of parameter tokens to the tokens already supplied.
-
-
Constructor Summary
Constructors Constructor Description TokenInjectingConnection(Connection connection, Map<String,String> tokens)
Wraps the given Connection, automatically adding the given tokens to each invocation of connect().
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.guacamole.net.GuacamoleTunnel
connect(org.apache.guacamole.protocol.GuacamoleClientInformation info, Map<String,String> tokens)
Establishes a connection to guacd using the information associated with this object.-
Methods inherited from class org.apache.guacamole.net.auth.DelegatingConnection
connect, getActiveConnections, getAttributes, getConfiguration, getConnectionHistory, getDelegateConnection, getHistory, getIdentifier, getLastActive, getName, getParentIdentifier, getSharingProfileIdentifiers, setAttributes, setConfiguration, setIdentifier, setName, setParentIdentifier
-
-
-
-
Constructor Detail
-
TokenInjectingConnection
public TokenInjectingConnection(Connection connection, Map<String,String> tokens)
Wraps the given Connection, 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:
connection
- The Connection to wrap.tokens
- The additional tokens to include with each call to connect().
-
-
Method Detail
-
connect
public org.apache.guacamole.net.GuacamoleTunnel connect(org.apache.guacamole.protocol.GuacamoleClientInformation info, Map<String,String> tokens) throws org.apache.guacamole.GuacamoleException
Description 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 classDelegatingConnection
- 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:
- Parameter Tokens
-
-