Class DefaultCsrfOutboundRequestDecorator

java.lang.Object
de.hybris.platform.outboundservices.decorator.impl.csrf.DefaultCsrfOutboundRequestDecorator
All Implemented Interfaces:
OutboundRequestDecorator

public class DefaultCsrfOutboundRequestDecorator extends Object implements OutboundRequestDecorator
Decorates SAP CPI outbound requests with CSRF tokens.
  • Constructor Details

    • DefaultCsrfOutboundRequestDecorator

      public DefaultCsrfOutboundRequestDecorator()
  • Method Details

    • isApplicable

      public boolean isApplicable(DecoratorContext decoratorContext)
      Description copied from interface: OutboundRequestDecorator
      Determines if the decorator is applicable.
      Specified by:
      isApplicable in interface OutboundRequestDecorator
      Parameters:
      decoratorContext - with the information about the request being decorated.
      Returns:
      true if the decorator is applicable; false if not
    • getHeadersForTokenFetching

      protected static org.springframework.http.HttpHeaders getHeadersForTokenFetching()
    • decorate

      public org.springframework.http.HttpEntity<Map<String,Object>> decorate(org.springframework.http.HttpHeaders httpHeaders, Map<String,Object> payload, DecoratorContext context, DecoratorExecution execution)
      Description copied from interface: OutboundRequestDecorator
      Decorates an Outbound request
      Specified by:
      decorate in interface OutboundRequestDecorator
      Parameters:
      httpHeaders - The headers to be used for the outgoing request.
      payload - The payload used for the request
      context - Some extra information that can be used by decorators.
      execution - The execution chain.
      Returns:
      An HttpEntity containing the result of the decoration. Normally by calling execution.createHttpEntity()
    • fetchCsrfTokenFromSCPI

      protected de.hybris.platform.outboundservices.decorator.impl.csrf.CsrfParameters fetchCsrfTokenFromSCPI(ConsumedDestinationModel destinationModel)
    • getIntegrationRestTemplateFactory

      protected IntegrationRestTemplateFactory getIntegrationRestTemplateFactory()
    • setIntegrationRestTemplateFactory

      public void setIntegrationRestTemplateFactory(IntegrationRestTemplateFactory integrationRestTemplateFactory)
    • getCache

      protected IntegrationCache<CsrfParametersCacheKey,de.hybris.platform.outboundservices.decorator.impl.csrf.CsrfParameters> getCache()
    • setCache

      public void setCache(IntegrationCache<CsrfParametersCacheKey,de.hybris.platform.outboundservices.decorator.impl.csrf.CsrfParameters> cache)