private void addRecordForHost(KeeperRecord record, String hostname) {

        if (hostname == null)
            return;

        KeeperRecord existing = cachedRecordsByHost.putIfAbsent(hostname, record);
        if (existing != null && record != existing)
            cachedAmbiguousHosts.add(hostname);

    }
Associates the given record with the given hostname. The hostname may be
null. Both {@link #cachedRecordsByHost} and {@link #cachedAmbiguousHosts}
are updated appropriately. The write lock of {@link #cacheLock} must
already be acquired before invoking this function.

@param record
    The record to associate with the hosts in the given field.

@param hostname
    The hostname/address that the given record should be associated
    with. This may be null.
extensions/guacamole-vault/modules/guacamole-vault-ksm/src/main/java/org/apache/guacamole/vault/ksm/secret/KsmClient.java