Class DestinationService
- All Implemented Interfaces:
DestinationLoader
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
Static builder class.static final class
Helper class that encapsulates all caching related configuration options. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic DestinationService.Builder
builder()
Static builder.Fetches all destination properties from the BTP Destination Service on behalf of the current tenant.getAllDestinationProperties
(DestinationServiceRetrievalStrategy retrievalStrategy) Fetches all destination properties from the BTP Destination Service.getDestinationProperties
(String destinationName) Fetches the properties of a specific destination from the BTP Destination Service on behalf of the current tenant.io.vavr.control.Try<Iterable<Destination>>
Deprecated.since 5.1.0.io.vavr.control.Try<Iterable<Destination>>
tryGetAllDestinations
(DestinationOptions options) Deprecated.since 5.1.0.io.vavr.control.Try<Destination>
tryGetDestination
(String destinationName, DestinationOptions options) Retrieves a destination for the given name and configuration options.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.sap.cloud.sdk.cloudplatform.connectivity.DestinationLoader
tryGetDestination
-
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 aDestinationNotFoundException
in case the destination could not be found or aDestinationAccessException
with more details in case something else went wrong.If the returned
Try
object contains no Exception it will always contain a non-nullDestination
value.- Specified by:
tryGetDestination
in interfaceDestinationLoader
- 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-nullDestination
value or an exception.
-
tryGetAllDestinations
Deprecated.since 5.1.0. UsegetAllDestinationProperties()
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
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
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.tryGetDestination(String, DestinationOptions)
instead.- 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
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.tryGetDestination(String, DestinationOptions)
instead.- Parameters:
retrievalStrategy
- Strategy for loading destinations in a multi-tenant application.- Returns:
- A list of destination properties.
- Since:
- 5.12.0
-
getDestinationProperties
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
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.tryGetDestination(String, DestinationOptions)
instead.- 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. UsegetAllDestinationProperties()
andgetAllDestinationProperties(DestinationServiceRetrievalStrategy)
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
Static builder.- Returns:
- A builder to prepare a customised instance.
- Since:
- 4.4.0
-