Interface ServiceBindingDestinationLoader
- All Known Implementing Classes:
IdentityAuthenticationServiceBindingDestinationLoader,MegacliteServiceBindingDestinationLoader,OAuth2ServiceBindingDestinationLoader
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Represents a class that is capable of transforming a
ServiceBinding and
ServiceBindingDestinationOptions into an HttpDestination.- Since:
- 4.16.0
-
Method Summary
Modifier and TypeMethodDescriptionReturns the default loader chain instance.default HttpDestinationTries to transform the givenoptionsinto anHttpDestination.newLoaderChain(List<ServiceBindingDestinationLoader> delegateLoaders) Returns a new loader chain instance that will query the provideddelegateLoadersin the provided order to try to transform the providedServiceBindingDestinationOptionsinto anHttpDestination.io.vavr.control.Try<HttpDestination>
-
Method Details
-
defaultLoaderChain
Returns the default loader chain instance. This instance will locate all availableServiceBindingDestinationLoaderimplementations (using the service loader pattern) on the classpath. Those instances will be queried in no particular order to try to transform the providedServiceBindingDestinationOptionsinto anHttpDestination.- Returns:
- The default loader chain instance.
-
newLoaderChain
@Nonnull static ServiceBindingDestinationLoader newLoaderChain(@Nonnull List<ServiceBindingDestinationLoader> delegateLoaders) Returns a new loader chain instance that will query the provideddelegateLoadersin the provided order to try to transform the providedServiceBindingDestinationOptionsinto anHttpDestination.- Parameters:
delegateLoaders- TheServiceBindingDestinationLoaderinstances that should be used.- Returns:
- A new loader chain instance.
-
tryGetDestination
@Nonnull io.vavr.control.Try<HttpDestination> tryGetDestination(@Nonnull ServiceBindingDestinationOptions options) - Parameters:
options- TheServiceBindingDestinationOptionsthat contain further context information about how the transformation process should be done.- Returns:
- Either a
Try.success(Object)if the transformation succeeded,Try.failure(Throwable)otherwise.In case of a
Try.failure(Throwable), the cause will either be aDestinationAccessExceptionor aDestinationNotFoundException.
-
getDestination
@Nonnull default HttpDestination getDestination(@Nonnull ServiceBindingDestinationOptions options) throws DestinationAccessException, DestinationNotFoundException Tries to transform the givenoptionsinto anHttpDestination.This method is equivalent to
tryGetDestination(options).get();.- Parameters:
options- TheServiceBindingDestinationOptionsthat contain further context information (such as theServiceBindingthat should be transformed) for the transformation process.- Returns:
- An
HttpDestinationthat can be used to connect to be bound service. - Throws:
DestinationAccessException- Thrown if the providedoptionscouldn't be transformed into anHttpDestination.DestinationNotFoundException- Thrown if noHttpDestinationcould be found for the providedoptions.
-