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)
      Specified by:
      tryGetDestination in interface DestinationLoader
    • 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.

      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
    • getDestinationProperties

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

      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)
      Deprecated.
      since 5.1.0. Use getAllDestinationProperties() instead.
      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