Class DefaultDestinationLoader
java.lang.Object
com.sap.cloud.sdk.cloudplatform.connectivity.DefaultDestinationLoader
- All Implemented Interfaces:
DestinationLoader
Default implementation of a
DestinationLoader
with convenience methods to add HTTP
and RFC
destinations.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionregisterDestination
(Destination destination) Register aDestination
to this destination loader.registerDestination
(HttpDestination destination) Register aHttpDestination
to this destination loader.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
-
DefaultDestinationLoader
public DefaultDestinationLoader()
-
-
Method Details
-
registerDestination
Register aDestination
to this destination loader. It must have a non-empty name to be identified by. If a destination with the same name was registered previously it will be replaced by this one.- Parameters:
destination
- A destination this loader should return when queried.- Returns:
- This loader instance.
- Throws:
IllegalArgumentException
- if the destination name is null or empty.
-
registerDestination
Register aHttpDestination
to this destination loader. It must have a non-empty name to be identified by. If a destination with the same name was registered previously it will be replaced by this one.- Parameters:
destination
- A destination this loader should return when queried.- Returns:
- This loader instance.
- Throws:
IllegalArgumentException
- if the destination name is null or empty.
-
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.
-