@Override
    public Connection get(String identifier) throws GuacamoleException {

        // Allow access only to registered share keys
        if (!shareKeys.contains(identifier))
            return null;

        // Retrieve the connection definition associated with that share key,
        // cleaning up the internally-stored share key if it's no longer valid
        SharedConnectionDefinition connectionDefinition = connectionMap.get(identifier);
        if (connectionDefinition == null) {
            shareKeys.remove(identifier);
            return null;
        }

        // Return a Connection which wraps that connection definition
        SharedConnection connection = connectionProvider.get();
        connection.init(currentUser, connectionDefinition);
        return connection;

    }
Registers a new share key such that the connection associated with that
share key is accessible through this directory. The share key will be
automatically de-registered when it is no longer valid.

@param shareKey
    The share key to register.
extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/sharing/connection/SharedConnectionDirectory.java