public final class DestinationAccessor extends Object
DestinationFacade, offering methods to conveniently declare and get destinations.| Constructor and Description |
|---|
DestinationAccessor() |
| Modifier and Type | Method and Description |
|---|---|
static void |
declareDestinations(Collection<String> destinationNames)
Declares the given destination names.
|
static void |
declareDestinations(String... destinationNames)
Delegates to
declareDestinations(Collection). |
static Destination |
getDestination(String destinationName)
Returns the
Destination for the given name. |
static DestinationFacade |
getDestinationFacade()
Returns the
DestinationFacade instance. |
static Map<String,Destination> |
getDestinationsByName()
Returns all known
Destinations that are of type DestinationType.HTTP by their names. |
static DestinationType |
getDestinationType(String destinationName)
Returns the
DestinationType of the destination with the given name. |
static GenericDestination |
getGenericDestination(String destinationName)
Returns the
GenericDestination for the given name. |
static Map<String,GenericDestination> |
getGenericDestinationsByName()
Returns all known destinations by their names, irrespective of their type.
|
static DestinationRetrievalStrategy |
getRetrievalStrategy(String destinationName)
Gets the configured retrieval strategy for a given destination name.
|
static RfcDestination |
getRfcDestination(String destinationName)
Returns the
RfcDestination for the given name. |
static Map<String,RfcDestination> |
getRfcDestinationsByName()
Returns all known
RfcDestinations that are of type DestinationType.RFC by their names. |
static void |
setDestinationFacade(DestinationFacade destinationFacade)
Replaces the default
DestinationFacade instance. |
static void |
setRetrievalStrategy(String destinationName,
DestinationRetrievalStrategy strategy)
For a given destination name, the way how it is loaded in a multi-tenant application can be configured using this
method.
|
public static void setDestinationFacade(@Nonnull DestinationFacade destinationFacade)
DestinationFacade instance. This method is for internal use only.destinationFacade - The facade to replace the default/current one with.public static void declareDestinations(String... destinationNames)
declareDestinations(Collection).destinationNames - The names of all destination that should get declared.public static void declareDestinations(Collection<String> destinationNames)
getDestination(String) and getDestinationsByName(), for example, during application
startup within a ServletContextListener.
Notes:
destinationNames - The collection of all destination names that should get declared.DestinationDeclarator,
DestinationsRequestContextListenerpublic static void setRetrievalStrategy(@Nonnull String destinationName, @Nonnull DestinationRetrievalStrategy strategy)
destinationName - Name of destination to set retrieval strategy for.strategy - The retrieval strategy to use - see DestinationRetrievalStrategy for details on available
strategies.@Nonnull public static DestinationRetrievalStrategy getRetrievalStrategy(@Nonnull String destinationName)
destinationName - Name of destination to get the retrieval strategy for.setRetrievalStrategy, or
DestinationRetrievalStrategy.PLATFORM_DEFAULT if no strategy was set.@Nonnull public static DestinationType getDestinationType(String destinationName) throws DestinationNotFoundException, DestinationAccessException
DestinationType of the destination with the given name.destinationName - The destination name to get the destination type for.DestinationNotFoundException - If no destination with the given name can be found.DestinationAccessException - If there is an issue while accessing destination information.@Nonnull public static GenericDestination getGenericDestination(String destinationName) throws DestinationNotFoundException, DestinationAccessException
GenericDestination for the given name.destinationName - The destination name to get the associated destination for.DestinationNotFoundException - If the GenericDestination cannot be found.DestinationAccessException - If there is an issue while accessing destination information.@Nonnull public static Destination getDestination(String destinationName) throws DestinationNotFoundException, DestinationAccessException
Destination for the given name.
Note: The destination must be of type DestinationType.HTTP, otherwise an exception is thrown. You can
check the type of the destination with getDestinationType(String).
destinationName - The destination name to the get the HTTP-destination for.DestinationNotFoundException - If the Destination cannot be found.DestinationAccessException - If the destination is not of type DestinationType.HTTP or there is an issue while accessing
destination information.@Nonnull public static RfcDestination getRfcDestination(String destinationName) throws DestinationNotFoundException, DestinationAccessException
RfcDestination for the given name.
Note: The destination must be of type DestinationType.RFC, otherwise an exception is thrown. You can
check the type of the destination with getDestinationType(String).
destinationName - The destination name to get the RFC-destination for.DestinationNotFoundException - If the RfcDestination cannot be found.DestinationAccessException - If the destination is not of type DestinationType.RFC or there is an issue while accessing
destination information.@Nonnull public static Map<String,GenericDestination> getGenericDestinationsByName() throws DestinationAccessException
DestinationAccessException - If there is an issue while accessing destination information.@Nonnull public static Map<String,Destination> getDestinationsByName() throws DestinationAccessException
Destinations that are of type DestinationType.HTTP by their names.
To get all destinations, irrespective of their type, use getGenericDestinationsByName().
DestinationAccessException - If there is an issue while accessing destination information.@Nonnull public static Map<String,RfcDestination> getRfcDestinationsByName() throws DestinationAccessException
RfcDestinations that are of type DestinationType.RFC by their names.
To get all destinations, irrespective of their type, use getGenericDestinationsByName().
DestinationAccessException - If there is an issue while accessing destination information.@Nullable public static DestinationFacade getDestinationFacade()
DestinationFacade instance. For internal use only.Copyright © 2018 SAP SE. All rights reserved.