mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 13:17:41 +00:00
GUACAMOLE-1629: Fix client/cache confusion in comments.
This commit is contained in:
@@ -37,7 +37,6 @@ public interface VaultAttributeService {
|
|||||||
* @return
|
* @return
|
||||||
* All custom connection group attributes to be exposed through the
|
* All custom connection group attributes to be exposed through the
|
||||||
* admin UI for the current vault implementation.
|
* admin UI for the current vault implementation.
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public Collection<Form> getConnectionGroupAttributes();
|
public Collection<Form> getConnectionGroupAttributes();
|
||||||
}
|
}
|
||||||
|
@@ -90,16 +90,16 @@ public class KsmSecretService implements VaultSecretService {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Create and return a KSM client for the provided KSM config if not already
|
* Create and return a KSM client for the provided KSM config if not already
|
||||||
* present in the cache map, otherwise return the existing cache entry.
|
* present in the client map, otherwise return the existing client entry.
|
||||||
*
|
*
|
||||||
* @param ksmConfig
|
* @param ksmConfig
|
||||||
* The base-64 encoded JSON KSM config blob associated with the cache entry.
|
* The base-64 encoded JSON KSM config blob associated with the client entry.
|
||||||
* If an associated entry does not already exist, it will be created using
|
* If an associated entry does not already exist, it will be created using
|
||||||
* this configuration.
|
* this configuration.
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
* A KSM client for the provided KSM config if not already present in the
|
* A KSM client for the provided KSM config if not already present in the
|
||||||
* cache map, otherwise the existing cache entry.
|
* client map, otherwise the existing client entry.
|
||||||
*
|
*
|
||||||
* @throws GuacamoleException
|
* @throws GuacamoleException
|
||||||
* If an error occurs while creating the KSM client.
|
* If an error occurs while creating the KSM client.
|
||||||
@@ -107,17 +107,17 @@ public class KsmSecretService implements VaultSecretService {
|
|||||||
private KsmClient getClient(@Nonnull String ksmConfig)
|
private KsmClient getClient(@Nonnull String ksmConfig)
|
||||||
throws GuacamoleException {
|
throws GuacamoleException {
|
||||||
|
|
||||||
// If a cache already exists for the provided config, use it
|
// If a client already exists for the provided config, use it
|
||||||
KsmClient ksmClient = ksmClientMap.get(ksmConfig);
|
KsmClient ksmClient = ksmClientMap.get(ksmConfig);
|
||||||
if (ksmClient != null)
|
if (ksmClient != null)
|
||||||
return ksmClient;
|
return ksmClient;
|
||||||
|
|
||||||
// Create and store a new KSM cache instance for the provided KSM config blob
|
// Create and store a new KSM client instance for the provided KSM config blob
|
||||||
SecretsManagerOptions options = confService.getSecretsManagerOptions(ksmConfig);
|
SecretsManagerOptions options = confService.getSecretsManagerOptions(ksmConfig);
|
||||||
ksmClient = ksmClientFactory.create(options);
|
ksmClient = ksmClientFactory.create(options);
|
||||||
KsmClient prevClient = ksmClientMap.putIfAbsent(ksmConfig, ksmClient);
|
KsmClient prevClient = ksmClientMap.putIfAbsent(ksmConfig, ksmClient);
|
||||||
|
|
||||||
// If the cache was already set before this thread got there, use the existing one
|
// If the client was already set before this thread got there, use the existing one
|
||||||
return prevClient != null ? prevClient : ksmClient;
|
return prevClient != null ? prevClient : ksmClient;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user