Class DefaultSapS4OMOutboundService

java.lang.Object
de.hybris.platform.sap.saps4omservices.services.impl.DefaultSapS4OMOutboundService
All Implemented Interfaces:
SapS4OMOutboundService

public class DefaultSapS4OMOutboundService extends Object implements SapS4OMOutboundService
This handles outbound requests for order simulation, order creation and order details.
  • Constructor Details

    • DefaultSapS4OMOutboundService

      public DefaultSapS4OMOutboundService()
  • Method Details

    • simulateOrder

      public SAPS4OMData simulateOrder(String destinationId, String destinationTargetId, SAPS4OMRequestData requestData) throws OutboundServiceException
      Description copied from interface: SapS4OMOutboundService
      Create salesOrderSimulation by passing requestData.
      Specified by:
      simulateOrder in interface SapS4OMOutboundService
      Parameters:
      destinationId - from Consumed Destination
      destinationTargetId - from Consumed Destination
      requestData - as request payload
      Returns:
      salesOrderSimulationData.
      Throws:
      OutboundServiceException
    • createOrder

      public SAPS4OMData createOrder(String destinationId, String destinationTargetId, SAPS4OMRequestData requestData) throws OutboundServiceException
      Description copied from interface: SapS4OMOutboundService
      Create order by passing requestData.
      Specified by:
      createOrder in interface SapS4OMOutboundService
      Parameters:
      destinationId - from Consumed Destination
      destinationTargetId - from Consumed Destination
      requestData - as request payload
      Returns:
      orderData from backend
      Throws:
      OutboundServiceException
    • fetchOrders

      public SAPS4OMOrders fetchOrders(String destinationId, String destinationTargetId, Map<String,List<FilterData>> filters) throws OutboundServiceException
      Description copied from interface: SapS4OMOutboundService
      Get the orders by filtering via filterData.
      Specified by:
      fetchOrders in interface SapS4OMOutboundService
      Parameters:
      destinationId - from Consumed Destination
      destinationTargetId - from Consumed Destination
      filters - provided to fetch order
      Returns:
      orders based on filter data
      Throws:
      OutboundServiceException
    • fetchOrderDetails

      public SAPS4OMData fetchOrderDetails(String destinationId, String destinationTargetId, String orderID, Map<String,List<FilterData>> filterData) throws OutboundServiceException
      Description copied from interface: SapS4OMOutboundService
      Get the order details for an orderID
      Specified by:
      fetchOrderDetails in interface SapS4OMOutboundService
      Parameters:
      destinationId - from Consumed Destination
      destinationTargetId - from Consumed Destination
      filterData - provided to fetch order
      Returns:
      orderData orderData from backend
      Throws:
      OutboundServiceException
    • fetchBillingDocumentsfromS4

      public SAPS4OMBillingData fetchBillingDocumentsfromS4(String destinationId, String destinationTargetId, Map<String,List<FilterData>> filterData, String orderCode) throws org.apache.velocity.exception.ResourceNotFoundException
      Description copied from interface: SapS4OMOutboundService
      Gets Billing Documents for sap order
      Specified by:
      fetchBillingDocumentsfromS4 in interface SapS4OMOutboundService
      Parameters:
      destinationId - from Consumed Destination
      destinationTargetId - from Consumed Destination
      filterData - provided to fetch order
      Returns:
      SAPS4OMBillingData
      Throws:
      org.apache.velocity.exception.ResourceNotFoundException
    • fetchPDFData

      public byte[] fetchPDFData(String destinationId, String destinationTargetId, Map<String,List<FilterData>> filterData, String billingPDFDocumentId, SAPOrderModel sapOrder) throws SapBillingInvoiceUserException
      Description copied from interface: SapS4OMOutboundService
      Gets PDF Data for sap order data
      Specified by:
      fetchPDFData in interface SapS4OMOutboundService
      Parameters:
      destinationId - from Consumed Destination
      destinationTargetId - from Consumed Destination
      filterData - provided to fetch order
      Returns:
      PDF Byte array
      Throws:
      SapBillingInvoiceUserException
    • sendRequest

      protected <T> org.springframework.http.ResponseEntity<T> sendRequest(ConsumedDestinationModel destinationModel, String url, org.springframework.http.HttpMethod method, SAPS4OMRequestData requestData, Class<T> responseType) throws OutboundServiceException
      Throws:
      OutboundServiceException
    • setHeaderAction

      protected String setHeaderAction(String url, org.springframework.http.HttpMethod method)
    • formatErrorResponse

      protected String formatErrorResponse(String errorResponse)
    • createHTTPHeader

      protected org.springframework.http.HttpHeaders createHTTPHeader(org.springframework.http.HttpHeaders authenticationResult)
    • getCsrfToken

      protected String getCsrfToken(org.springframework.http.HttpHeaders headers)
    • getCookies

      protected String getCookies(org.springframework.http.HttpHeaders headers)
    • getAuthenticationDetails

      protected org.springframework.http.HttpHeaders getAuthenticationDetails(ConsumedDestinationModel destinationModel) throws OutboundServiceException
      Throws:
      OutboundServiceException
    • getURL

      protected String getURL(ConsumedDestinationModel destinationModel, Map<String,List<FilterData>> filters)
    • getCsrfURL

      protected String getCsrfURL(ConsumedDestinationModel destinationModel)
    • saveHttpHeaderInSession

      protected void saveHttpHeaderInSession(String tokenKey, org.springframework.http.HttpHeaders header)
    • getHttpHeaderFromSession

      protected org.springframework.http.HttpHeaders getHttpHeaderFromSession(String tokenKey)
    • setTimeouts

      protected void setTimeouts(org.springframework.web.client.RestTemplate restTemplate)
    • getConfig

      protected String getConfig(String property)
    • getDestinationService

      protected de.hybris.platform.apiregistryservices.services.DestinationService<ConsumedDestinationModel> getDestinationService()
    • setDestinationService

      public void setDestinationService(de.hybris.platform.apiregistryservices.services.DestinationService<ConsumedDestinationModel> destinationService)
    • getSessionService

      protected de.hybris.platform.servicelayer.session.SessionService getSessionService()
    • setSessionService

      public void setSessionService(de.hybris.platform.servicelayer.session.SessionService sessionService)
    • getS4omRestTemplate

      public org.springframework.web.client.RestTemplate getS4omRestTemplate()
    • setS4omRestTemplate

      public void setS4omRestTemplate(org.springframework.web.client.RestTemplate s4omRestTemplate)
    • getOutboundRequestDecorator

      public List<SAPS4OMOutboundRequestDecorator> getOutboundRequestDecorator()
    • setOutboundRequestDecorator

      public void setOutboundRequestDecorator(List<SAPS4OMOutboundRequestDecorator> outboundRequestDecorator)
    • getCommonI18NService

      public de.hybris.platform.servicelayer.i18n.CommonI18NService getCommonI18NService()
    • setCommonI18NService

      public void setCommonI18NService(de.hybris.platform.servicelayer.i18n.CommonI18NService commonI18NService)
    • getRestTemplateFactory

      public de.hybris.platform.apiregistryservices.utils.DefaultRestTemplateFactory getRestTemplateFactory()
    • setRestTemplateFactory

      public void setRestTemplateFactory(de.hybris.platform.apiregistryservices.utils.DefaultRestTemplateFactory restTemplateFactory)
    • getConfigurationService

      public de.hybris.platform.servicelayer.config.ConfigurationService getConfigurationService()
    • setConfigurationService

      public void setConfigurationService(de.hybris.platform.servicelayer.config.ConfigurationService configurationService)