Class DefaultConditionService
java.lang.Object
de.hybris.platform.unifieduibackofficeservices.service.impl.DefaultConditionService
- All Implemented Interfaces:
ConditionService
This Service integrated with the pros api to call services related api's
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateAndFetchCondition(ConditionData conditionData) This method will create a new condition and return the updated condition databooleancreateCondition(ConditionData conditionData) This method will create condition in prosprotected Stringthis method returns the account name to get call the pros service as configuredprotected org.springframework.web.client.RestTemplategetCondition(String conditionId) This method returns the condition by calling pros service.protected StringThis method return the condition end point as configured.This method returns the list of available conditions in pros.protected de.hybris.platform.servicelayer.config.ConfigurationServiceprotected StringThis method return the pros server end point as configured.protected org.springframework.http.ResponseEntity<ConditionData>invokeCreateCondition(ConditionData conditionData) booleanremoveCondition(ConditionData condition) This method will remove the condition from both the system and pros.voidsetBackofficeRestTemplate(org.springframework.web.client.RestTemplate backofficeRestTemplate) voidsetConfigurationService(de.hybris.platform.servicelayer.config.ConfigurationService configurationService) booleanupdateCondition(ConditionData conditionData, String conditionId) This method will update condition in pros
-
Field Details
-
GET_CONDITION_ENDPOINT
- See Also:
-
-
Constructor Details
-
DefaultConditionService
public DefaultConditionService()
-
-
Method Details
-
getCondition
public ConditionData getCondition(String conditionId) throws org.springframework.web.client.HttpServerErrorException, org.springframework.web.client.HttpClientErrorException, org.springframework.web.client.ResourceAccessException This method returns the condition by calling pros service.- Specified by:
getConditionin interfaceConditionService- Parameters:
conditionId- the conditionId- Returns:
- the ConditionData
- Throws:
org.springframework.web.client.HttpServerErrorException- the exception when http response is not 200 e.g. status 5xxorg.springframework.web.client.HttpClientErrorException- the exception when http response is not 200 e.g. status 4xxorg.springframework.web.client.ResourceAccessException- the resource is not accessible exception
-
getConditions
public ConditionsResponseData getConditions(Integer pageNumber, String sortDir, Map<String, Object> searchFilterMap) This method returns the list of available conditions in pros.- Specified by:
getConditionsin interfaceConditionService- Parameters:
pageNumber- the page Number to handle the paginationsortDir- the direction of the sort: ascendent or descendentsearchFilterMap- the search filter attribute map- Returns:
- the
ConditionsResponseData
-
removeCondition
This method will remove the condition from both the system and pros.- Specified by:
removeConditionin interfaceConditionService- Parameters:
condition- the condition to be removed- Returns:
- true if the removal is successful
-
createCondition
public boolean createCondition(ConditionData conditionData) throws org.springframework.web.client.HttpServerErrorException, org.springframework.web.client.HttpClientErrorException, org.springframework.web.client.ResourceAccessException This method will create condition in pros- Specified by:
createConditionin interfaceConditionService- Parameters:
conditionData- the conditionData- Returns:
- the boolean, return true if condition is created in pros else return false
- Throws:
org.springframework.web.client.HttpServerErrorException- the exception when http response is not 200 e.g. status 5xxorg.springframework.web.client.HttpClientErrorException- the exception when http response is not 200 e.g. status 4xxorg.springframework.web.client.ResourceAccessException- the resource is not accessible exception
-
updateCondition
public boolean updateCondition(ConditionData conditionData, String conditionId) throws org.springframework.web.client.HttpServerErrorException, org.springframework.web.client.HttpClientErrorException, org.springframework.web.client.ResourceAccessException This method will update condition in pros- Specified by:
updateConditionin interfaceConditionService- Parameters:
conditionData- the conditionDataconditionId- the condition id- Returns:
- the boolean, return true if condition is updated in pros else return false
- Throws:
org.springframework.web.client.HttpServerErrorException- the exception when http response is not 200 e.g. status 5xxorg.springframework.web.client.HttpClientErrorException- the exception when http response is not 200 e.g. status 4xxorg.springframework.web.client.ResourceAccessException- the resource is not accessible exception
-
createAndFetchCondition
public ConditionData createAndFetchCondition(ConditionData conditionData) throws org.springframework.web.client.HttpServerErrorException, org.springframework.web.client.HttpClientErrorException, org.springframework.web.client.ResourceAccessException Description copied from interface:ConditionServiceThis method will create a new condition and return the updated condition data- Specified by:
createAndFetchConditionin interfaceConditionService- Parameters:
conditionData- create condition data input body- Returns:
- create condition data response body
- Throws:
org.springframework.web.client.HttpServerErrorExceptionorg.springframework.web.client.HttpClientErrorExceptionorg.springframework.web.client.ResourceAccessException
-
invokeCreateCondition
protected org.springframework.http.ResponseEntity<ConditionData> invokeCreateCondition(ConditionData conditionData) -
getProsEndpoint
This method return the pros server end point as configured.- Returns:
- the pros end point
-
getConditionEndpoint
This method return the condition end point as configured.- Returns:
- the condition end point
-
getAccountName
this method returns the account name to get call the pros service as configured- Returns:
- the account name
-
getConfigurationService
protected de.hybris.platform.servicelayer.config.ConfigurationService getConfigurationService()- Returns:
- the configurationService
-
setConfigurationService
public void setConfigurationService(de.hybris.platform.servicelayer.config.ConfigurationService configurationService) - Parameters:
configurationService- the configurationService to set
-
getBackofficeRestTemplate
protected org.springframework.web.client.RestTemplate getBackofficeRestTemplate()- Returns:
- the backofficeRestTemplate
-
setBackofficeRestTemplate
public void setBackofficeRestTemplate(org.springframework.web.client.RestTemplate backofficeRestTemplate) - Parameters:
backofficeRestTemplate- the backofficeRestTemplate to set
-