Interface CredentialRetriever

  • Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

    @FunctionalInterface
    public interface CredentialRetriever
    Retrieves credentials for a registry.
    • Method Detail

      • retrieve

        java.util.Optional<Credential> retrieve()
                                         throws CredentialRetrievalException
        Fetches the credentials. Implementations must be thread-safe.

        Implementations should return Optional.empty() if no credentials could be fetched with this CredentialRetriever (and so other credential retrieval methods may be tried), or throw an exception something went wrong when fetching the credentials.

        Returns:
        the fetched credentials or Optional.empty() if no credentials could be fetched with this provider
        Throws:
        CredentialRetrievalException - if the credential retrieval encountered an exception