Class CredentialsContainerSupport

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private final Provider<Credentials> configuredCredentials
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      Provider<Credentials> getConfiguredCredentials()
      Unit credentials(Action<in PasswordCredentials> configAction) Configures the username/password credentials for this service using the supplied action.
      <T extends Credentials> Unit credentials(Class<T> type, Action<in T> configAction) Configures the credentials for this service using the supplied action.
      PasswordCredentials getCredentials() Returns the username/password credentials used to authenticate to this service.
      <T extends Credentials> T getCredentials(Class<T> type) Returns the credentials of the specified type used to authenticate with this service.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CredentialsContainerSupport

        CredentialsContainerSupport(ObjectFactory objectFactory, CredentialsFactory credentialsFactory)
    • Method Detail

      • credentials

         Unit credentials(Action<in PasswordCredentials> configAction)

        Configures the username/password credentials for this service using the supplied action.

        If no credentials have been assigned to this repository, an empty set of username/password credentials is assigned to this repository and passed to the action.

        credentials {
            username = 'joe'
            password = 'secret'
        }
      • credentials

         <T extends Credentials> Unit credentials(Class<T> type, Action<in T> configAction)

        Configures the credentials for this service using the supplied action.

        If no credentials have been assigned to this repository, an empty set of credentials of the specified type will be assigned to this repository and given to the configuration action.

        If credentials have already been specified for this repository, they will be passed to the given configuration action.

        credentials(CertificateCredentials) {
            certificateFile file("/path/to/certificate")
            keyFile file("/path/to/key")
        }

        The following credential types are currently supported for the type argument:

      • getCredentials

         PasswordCredentials getCredentials()

        Returns the username/password credentials used to authenticate to this service.

        If no credentials have been assigned to this repository, an empty set of username/password credentials is assigned to this repository and returned.

        If you are using a different type of credentials than PasswordCredentials, please use the getCredentials(Class) method to obtain the credentials.

        Returns:

        the current PasswordCredentials

      • getCredentials

         <T extends Credentials> T getCredentials(Class<T> type)

        Returns the credentials of the specified type used to authenticate with this service.

        If no credentials have been assigned to this repository, an empty set of credentials of the specified type is assigned to this repository and returned.

        Returns:

        the credentials