Package wt.util

Class CustomIntegrationHelper

java.lang.Object
wt.util.CustomIntegrationHelper

public class CustomIntegrationHelper extends Object
Helper class to retrieve configured connection information for external HTTP/HTTPs endpoints.

Example Usage:

 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 Details

    • CustomIntegrationHelper

      public CustomIntegrationHelper(String connectionName)
      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

      public URI 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
    • getNamedEndpointURI

      public URI getNamedEndpointURI(String endpointName)
      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 is https://www.dummy.com and URL fragments provided are:

      • /material
      • /inventory
      getNamedEndpointURI("material") will return https://www.dummy.com/material and
      getNamedEndpointURI("inventory") will return https://www.dummy.com/inventory



      Supported API: true

      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
    • getSecretsMap

      public Map<String,String> getSecretsMap()
      Returns a map of unencrypted key value pairs of stored secrets for this endpoint



      Supported API: true

      Returns:
      A map of unencrypted key value pairs of secrets
    • getInitializedSSLContext

      public SSLContext getInitializedSSLContext() throws NoSuchAlgorithmException
      Gets 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

      Returns:
      Initialized SSLContext object which can be used to make HTTPS connections to this endpoint
      Throws:
      NoSuchAlgorithmException