Package org.apache.guacamole.net.auth
Interface ActiveConnection
-
- All Superinterfaces:
Connectable
,Identifiable
,Shareable<SharingProfile>
- All Known Implementing Classes:
AbstractActiveConnection
public interface ActiveConnection extends Identifiable, Connectable, Shareable<SharingProfile>
A pairing of username and GuacamoleTunnel representing an active usage of a particular connection.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default 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.default int
getActiveConnections()
Returns the number of active connections associated with this object.String
getConnectionIdentifier()
Returns the identifier of the connection being actively used.String
getRemoteHost()
Returns the hostname or IP address of the remote host that initiated the connection, if known.String
getSharingProfileIdentifier()
Returns the identifier of the sharing profile being actively used.Date
getStartDate()
Returns the date and time the connection began.org.apache.guacamole.net.GuacamoleTunnel
getTunnel()
Returns the connected GuacamoleTunnel being used.String
getUsername()
Returns the name of the user who is using this connection.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.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 Detail
-
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
void setConnectionIdentifier(String connnectionIdentifier)
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
void setSharingProfileIdentifier(String sharingProfileIdentifier)
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
void setStartDate(Date startDate)
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
void setRemoteHost(String remoteHost)
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
void setUsername(String username)
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.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
- 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
-
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.
-
-