Class ClientCredential.ClientCredentialBuilder

java.lang.Object
com.akamai.edgegrid.signer.ClientCredential.ClientCredentialBuilder
Enclosing class:
ClientCredential

public static class ClientCredential.ClientCredentialBuilder extends Object
Defines ClientCredential.ClientCredentialBuilder which is used to build instance of ClientCredential.
  • Constructor Details

    • ClientCredentialBuilder

      public ClientCredentialBuilder()
      Creates a new builder. The returned builder is equivalent to the builder generated by ClientCredential.builder().
  • Method Details

    • clientToken

      public ClientCredential.ClientCredentialBuilder clientToken(String clientToken)
      Sets a token representing an OPEN API service client.
      Parameters:
      clientToken - a client token
      Returns:
      reference back to this builder instance
    • clientSecret

      public ClientCredential.ClientCredentialBuilder clientSecret(String clientSecret)
      Sets a secret associated with a client token.
      Parameters:
      clientSecret - a client secret
      Returns:
      reference back to this builder instance
    • accessToken

      public ClientCredential.ClientCredentialBuilder accessToken(String accessToken)
      Sets an access token representing authorizations a client has for OPEN API service.
      Parameters:
      accessToken - an access token
      Returns:
      reference back to this builder instance
    • headersToSign

      public ClientCredential.ClientCredentialBuilder headersToSign(Set<String> headersToSign)

      Adds all of headersToSign into the builder's internal collection. This can be called multiple times to continue adding them. The set passed in is not stored directly, a copy is made instead.

      NOTE: All header names are lower-cased for storage. In HTTP, header names are case-insensitive anyway, and EdgeGrid does not support multiple headers with the same name. Forcing to lowercase here improves our chance of detecting bad requests early.

      Parameters:
      headersToSign - a Set of header names
      Returns:
      reference back to this builder instance
    • headerToSign

      public ClientCredential.ClientCredentialBuilder headerToSign(String headerName)

      Adds headerName into the builder's internal collection. This can be called multiple times to continue adding them.

      NOTE: All header names are lower-cased for storage. In HTTP, header names are case-insensitive anyway, and EdgeGrid does not support multiple headers with the same name. Forcing to lowercase here improves our chance of detecting bad requests early.

      Parameters:
      headerName - a header name
      Returns:
      reference back to this builder instance
    • host

      Sets a hostname to be used when making OPEN API requests with this credential.
      Parameters:
      host - a host name
      Returns:
      reference back to this builder instance
    • maxBodySize

      public ClientCredential.ClientCredentialBuilder maxBodySize(int maxBodySize)
      Sets the maximum body size that will be used for producing request signatures.
      Parameters:
      maxBodySize - a number of bytes
      Returns:
      reference back to this builder instance
    • build

      public ClientCredential build()
      Returns a newly-created immutable client credential.
      Returns:
      reference back to this builder instance