Class DestinationLoaderChain
java.lang.Object
com.sap.cloud.sdk.cloudplatform.connectivity.DestinationLoaderChain
- All Implemented Interfaces:
DestinationLoader
Immutable implementation of the
DestinationLoader interface providing a way to define a chain
DestinationLoaders to go through until a destination was found.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilder class to construct aDestinationLoaderChain. -
Constructor Summary
ConstructorsConstructorDescriptionInstantiates aDestinationLoaderChainbased on the given loaders in the order returned byCollection.iterator(). -
Method Summary
Modifier and TypeMethodDescriptionbuilder(DestinationLoader firstLoader) Entry point to build a customDestinationLoaderChain.protected booleanbooleaninthashCode()toString()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, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.sap.cloud.sdk.cloudplatform.connectivity.DestinationLoader
tryGetDestination
-
Constructor Details
-
DestinationLoaderChain
public DestinationLoaderChain(@Nonnull Collection<DestinationLoader> loaders) throws IllegalArgumentException Instantiates aDestinationLoaderChainbased on the given loaders in the order returned byCollection.iterator().- Parameters:
loaders- The loaders to go though to find a destination.- Throws:
IllegalArgumentException- If the given collection of loaders is empty.
-
-
Method Details
-
builder
@Nonnull public static DestinationLoaderChain.DestinationLoaderChainBuilder builder(@Nonnull DestinationLoader firstLoader) Entry point to build a customDestinationLoaderChain.- Parameters:
firstLoader- The first loader to be used by the chain.- Returns:
- A
DestinationLoaderChainBuilderwithout any registeredDestinationLoaderChain.
-
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.
-
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-