Package wt.util
Class CustomIntegrationHelper
java.lang.Object
wt.util.CustomIntegrationHelper
- All Implemented Interfaces:
wt.util.IntegrationHelperIfc
Helper class to retrieve configured connection information for external
HTTP/HTTPs endpoints.
Example Usage:
Supported API: true
Extendable: false
CustomIntegrationHelper customIntegrationHelper = new CustomIntegrationHelper("erp-dev");
// get absolute url associated with "materialapi" URL fragment for erp-dev system
customIntegrationHelper.getNamedEndpoint("materialapi");
// get a map of saved secret pairs for erp-dev system
customIntegrationHelper.getSecretsMap();
// get an SSLContent object required for establishing HTTPS connections with erp-dev system
customIntegrationHelper.getSSLContext();
Supported API: true
Extendable: false
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the base URI for the specified connection name
Supported API: trueFetches the default HTTP method to be used for payload delivery from extConnections.properties.Returns a map of header key value pairs for this endpointGets an initialized SSLContext object required for establishing HTTPS connectiongetNamedEndpointURI(String endpointName) Gets the String representation of URI for the specified connection nameReturns a map of unencrypted key value pairs of stored secrets for this endpoint
-
Constructor Details
-
CustomIntegrationHelper
Constructor for this class Accepts the connection name as a parameter for which we need to fetch the configured connection information
Supported API: true- Parameters:
connectionName- the name of connection/endpoint for which we need to fetch the configured connection information.
-
-
Method Details
-
getBaseURI
Gets the base URI for the specified connection name
Supported API: true- Parameters:
endpointName- the endpoint name for which we want to get the base URI- Returns:
- the base URI for the endpoint associated with this endpoint name
-
getSecretsMap
Returns a map of unencrypted key value pairs of stored secrets for this endpoint
Supported API: true- Specified by:
getSecretsMapin interfacewt.util.IntegrationHelperIfc- Returns:
- A map of unencrypted key value pairs of secrets
- Throws:
KeyStoreException
-
getDefaultPayloadHttpMethod
Fetches the default HTTP method to be used for payload delivery from extConnections.properties. Supported API: true- Returns:
- Default payload HTTP method
- Throws:
IOException
-
getHeadersMap
Returns a map of header key value pairs for this endpoint
Supported API: true- Returns:
- A map of header key value pairs
- Throws:
KeyStoreExceptionIOException
-
getInitializedSSLContext
public SSLContext getInitializedSSLContext() throws NoSuchAlgorithmException, KeyStoreException, UnrecoverableKeyException, NoSuchAlgorithmException, KeyManagementExceptionGets an initialized SSLContext object required for establishing HTTPS connection The SSLContext will be already initialized using KeyManagerFactories and TrustManagerFactories based on client certificate and/or server certificate provided to PTC.
Supported API: true- Specified by:
getInitializedSSLContextin interfacewt.util.IntegrationHelperIfc- Returns:
- Initialized SSLContext object which can be used to make HTTPS connections to this endpoint
- Throws:
NoSuchAlgorithmExceptionKeyStoreExceptionUnrecoverableKeyExceptionKeyManagementException
-
getNamedEndpointURI
Gets the String representation of URI for the specified connection name If the baseurl is provided, the return value will be automatically prefixed with the baseurl. Example: If the baseurl provided ishttps://www.dummy.comand URL fragments provided are:- /material
- /inventory
getNamedEndpointURI("material")will returnhttps://www.dummy.com/materialand
getNamedEndpointURI("inventory")will returnhttps://www.dummy.com/inventory
Supported API: true- Specified by:
getNamedEndpointURIin interfacewt.util.IntegrationHelperIfc- Parameters:
endpointName- the endpoint name for which we want to get the String URI- Returns:
- the String URI for the endpoint associated with this endpoint name
- Throws:
Exception
-