Class DefaultRestService
java.lang.Object
com.sap.sapoaacarintegration.services.rest.impl.DefaultRestService
- All Implemented Interfaces:
OaaRestService
- Direct Known Subclasses:
AuthenticationService,DefaultReservationService
Base Class for OAA REST Service classes.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidWill be called before the REST call is madevoidcheckHttpStatusCode(org.springframework.web.client.HttpClientErrorException httpClientErrorException) Checks HTTP Status Codes for back end downde.hybris.platform.outboundservices.client.OutboundHttpClientFactoryGet the REST service configurationorg.springframework.web.client.RestTemplateGet the REST templatede.hybris.platform.servicelayer.session.SessionServiceGet the Session servicevoidInitialize rest service configurationvoidsetBackendDown(boolean backendDown) Set the Attribute for BackendDown in the SessionvoidsetOutboundHttpClientFactory(de.hybris.platform.outboundservices.client.OutboundHttpClientFactory outboundHttpClientFactory) voidsetRestServiceConfiguration(RestServiceConfiguration restServiceConfiguration) Set the REST service configurationvoidsetRestTemplate(org.springframework.web.client.RestTemplate restTemplate) Set the REST templatevoidsetSessionService(de.hybris.platform.servicelayer.session.SessionService sessionService) Set the Session service
-
Constructor Details
-
DefaultRestService
public DefaultRestService()
-
-
Method Details
-
beforeRestCall
public void beforeRestCall()Will be called before the REST call is made -
initialize
public void initialize()Initialize rest service configuration -
checkHttpStatusCode
public void checkHttpStatusCode(org.springframework.web.client.HttpClientErrorException httpClientErrorException) Checks HTTP Status Codes for back end down- Parameters:
httpClientErrorException- to understand the type of exception occurred- Throws:
BackendDownException- when status code for back end down is given
-
setRestServiceConfiguration
Set the REST service configuration- Specified by:
setRestServiceConfigurationin interfaceOaaRestService- Parameters:
restServiceConfiguration- the restServiceConfiguration to set
-
setBackendDown
public void setBackendDown(boolean backendDown) Set the Attribute for BackendDown in the Session- Specified by:
setBackendDownin interfaceOaaRestService- Parameters:
backendDown- the value to set in the session
-
setRestTemplate
public void setRestTemplate(org.springframework.web.client.RestTemplate restTemplate) Set the REST template- Parameters:
restTemplate- the restTemplate to set
-
setSessionService
public void setSessionService(de.hybris.platform.servicelayer.session.SessionService sessionService) Set the Session service- Parameters:
sessionService-
-
getRestTemplate
public org.springframework.web.client.RestTemplate getRestTemplate()Get the REST template- Returns:
- restTemplate
-
getRestServiceConfiguration
Get the REST service configuration- Returns:
- restServiceConfiguration
-
getSessionService
public de.hybris.platform.servicelayer.session.SessionService getSessionService()Get the Session service- Returns:
- the sessionService
-
getOutboundHttpClientFactory
public de.hybris.platform.outboundservices.client.OutboundHttpClientFactory getOutboundHttpClientFactory()- Returns:
- the outboundHttpClientFactory
-
setOutboundHttpClientFactory
public void setOutboundHttpClientFactory(de.hybris.platform.outboundservices.client.OutboundHttpClientFactory outboundHttpClientFactory) - Parameters:
outboundHttpClientFactory- the outboundHttpClientFactory to set
-