public class ScpCfDestinationFacade extends Object implements DestinationFacade
Since currently no REST API is available to retrieve destination information, this class provides the ability to read HTTP destination information from the environment variable "destinations". The environment variable is expected to be in JSON format.
Example:
[{
"name": "ErpQueryEndpoint",
"url": "https://my-erp.com",
"username": "username",
"password": "password",
"proxyType": "INTERNET",
"properties": [
{
"key": "proxyHost",
"value": "my-proxy.com"
},
{
"key": "proxyPort",
"value": "8080"
},
{
"key": "TrustAll",
"value": "false"
}
]
}]
| Constructor and Description |
|---|
ScpCfDestinationFacade() |
| Modifier and Type | Method and Description |
|---|---|
void |
declareDestinations(Collection<String> destinationNames)
Declares the given destination names.
|
Destination |
getDestination(String destinationName)
Returns the
Destination for the given name. |
Map<String,Destination> |
getDestinationsByName()
Returns all known
Destinations that are of type DestinationType.HTTP by their names. |
DestinationType |
getDestinationType(String destinationName)
Returns the
DestinationType of the destination with the given name. |
GenericDestination |
getGenericDestination(String destinationName)
Returns the
GenericDeclaration for the given name. |
Map<String,? extends GenericDestination> |
getGenericDestinationsByName()
Returns all known
Destinations and RfcDestinations by their names. |
RfcDestination |
getRfcDestination(String destinationName)
Returns the
RfcDestination for the given name. |
Map<String,RfcDestination> |
getRfcDestinationsByName()
Returns all known
RfcDestinations that are of type DestinationType.RFC by their names. |
public void declareDestinations(Collection<String> destinationNames)
DestinationFacadeDestinationFacade.getDestination(String) and DestinationFacade.getDestinationsByName(), for example, during application
startup within a ServletContextListener.
Notes:
declareDestinations in interface DestinationFacadeDestinationDeclarator,
RequestContext,
DestinationsRequestContextListenerpublic DestinationType getDestinationType(String destinationName) throws DestinationNotFoundException, DestinationAccessException
DestinationFacadeDestinationType of the destination with the given name.getDestinationType in interface DestinationFacadeDestinationNotFoundException - If no destination with the given name can be found.DestinationAccessException - If there is an issue while accessing destination information.public GenericDestination getGenericDestination(String destinationName) throws DestinationNotFoundException, DestinationAccessException
DestinationFacadeGenericDeclaration for the given name.getGenericDestination in interface DestinationFacadeDestinationNotFoundException - If the GenericDeclaration cannot be found.DestinationAccessException - If there is an issue while accessing destination information.public Destination getDestination(String destinationName) throws DestinationNotFoundException, DestinationAccessException
DestinationFacadeDestination 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 DestinationFacade.getDestinationType(String).
getDestination in interface DestinationFacadeDestinationNotFoundException - 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.public RfcDestination getRfcDestination(String destinationName) throws DestinationNotFoundException, DestinationAccessException
DestinationFacadeRfcDestination 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 DestinationFacade.getDestinationType(String).
getRfcDestination in interface DestinationFacadeDestinationNotFoundException - 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.public Map<String,? extends GenericDestination> getGenericDestinationsByName() throws DestinationAccessException
DestinationFacadeDestinations and RfcDestinations by their names.getGenericDestinationsByName in interface DestinationFacadeDestinationAccessException - If there is an issue while accessing destination information.public Map<String,Destination> getDestinationsByName() throws DestinationAccessException
DestinationFacadeDestinations that are of type DestinationType.HTTP by their names.
To get all destinations, irrespective of their type, use DestinationFacade.getGenericDestinationsByName().
getDestinationsByName in interface DestinationFacadeDestinationAccessException - If there is an issue while accessing destination information.public Map<String,RfcDestination> getRfcDestinationsByName() throws DestinationAccessException
DestinationFacadeRfcDestinations that are of type DestinationType.RFC by their names.
To get all destinations, irrespective of their type, use DestinationFacade.getGenericDestinationsByName().
getRfcDestinationsByName in interface DestinationFacadeDestinationAccessException - If there is an issue while accessing destination information.Copyright © 2017 SAP SE. All rights reserved.