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
DestinationLoader
s to go through until a destination was found.-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
Builder class to construct aDestinationLoaderChain
. -
Constructor Summary
ConstructorDescriptionInstantiates aDestinationLoaderChain
based on the given loaders in the order returned byCollection.iterator()
. -
Method Summary
Modifier and TypeMethodDescriptionbuilder
(DestinationLoader firstLoader) Entry point to build a customDestinationLoaderChain
.protected boolean
boolean
int
hashCode()
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, wait
Methods inherited from interface com.sap.cloud.sdk.cloudplatform.connectivity.DestinationLoader
tryGetDestination
-
Constructor Details
-
DestinationLoaderChain
public DestinationLoaderChain(@Nonnull Collection<DestinationLoader> loaders) throws IllegalArgumentException Instantiates aDestinationLoaderChain
based 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
DestinationLoaderChainBuilder
without any registeredDestinationLoaderChain
.
-
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.
-
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-