public KeeperRecord getRecordByLogin(
            String username, String domain) throws GuacamoleException {

        validateCache();
        cacheLock.readLock().lock();

        UserLogin userDomain = new UserLogin(username, domain);

        try {

            if (cachedAmbiguousUsers.contains(userDomain)) {
                logger.debug("The username \"{}\" with domain \"{}\" is "
                        + "referenced by multiple Keeper records and "
                        + "cannot be used to locate individual secrets.",
                        username, domain);
                return null;
            }

            return cachedRecordsByUser.get(userDomain);

        }
        finally {
            cacheLock.readLock().unlock();
        }
    }
Returns the record associated with the given username and domain. If no
such record exists, or there are multiple such records, null is returned.

@param username
    The username of the record to return.

@param domain
    The domain of the record to return, or null if no domain exists.

@return
    The record associated with the given username and domain, or null
    if there is no such record or multiple such records.

@throws GuacamoleException
    If an error occurs that prevents the record from being retrieved.
extensions/guacamole-vault/modules/guacamole-vault-ksm/src/main/java/org/apache/guacamole/vault/ksm/secret/KsmClient.java