Class IntegrationKeyExtractorTemplate

java.lang.Object
de.hybris.platform.odata2services.odata.monitoring.impl.IntegrationKeyExtractorTemplate
All Implemented Interfaces:
IntegrationKeyExtractor
Direct Known Subclasses:
JsonIntegrationKeyExtractor, XmlIntegrationKeyExtractor

public abstract class IntegrationKeyExtractorTemplate extends Object implements IntegrationKeyExtractor
Base flow for extracting integration key values
  • Constructor Details

    • IntegrationKeyExtractorTemplate

      public IntegrationKeyExtractorTemplate()
  • Method Details

    • extractIntegrationKey

      public String extractIntegrationKey(String responseBody, int statusCode)
      Extracts integration key from the provided response body. If response body is not empty or null, then it's passed to extractIntegrationKeyFromNonEmptyBody(String, int), which extracts integration key from the specific response structure. Then the extracted value is decoded by decode(String) method.
      Specified by:
      extractIntegrationKey in interface IntegrationKeyExtractor
      Parameters:
      responseBody - response body to extract the integrationKey value from
      statusCode - status code of the response, which may be important when response body has different structure for different response statuses.
      Returns:
      extracted value
    • extractIntegrationKeyFromNonEmptyBody

      protected abstract String extractIntegrationKeyFromNonEmptyBody(String responseBody, int statusCode)
      Extracts integration key from the response body in a way specific to the implemenation.
      Parameters:
      responseBody - response body to be parsed.
      statusCode - status code of the response.
      Returns:
      integration key value.
    • decode

      protected String decode(String value)
      Decodes value. This method uses URLDecoder for decoding.
      Parameters:
      value - an integration key value to be decoded.
      Returns:
      decoded value.