Class SimpleConnectionGroup

  • All Implemented Interfaces:
    Attributes, Connectable, ConnectionGroup, Identifiable

    public class SimpleConnectionGroup
    extends AbstractConnectionGroup
    An extremely simple read-only implementation of a ConnectionGroup which returns the connection and connection group identifiers it was constructed with. Load balancing across this connection group is not allowed.
    • Constructor Detail

      • SimpleConnectionGroup

        public SimpleConnectionGroup​(String name,
                                     String identifier,
                                     Collection<String> connectionIdentifiers,
                                     Collection<String> connectionGroupIdentifiers)
        Creates a new SimpleConnectionGroup having the given name and identifier which will expose the given contents.
        Parameters:
        name - The name to associate with this connection group.
        identifier - The identifier to associate with this connection group.
        connectionIdentifiers - The connection identifiers to expose when requested.
        connectionGroupIdentifiers - The connection group identifiers to expose when requested.
    • Method Detail

      • getActiveConnections

        public 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.
        Returns:
        The number of active connections associated with this object.
      • getConnectionIdentifiers

        public Set<String> getConnectionIdentifiers()
        Description copied from interface: ConnectionGroup
        Returns the identifiers of all readable connections that are children of this connection group.
        Returns:
        The set of identifiers of all readable connections that are children of this connection group.
      • getConnectionGroupIdentifiers

        public Set<String> getConnectionGroupIdentifiers()
        Description copied from interface: ConnectionGroup
        Returns the identifiers of all readable connection groups that are children of this connection group.
        Returns:
        The set of identifiers of all readable connection groups that are children of this connection group.
      • getAttributes

        public Map<String,​String> getAttributes()
        Description copied from interface: Attributes
        Returns all attributes associated with this object. The returned map may not be modifiable.
        Returns:
        A map of all attribute identifiers to their corresponding values, for all attributes associated with this object, which may not be modifiable.
      • setAttributes

        public void setAttributes​(Map<String,​String> attributes)
        Description copied from interface: Attributes
        Sets the given attributes. If an attribute within the map is not supported, it will simply be dropped. Any attributes not within the given map will be left untouched. Attributes which are not declared within the associated UserContext MUST NOT be submitted, but other extensions may manipulate the declared attributes through decorate() and redecorate(). Implementations may optionally allow storage of unsupported attributes. Extensions which rely on other extensions to store their attribute values should verify that such storage is supported by first testing that the attribute value is retrievable via getAttributes() after being set.
        Parameters:
        attributes - A map of all attribute identifiers to their corresponding values.
      • connect

        @Deprecated
        public org.apache.guacamole.net.GuacamoleTunnel connect​(org.apache.guacamole.protocol.GuacamoleClientInformation info)
                                                         throws org.apache.guacamole.GuacamoleException
        Deprecated.
        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.
        Parameters:
        info - Information associated with the connecting client.
        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.
      • 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 a TokenFilter.
        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