@Override
    public GuacamoleTunnel connect(GuacamoleClientInformation info,
            Map<String, String> tokens) throws GuacamoleException {

        // Prevent future use immediately upon connect
        if (connection.isSingleUse()) {

            // Deny access if another user already used the connection
            if (data.removeConnection(getIdentifier()) == null)
                throw new GuacamoleSecurityException("Permission denied");

        }

        // Perform connection operation
        return connectionService.connect(connection, info, tokens);

    }
Initializes this UserDataConnection with the given data, unique
identifier, and connection information. This function MUST be invoked
before any particular UserDataConnection is actually used.

@param data
    The UserData that this connection should manage.

@param identifier
    The identifier associated with this connection within the given
    UserData.

@param connection
    The connection data associated with this connection within the given
    UserData.

@return
    A reference to this UserDataConnection.
extensions/guacamole-auth-json/src/main/java/org/apache/guacamole/auth/json/user/UserDataConnection.java