@Beta public final class DefaultDestinationLoader extends Object implements DestinationLoader
DestinationLoader
with convenience methods to add HTTP
and RFC
destinations.Constructor and Description |
---|
DefaultDestinationLoader() |
Modifier and Type | Method and Description |
---|---|
DefaultDestinationLoader |
registerDestination(Destination destination)
Register a
Destination to this destination loader. |
DefaultDestinationLoader |
registerDestination(HttpDestination destination)
Convenience method for
registerDestination(Destination) . |
DefaultDestinationLoader |
registerDestination(RfcDestination destination)
Convenience method for
registerDestination(Destination) . |
io.vavr.control.Try<Destination> |
tryGetDestination(String destinationName,
DestinationOptions options)
Retrieves a destination for the given name and configuration options.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
tryGetDestination
@Nonnull public DefaultDestinationLoader registerDestination(@Nonnull HttpDestination destination)
registerDestination(Destination)
.destination
- A destination this loader should return when queried.registerDestination(Destination)
@Nonnull public DefaultDestinationLoader registerDestination(@Nonnull RfcDestination destination)
registerDestination(Destination)
.destination
- A destination this loader should return when queried.registerDestination(Destination)
@Nonnull public DefaultDestinationLoader registerDestination(@Nonnull Destination destination)
Destination
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.destination
- A destination this loader should return when queried.IllegalArgumentException
- if the destination name is null or empty.@Nonnull public io.vavr.control.Try<Destination> tryGetDestination(@Nonnull String destinationName, @Nonnull DestinationOptions options)
DestinationLoader
The returned Try
object will contain a
DestinationNotFoundException
in case the
destination could not be found or a
DestinationAccessException
with more details in
case something else went wrong.
If the returned Try
object contains no Exception it will always contain a non-null Destination
value.
tryGetDestination
in interface DestinationLoader
destinationName
- The name of the destination to obtain.options
- Additional settings to modify the behaviour of the destination loader.Try
object containing either the non-null Destination
value or an exception.Copyright © 2021 SAP SE. All rights reserved.