Class DefaultSapS4OMOutboundService
java.lang.Object
de.hybris.platform.sap.saps4omservices.services.impl.DefaultSapS4OMOutboundService
- All Implemented Interfaces:
SapS4OMOutboundService
This handles outbound requests for order simulation, order creation and order details.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected org.springframework.http.HttpHeaderscreateHTTPHeader(org.springframework.http.HttpHeaders authenticationResult) createOrder(String destinationId, String destinationTargetId, SAPS4OMRequestData requestData) Create order by passing requestData.fetchBillingDocumentsfromS4(String destinationId, String destinationTargetId, Map<String, List<FilterData>> filterData, String orderCode) Gets Billing Documents for sap orderfetchOrderDetails(String destinationId, String destinationTargetId, String orderID, Map<String, List<FilterData>> filterData) Get the order details for an orderIDfetchOrders(String destinationId, String destinationTargetId, Map<String, List<FilterData>> filters) Get the orders by filtering via filterData.byte[]fetchPDFData(String destinationId, String destinationTargetId, Map<String, List<FilterData>> filterData, String billingPDFDocumentId, SAPOrderModel sapOrder) Gets PDF Data for sap order dataprotected StringformatErrorResponse(String errorResponse) protected org.springframework.http.HttpHeadersgetAuthenticationDetails(ConsumedDestinationModel destinationModel) de.hybris.platform.servicelayer.i18n.CommonI18NServiceprotected Stringde.hybris.platform.servicelayer.config.ConfigurationServiceprotected StringgetCookies(org.springframework.http.HttpHeaders headers) protected StringgetCsrfToken(org.springframework.http.HttpHeaders headers) protected StringgetCsrfURL(ConsumedDestinationModel destinationModel) protected de.hybris.platform.apiregistryservices.services.DestinationService<ConsumedDestinationModel>protected org.springframework.http.HttpHeadersgetHttpHeaderFromSession(String tokenKey) de.hybris.platform.apiregistryservices.utils.DefaultRestTemplateFactoryorg.springframework.web.client.RestTemplateprotected de.hybris.platform.servicelayer.session.SessionServiceprotected StringgetURL(ConsumedDestinationModel destinationModel, Map<String, List<FilterData>> filters) protected voidsaveHttpHeaderInSession(String tokenKey, org.springframework.http.HttpHeaders header) protected <T> org.springframework.http.ResponseEntity<T>sendRequest(ConsumedDestinationModel destinationModel, String url, org.springframework.http.HttpMethod method, SAPS4OMRequestData requestData, Class<T> responseType) voidsetCommonI18NService(de.hybris.platform.servicelayer.i18n.CommonI18NService commonI18NService) voidsetConfigurationService(de.hybris.platform.servicelayer.config.ConfigurationService configurationService) voidsetDestinationService(de.hybris.platform.apiregistryservices.services.DestinationService<ConsumedDestinationModel> destinationService) protected StringsetHeaderAction(String url, org.springframework.http.HttpMethod method) voidsetOutboundRequestDecorator(List<SAPS4OMOutboundRequestDecorator> outboundRequestDecorator) voidsetRestTemplateFactory(de.hybris.platform.apiregistryservices.utils.DefaultRestTemplateFactory restTemplateFactory) voidsetS4omRestTemplate(org.springframework.web.client.RestTemplate s4omRestTemplate) voidsetSessionService(de.hybris.platform.servicelayer.session.SessionService sessionService) protected voidsetTimeouts(org.springframework.web.client.RestTemplate restTemplate) simulateOrder(String destinationId, String destinationTargetId, SAPS4OMRequestData requestData) Create salesOrderSimulation by passing requestData.
-
Constructor Details
-
DefaultSapS4OMOutboundService
public DefaultSapS4OMOutboundService()
-
-
Method Details
-
simulateOrder
public SAPS4OMData simulateOrder(String destinationId, String destinationTargetId, SAPS4OMRequestData requestData) throws OutboundServiceException Description copied from interface:SapS4OMOutboundServiceCreate salesOrderSimulation by passing requestData.- Specified by:
simulateOrderin interfaceSapS4OMOutboundService- Parameters:
destinationId- from Consumed DestinationdestinationTargetId- from Consumed DestinationrequestData- as request payload- Returns:
- salesOrderSimulationData.
- Throws:
OutboundServiceException
-
createOrder
public SAPS4OMData createOrder(String destinationId, String destinationTargetId, SAPS4OMRequestData requestData) throws OutboundServiceException Description copied from interface:SapS4OMOutboundServiceCreate order by passing requestData.- Specified by:
createOrderin interfaceSapS4OMOutboundService- Parameters:
destinationId- from Consumed DestinationdestinationTargetId- from Consumed DestinationrequestData- as request payload- Returns:
- orderData from backend
- Throws:
OutboundServiceException
-
fetchOrders
public SAPS4OMOrders fetchOrders(String destinationId, String destinationTargetId, Map<String, List<FilterData>> filters) throws OutboundServiceExceptionDescription copied from interface:SapS4OMOutboundServiceGet the orders by filtering via filterData.- Specified by:
fetchOrdersin interfaceSapS4OMOutboundService- Parameters:
destinationId- from Consumed DestinationdestinationTargetId- from Consumed Destinationfilters- 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 OutboundServiceExceptionDescription copied from interface:SapS4OMOutboundServiceGet the order details for an orderID- Specified by:
fetchOrderDetailsin interfaceSapS4OMOutboundService- Parameters:
destinationId- from Consumed DestinationdestinationTargetId- from Consumed DestinationfilterData- 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.ResourceNotFoundExceptionDescription copied from interface:SapS4OMOutboundServiceGets Billing Documents for sap order- Specified by:
fetchBillingDocumentsfromS4in interfaceSapS4OMOutboundService- Parameters:
destinationId- from Consumed DestinationdestinationTargetId- from Consumed DestinationfilterData- 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 SapBillingInvoiceUserExceptionDescription copied from interface:SapS4OMOutboundServiceGets PDF Data for sap order data- Specified by:
fetchPDFDatain interfaceSapS4OMOutboundService- Parameters:
destinationId- from Consumed DestinationdestinationTargetId- from Consumed DestinationfilterData- 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
-
formatErrorResponse
-
createHTTPHeader
protected org.springframework.http.HttpHeaders createHTTPHeader(org.springframework.http.HttpHeaders authenticationResult) -
getCsrfToken
-
getCookies
-
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
-
saveHttpHeaderInSession
protected void saveHttpHeaderInSession(String tokenKey, org.springframework.http.HttpHeaders header) -
getHttpHeaderFromSession
-
setTimeouts
protected void setTimeouts(org.springframework.web.client.RestTemplate restTemplate) -
getConfig
-
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
-
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)
-