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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionregisterDestination(Destination destination) Register aDestinationto this destination loader.registerDestination(HttpDestination destination) Register aHttpDestinationto 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, waitMethods inherited from interface com.sap.cloud.sdk.cloudplatform.connectivity.DestinationLoader
tryGetDestination
-
Constructor Details
-
DefaultDestinationLoader
public DefaultDestinationLoader()
-
-
Method Details
-
registerDestination
Register aDestinationto 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 aHttpDestinationto 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:DestinationLoaderRetrieves a destination for the given name and configuration options.The returned
Tryobject will contain aDestinationNotFoundExceptionin case the destination could not be found or aDestinationAccessExceptionwith more details in case something else went wrong.If the returned
Tryobject contains no Exception it will always contain a non-nullDestinationvalue.- Specified by:
tryGetDestinationin interfaceDestinationLoader- Parameters:
destinationName- The name of the destination to obtain.options- Additional settings to modify the behaviour of the destination loader.- Returns:
- A
Tryobject containing either the non-nullDestinationvalue or an exception.
-