Class DefaultErpHttpDestination.Builder

java.lang.Object
com.sap.cloud.sdk.s4hana.connectivity.DefaultErpHttpDestination.Builder
Enclosing class:
DefaultErpHttpDestination

public static class DefaultErpHttpDestination.Builder extends Object
Builder class to allow for easy creation of an immutable DefaultErpHttpDestination instance.
  • Method Details

    • sapClient

      @Nonnull public DefaultErpHttpDestination.Builder sapClient(@Nonnull SapClient sapClient)
      Sets the sap client to be used by the destination currently build.
      Parameters:
      sapClient - The sap client to use.
      Returns:
      This builder.
    • locale

      @Nonnull public DefaultErpHttpDestination.Builder locale(@Nonnull Locale locale)
      Sets the locale to be used by the destination currently build.
      Parameters:
      locale - The locale to use.
      Returns:
      This builder.
    • tlsVersion

      @Nonnull public DefaultErpHttpDestination.Builder tlsVersion(@Nonnull String value)
      Sets the TLS version used by the DefaultErpHttpDestination to the given value.
      Parameters:
      value - The TLS version that should be used.
      Returns:
      This builder.
    • property

      @Nonnull public DefaultErpHttpDestination.Builder property(@Nonnull String key, @Nonnull Object value)
      Adds the given key-value pair to the destination to be created. This will overwrite any property already assigned to the key.
      Parameters:
      key - The key to assign a property for.
      value - The property value to be assigned.
      Returns:
      This builder.
    • keyStorePassword

      @Nonnull public DefaultErpHttpDestination.Builder keyStorePassword(@Nonnull String value)
      Sets the key store password for the corresponding KeyStore used by the DefaultErpHttpDestination to access the key store.
      Parameters:
      value - The keyStore password that should be used.
      Returns:
      This builder.
    • keyStore

      @Nonnull public DefaultErpHttpDestination.Builder keyStore(@Nonnull KeyStore keyStore)
      Sets the KeyStore to be used when communicating over HTTP.
      Parameters:
      keyStore - The keyStore that should be used. for HTTP communication
      Returns:
      This builder.
    • trustAllCertificates

      @Nonnull public DefaultErpHttpDestination.Builder trustAllCertificates()
      Lets the DefaultErpHttpDestination trust all server certificates.
      Returns:
      This builder.
    • name

      @Nonnull public DefaultErpHttpDestination.Builder name(@Nonnull String name)
      Sets the name of the DefaultErpHttpDestination.
      Parameters:
      name - The destination name
      Returns:
      This builder.
    • proxy

      @Nonnull public DefaultErpHttpDestination.Builder proxy(@Nonnull URI proxyUri)
      Sets the proxy URI of the DefaultErpHttpDestination.
      Parameters:
      proxyUri - The URI of the proxy
      Returns:
      This builder.
    • proxy

      @Nonnull public DefaultErpHttpDestination.Builder proxy(@Nonnull String proxyHost, int proxyPort)
      Sets the proxy host and proxy port of the DefaultErpHttpDestination.
      Parameters:
      proxyHost - The host of the proxy
      proxyPort - The port of the proxy
      Returns:
      This builder.
    • proxyType

      @Nonnull public DefaultErpHttpDestination.Builder proxyType(@Nonnull ProxyType proxyType)
      Sets the proxy type (Internet or On-Premise).
      Parameters:
      proxyType - Type of proxy this destination is configured for.
      Returns:
      This builder.
    • authenticationType

      @Nonnull public DefaultErpHttpDestination.Builder authenticationType(@Nonnull AuthenticationType authenticationType)
      Sets the enum value for AuthenticationType.
      Parameters:
      authenticationType - The authentication type used for the destination
      Returns:
      This builder.
    • user

      @Nonnull public DefaultErpHttpDestination.Builder user(@Nonnull String user)
      Sets the user name of the DefaultErpHttpDestination.
      Parameters:
      user - The user name of the destination
      Returns:
      This builder.
    • password

      @Nonnull public DefaultErpHttpDestination.Builder password(@Nonnull String password)
      Sets the password of the DefaultErpHttpDestination.
      Parameters:
      password - The password of the destination
      Returns:
      This builder.
    • basicCredentials

      @Nonnull public DefaultErpHttpDestination.Builder basicCredentials(@Nonnull BasicCredentials basicCredentials)
      Sets the credentials for accessing the destination when basic authentication is used.
      Parameters:
      basicCredentials - Username and password represented as a BasicCredentials object.
      Returns:
      This builder.
    • header

      @Nonnull public DefaultErpHttpDestination.Builder header(@Nonnull Header header)
      Adds the given header to the list of headers added to every outgoing request for this destination.
      Parameters:
      header - A header to add to outgoing requests.
      Returns:
      This builder.
    • header

      @Nonnull public DefaultErpHttpDestination.Builder header(@Nonnull String headerName, @Nonnull String headerValue)
      Adds a header given by the headerName and headerValue to the list of headers added to every outgoing request for this destination.
      Parameters:
      headerName - The name of the header to add.
      headerValue - The value of the header to add.
      Returns:
      This builder.
    • build

      @Nonnull public DefaultErpHttpDestination build()
      Finally creates the DefaultErpHttpDestination with the properties retrieved via the property(String, Object) method.
      Returns:
      A fully instantiated DefaultErpHttpDestination.