Package org.apache.guacamole.net.auth
Interface ActiveConnection
- All Superinterfaces:
Connectable
,Identifiable
,Shareable<SharingProfile>
- All Known Implementing Classes:
AbstractActiveConnection
A pairing of username and GuacamoleTunnel representing an active usage of a
particular connection.
-
Method Summary
Modifier and TypeMethodDescriptiondefault org.apache.guacamole.net.GuacamoleTunnel
Establishes a connection to guacd using the information associated with this object.default int
Returns the number of active connections associated with this object.Returns the identifier of the connection being actively used.Returns the hostname or IP address of the remote host that initiated the connection, if known.Returns the identifier of the sharing profile being actively used.Returns the date and time the connection began.org.apache.guacamole.net.GuacamoleTunnel
Returns the connected GuacamoleTunnel being used.Returns the name of the user who is using this connection.default boolean
Returns whether this ActiveConnection may be joined through a call toconnect(org.apache.guacamole.protocol.GuacamoleClientInformation, java.util.Map)
by the user that retrieved this ActiveConnection.void
setConnectionIdentifier
(String connnectionIdentifier) Sets the identifier of the connection being actively used.void
setRemoteHost
(String remoteHost) Sets the hostname or IP address of the remote host that initiated the connection.void
setSharingProfileIdentifier
(String sharingProfileIdentifier) Sets the identifier of the sharing profile being actively used.void
setStartDate
(Date startDate) Sets the date and time the connection began.void
setTunnel
(org.apache.guacamole.net.GuacamoleTunnel tunnel) Sets the connected GuacamoleTunnel being used.void
setUsername
(String username) Sets the name of the user who is using this connection.Methods inherited from interface org.apache.guacamole.net.auth.Connectable
connect
Methods inherited from interface org.apache.guacamole.net.auth.Identifiable
getIdentifier, setIdentifier
Methods inherited from interface org.apache.guacamole.net.auth.Shareable
getSharingCredentials
-
Method Details
-
getConnectionIdentifier
String getConnectionIdentifier()Returns the identifier of the connection being actively used. Unlike the other information stored in this object, the connection identifier must be present and MAY NOT be null.- Returns:
- The identifier of the connection being actively used.
-
setConnectionIdentifier
Sets the identifier of the connection being actively used.- Parameters:
connnectionIdentifier
- The identifier of the connection being actively used.
-
getSharingProfileIdentifier
String getSharingProfileIdentifier()Returns the identifier of the sharing profile being actively used. If the connection is being accessed directly, this will be null.- Returns:
- The identifier of the sharing profile being actively used.
-
setSharingProfileIdentifier
Sets the identifier of the sharing profile being actively used.- Parameters:
sharingProfileIdentifier
- The identifier of the sharing profile being actively used.
-
getStartDate
Date getStartDate()Returns the date and time the connection began.- Returns:
- The date and time the connection began, or null if this information is not available.
-
setStartDate
Sets the date and time the connection began.- Parameters:
startDate
- The date and time the connection began, or null if this information is not available.
-
getRemoteHost
String getRemoteHost()Returns the hostname or IP address of the remote host that initiated the connection, if known. If the hostname or IP address is not known, null is returned.- Returns:
- The hostname or IP address of the remote host, or null if this information is not available.
-
setRemoteHost
Sets the hostname or IP address of the remote host that initiated the connection.- Parameters:
remoteHost
- The hostname or IP address of the remote host, or null if this information is not available.
-
getUsername
String getUsername()Returns the name of the user who is using this connection.- Returns:
- The name of the user who is using this connection, or null if this information is not available.
-
setUsername
Sets the name of the user who is using this connection.- Parameters:
username
- The name of the user who is using this connection, or null if this information is not available.
-
getTunnel
org.apache.guacamole.net.GuacamoleTunnel getTunnel()Returns the connected GuacamoleTunnel being used. This may be null if access to the underlying tunnel is denied.- Returns:
- The connected GuacamoleTunnel, or null if permission is denied.
-
setTunnel
void setTunnel(org.apache.guacamole.net.GuacamoleTunnel tunnel) Sets the connected GuacamoleTunnel being used.- Parameters:
tunnel
- The connected GuacamoleTunnel, or null if permission is denied.
-
isConnectable
default boolean isConnectable()Returns whether this ActiveConnection may be joined through a call toconnect(org.apache.guacamole.protocol.GuacamoleClientInformation, java.util.Map)
by the user that retrieved this ActiveConnection.- Returns:
- true if the user that retrieved this ActiveConnection may join the
ActiveConnection through a call to
connect(org.apache.guacamole.protocol.GuacamoleClientInformation, java.util.Map)
, false otherwise.
-
connect
default 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
- 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:
-
getActiveConnections
default int getActiveConnections()Description copied from interface:Connectable
Returns the number of active connections associated with this object. Implementations may simply return 0 if this value is not tracked.- Specified by:
getActiveConnections
in interfaceConnectable
- Returns:
- The number of active connections associated with this object.
-