Class DestinationService

java.lang.Object
com.sap.cloud.sdk.cloudplatform.connectivity.DestinationService
All Implemented Interfaces:
DestinationLoader

public class DestinationService extends Object implements DestinationLoader
Retrieves destination information from the SCP destination service on Cloud Foundry.
  • Constructor Details

    • DestinationService

      public DestinationService()
      Create instance with all default settings
  • Method Details

    • tryGetDestination

      @Nonnull public io.vavr.control.Try<Destination> tryGetDestination(@Nonnull String destinationName, @Nonnull DestinationOptions options)
      Description copied from interface: DestinationLoader
      Retrieves a destination for the given name and configuration options.

      The returned Try object will contain a DestinationNotFoundException in case the destination could not be found or a DestinationAccessException with more details in case something else went wrong.

      If the returned Try object contains no Exception it will always contain a non-null Destination value.

      Specified by:
      tryGetDestination in interface DestinationLoader
      Parameters:
      destinationName - The name of the destination to obtain.
      options - Additional settings to modify the behaviour of the destination loader.
      Returns:
      A Try object containing either the non-null Destination value or an exception.
    • tryGetAllDestinations

      @Deprecated @Nonnull public io.vavr.control.Try<Iterable<Destination>> tryGetAllDestinations()
      Deprecated.
      since 5.1.0. Use getAllDestinationProperties() instead.
      Fetches all destination properties from the BTP Destination Service.

      Caution: This will not perform any authorization flows for the destinations. Destinations obtained this way should only be used for accessing the properties of the destination configuration.

      In case there exists a destination with the same name on service instance and on sub-account level, the destination at service instance level takes precedence.
      Returns:
      A Try list of destinations.
    • getAllDestinationProperties

      @Nonnull public Collection<DestinationProperties> getAllDestinationProperties()
      Fetches all destination properties from the BTP Destination Service on behalf of the current tenant.

      Caution: This will not perform any authorization flows for the destinations. Destinations obtained this way should only be used for accessing the properties of the destination configuration. For obtaining full destination objects, use tryGetDestination(String, DestinationOptions) instead.

      In case there exists a destination with the same name on service instance and on sub-account level, the destination at service instance level takes precedence.
      Returns:
      A list of destination properties.
      Since:
      5.1.0
      See Also:
    • getAllDestinationProperties

      @Nonnull public Collection<DestinationProperties> getAllDestinationProperties(@Nonnull DestinationServiceRetrievalStrategy retrievalStrategy)
      Fetches all destination properties from the BTP Destination Service.

      Caution: This will not perform any authorization flows for the destinations. Destinations obtained this way should only be used for accessing the properties of the destination configuration. For obtaining full destination objects, use tryGetDestination(String, DestinationOptions) instead.

      In case there exists a destination with the same name on service instance and on sub-account level, the destination at service instance level takes precedence.
      Parameters:
      retrievalStrategy - Strategy for loading destinations in a multi-tenant application.
      Returns:
      A list of destination properties.
      Since:
      5.12.0
    • getDestinationProperties

      @Nonnull public DestinationProperties getDestinationProperties(@Nonnull String destinationName)
      Fetches the properties of a specific destination from the BTP Destination Service on behalf of the current tenant.

      Caution: This will not perform any authorization flows for the destination. Destinations obtained this way should only be used for accessing the properties of the destination configuration. For obtaining full destination objects, use tryGetDestination(String, DestinationOptions) instead.

      In case there exists a destination with the same name on service instance and on sub-account level, the destination at service instance level takes precedence.
      Parameters:
      destinationName - The name of the destination.
      Returns:
      A list of destination properties.
      Since:
      5.1.0
    • tryGetAllDestinations

      @Nonnull @Deprecated public io.vavr.control.Try<Iterable<Destination>> tryGetAllDestinations(@Nonnull DestinationOptions options)
      Fetches all destination properties from the BTP Destination Service.

      Uses the provided configuration options. In case there exist a destination with the same name on service instance and on sub account level, then the method prioritizes the destination at service instance level.

      Caution: This will not perform any authorization flows for the destinations. Destinations obtained this way should only be used for accessing the properties of the destination configuration.

      Parameters:
      options - Destination configuration object.
      Returns:
      A Try iterable of CF destinations.
    • builder

      @Beta @Nonnull public static DestinationService.Builder builder()
      Static builder.
      Returns:
      A builder to prepare a customised instance.
      Since:
      4.4.0