public class SimpleConnection extends AbstractConnection
Constructor and Description |
---|
SimpleConnection()
Creates a completely uninitialized SimpleConnection.
|
SimpleConnection(boolean interpretTokens)
Creates a completely uninitialized SimpleConnection.
|
SimpleConnection(String name,
String identifier,
org.apache.guacamole.protocol.GuacamoleConfiguration config)
Creates a new SimpleConnection having the given identifier and
GuacamoleConfiguration.
|
SimpleConnection(String name,
String identifier,
org.apache.guacamole.protocol.GuacamoleConfiguration config,
boolean interpretTokens)
Creates a new SimpleConnection having the given identifier and
GuacamoleConfiguration.
|
Modifier and Type | Method and Description |
---|---|
org.apache.guacamole.net.GuacamoleTunnel |
connect(org.apache.guacamole.protocol.GuacamoleClientInformation info)
Deprecated.
|
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.
|
int |
getActiveConnections()
Returns the number of active connections associated with this object.
|
Map<String,String> |
getAttributes()
Returns all attributes associated with this object.
|
ActivityRecordSet<ConnectionRecord> |
getConnectionHistory()
Returns an ActivityRecordSet containing ConnectionRecords that
represent the usage history of this Connection, including any active
users.
|
protected org.apache.guacamole.protocol.GuacamoleConfiguration |
getFullConfiguration()
Returns the GuacamoleConfiguration describing how to connect to this
connection.
|
Date |
getLastActive()
Returns the date and time that this connection was last used.
|
void |
setAttributes(Map<String,String> attributes)
Sets the given attributes.
|
void |
setConfiguration(org.apache.guacamole.protocol.GuacamoleConfiguration config)
Sets the GuacamoleConfiguration associated with this Connection.
|
getConfiguration, getName, getParentIdentifier, getSharingProfileIdentifiers, setName, setParentIdentifier
equals, getIdentifier, hashCode, setIdentifier
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
getHistory
getIdentifier, setIdentifier
public SimpleConnection()
setConfiguration(org.apache.guacamole.protocol.GuacamoleConfiguration)
will not be interpreted.public SimpleConnection(boolean interpretTokens)
setConfiguration(org.apache.guacamole.protocol.GuacamoleConfiguration)
will not be interpreted unless explicitly requested.interpretTokens
- Whether parameter tokens in the underlying GuacamoleConfiguration
should be automatically applied upon connecting. If false, parameter
tokens will not be interpreted at all.public SimpleConnection(String name, String identifier, org.apache.guacamole.protocol.GuacamoleConfiguration config)
name
- The name to associate with this connection.identifier
- The identifier to associate with this connection.config
- The configuration describing how to connect to this connection.public SimpleConnection(String name, String identifier, org.apache.guacamole.protocol.GuacamoleConfiguration config, boolean interpretTokens)
name
- The name to associate with this connection.identifier
- The identifier to associate with this connection.config
- The configuration describing how to connect to this connection.interpretTokens
- Whether parameter tokens in the underlying GuacamoleConfiguration
should be automatically applied upon connecting. If false, parameter
tokens will not be interpreted at all.protected org.apache.guacamole.protocol.GuacamoleConfiguration getFullConfiguration()
AbstractConnection.getConfiguration()
, which is allowed to omit
or tokenize information, the GuacamoleConfiguration returned by this
function will always be the full configuration to be used to establish
the connection, as provided when this SimpleConnection was created or via
setConfiguration(org.apache.guacamole.protocol.GuacamoleConfiguration)
.public void setConfiguration(org.apache.guacamole.protocol.GuacamoleConfiguration config)
Connection
setConfiguration
in interface Connection
setConfiguration
in class AbstractConnection
config
- The GuacamoleConfiguration to associate with this
Connection.public int getActiveConnections()
Connectable
public Map<String,String> getAttributes()
Attributes
public void setAttributes(Map<String,String> attributes)
Attributes
attributes
- A map of all attribute identifiers to their corresponding values.@Deprecated public org.apache.guacamole.net.GuacamoleTunnel connect(org.apache.guacamole.protocol.GuacamoleClientInformation info) throws org.apache.guacamole.GuacamoleException
Connectable
info
- Information associated with the connecting client.org.apache.guacamole.GuacamoleException
- If an error occurs while connecting to guacd, or if permission to
connect is denied.public org.apache.guacamole.net.GuacamoleTunnel connect(org.apache.guacamole.protocol.GuacamoleClientInformation info, Map<String,String> tokens) throws org.apache.guacamole.GuacamoleException
TokenFilter
.
This implementation will connect using the GuacamoleConfiguration
returned by getFullConfiguration()
, honoring the
"guacd-hostname", "guacd-port", and "guacd-ssl" properties set within
guacamole.properties. Parameter tokens will be taken into account if
the SimpleConnection was explicitly requested to do so when created.
Implementations requiring more complex behavior should consider using
the AbstractConnection
base class or implementing
Connection
directly.
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.org.apache.guacamole.GuacamoleException
- If an error occurs while connecting to guacd, or if permission to
connect is denied.public Date getLastActive()
Connection
public ActivityRecordSet<ConnectionRecord> getConnectionHistory() throws org.apache.guacamole.GuacamoleException
Connection
getHistory
method, this function should throw
GuacamoleUnsupportedExpcetion.org.apache.guacamole.GuacamoleException
- If history tracking is not implemented, if an error occurs while
reading the history of this connection, or if permission is
denied.Copyright © 2020. All rights reserved.