private Map<String, Future<String>> getTokens(
            Connectable connectable, Map<String, String> tokenMapping,
            TokenFilter secretNameFilter, GuacamoleConfiguration config,
            TokenFilter configFilter) throws GuacamoleException {

        // Populate map with pending secret retrieval operations corresponding
        // to each mapped token
        Map<String, Future<String>> pendingTokens = new HashMap<>(tokenMapping.size());
        for (Map.Entry<String, String> entry : tokenMapping.entrySet()) {

            // Translate secret pattern into secret name, ignoring any
            // secrets which cannot be translated
            String secretName;
            try {
                secretName = secretNameFilter.filterStrict(entry.getValue());
            }
            catch (GuacamoleTokenUndefinedException e) {
                logger.debug("Secret for token \"{}\" will not be retrieved. "
                        + "Token \"{}\" within mapped secret name has no "
                        + "defined value in the current context.",
                        entry.getKey(), e.getTokenName());
                continue;
            }

            // Initiate asynchronous retrieval of the token value
            String tokenName = entry.getKey();
            Future<String> secret = secretService.getValue(
                    this, connectable, secretName);
            pendingTokens.put(tokenName, secret);

        }

        // Additionally include any dynamic, parameter-based tokens
        pendingTokens.putAll(secretService.getTokens(
                this, connectable, config, configFilter));

        return pendingTokens;

    }
Initiates asynchronous retrieval of all applicable tokens and
corresponding values from the vault, using the given TokenFilter to
filter tokens within the secret names prior to retrieving those secrets.

@param connectable
    The connection or connection group to which the connection is being
    established.

@param tokenMapping
    The mapping dictating the name of the secret which maps to each
    parameter token, where the key is the name of the parameter token
    and the value is the name of the secret. The name of the secret
    may contain its own tokens, which will be substituted using values
    from the given filter.

@param secretNameFilter
    The filter to use to substitute values for tokens in the names of
    secrets to be retrieved from the vault.

@param config
    The GuacamoleConfiguration of the connection for which tokens are
    being retrieved, if available. This may be null.

@param configFilter
    A TokenFilter instance that applies any tokens already available to
    be applied to the configuration of the Guacamole connection. These
    tokens will consist of tokens already supplied to connect().

@return
    A Map of token name to Future, where each Future represents the
    pending retrieval operation which will ultimately be completed with
    the value of all secrets mapped to that token.

@throws GuacamoleException
    If the value for any applicable secret cannot be retrieved from the
    vault due to an error.
extensions/guacamole-vault/modules/guacamole-vault-base/src/main/java/org/apache/guacamole/vault/user/VaultUserContext.java