Class DestinationServiceOptionsAugmenter

java.lang.Object
com.sap.cloud.sdk.cloudplatform.connectivity.DestinationServiceOptionsAugmenter
All Implemented Interfaces:
DestinationOptionsAugmenter

public class DestinationServiceOptionsAugmenter extends Object implements DestinationOptionsAugmenter
Handles the getting and setting of DestinationOptions parameters specific to SCP Cloud Foundry platform.
  • Constructor Details

    • DestinationServiceOptionsAugmenter

      public DestinationServiceOptionsAugmenter()
  • Method Details

    • augmenter

      @Nonnull public static DestinationServiceOptionsAugmenter augmenter()
      Creates instances of DestinationServiceOptionsAugmenter in a builder-like style.
      Returns:
      A new augmenter instance.
    • retrievalStrategy

      @Nonnull public DestinationServiceOptionsAugmenter retrievalStrategy(@Nonnull DestinationServiceRetrievalStrategy strategy)
      Sets the strategy to use when loading destinations in a multi-tenant subscription environment. Not setting this value or setting to null results in platform default behaviour.
      Parameters:
      strategy - Strategy to use when loading destinations.
      Returns:
      The same augmenter that called this method.
    • tokenExchangeStrategy

      @Nonnull public DestinationServiceOptionsAugmenter tokenExchangeStrategy(@Nonnull DestinationServiceTokenExchangeStrategy strategy)
      Sets the DestinationServiceTokenExchangeStrategy to use when loading destinations. Not setting this value results in the platform default behavior.
      Parameters:
      strategy - Strategy to use when loading destinations.
      Returns:
      The same augmenter that called this method.
    • refreshToken

      @Nonnull public DestinationServiceOptionsAugmenter refreshToken(@Nonnull String refreshToken)
      Refresh token to be sent for destination of type AuthenticationType.OAUTH2_REFRESH_TOKEN.
      Parameters:
      refreshToken - Refresh token as encoded string.
      Returns:
      The same augmenter that called this method.
      Since:
      5.9.0
    • fragmentName

      @Nonnull public DestinationServiceOptionsAugmenter fragmentName(@Nonnull String fragmentName)
      Fragment that should enhance the destination to be fetched.
      Parameters:
      fragmentName - The fragment name.
      Returns:
      The same augmenter that called this method.
      Since:
      5.11.0
    • crossLevelConsumption

      @Beta @Nonnull public DestinationServiceOptionsAugmenter crossLevelConsumption(@Nonnull DestinationServiceOptionsAugmenter.CrossLevelScope scope)
      Enable cross-level consumption of destinations. Note: This is an experimental feature and may not function for all destination types.
      Parameters:
      scope - Set the scope where to look up the destination. This scope is only applied to the destination itself. The scopes for fragments or destination chain references have to be set separately.
      Returns:
      The same augmenter that called this method.
      Since:
      5.22.0
    • customHeaders

      @Beta @Nonnull public DestinationServiceOptionsAugmenter customHeaders(@Nonnull Header... headers)
      Adds custom headers to the destination request. Use this to add parameters that are not directly supported by the SDK. For example, use this to achieve destination chaining.

      Note: Any secret values added as custom headers here will not be masked in log output and may appear in plain text on debug log level.

      Parameters:
      headers - The headers to be added.
      Returns:
      The same augmenter that called this method.
      Since:
      5.22.0
    • augmentBuilder

      public void augmentBuilder(@Nonnull DestinationOptions.Builder builder)
      Description copied from interface: DestinationOptionsAugmenter
      Use this class to set configuration parameters that are specific to a platform/environment/etc. Once called, any parameter setting methods of this class will affect the provided DestinationOptions.Builder and the resulting DestinationOptions object that the builder creates.
      Specified by:
      augmentBuilder in interface DestinationOptionsAugmenter
      Parameters:
      builder - The builder to attach this augmenter to
    • getRetrievalStrategy

      @Nonnull public static io.vavr.control.Option<DestinationServiceRetrievalStrategy> getRetrievalStrategy(@Nonnull DestinationOptions options)
      Retrieves the configured strategy to use when loading destinations in a multi-tenant subscription environment.
      Parameters:
      options - The destination options instance that stores the key/value pair.
      Returns:
      An Option wrapping the retrieval strategy if the parameter is present, otherwise a Option.None.
    • getTokenExchangeStrategy

      @Nonnull public static io.vavr.control.Option<DestinationServiceTokenExchangeStrategy> getTokenExchangeStrategy(@Nonnull DestinationOptions options)
      Retrieves the configured DestinationServiceTokenExchangeStrategy to use when loading destinations.
      Parameters:
      options - The destination options instance that stores the key/value pair.
      Returns:
      An Option wrapping the token exchange strategy if the parameter is present, otherwise a Option.None.