Class DefaultDynamicPricingService
java.lang.Object
de.hybris.platform.unifieduibackofficeservices.service.impl.DefaultDynamicPricingService
- All Implemented Interfaces:
DynamicPricingService
This Service integrated with the pros api to call dynamic pricing related api's
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateDynamicPricing(DynamicPricingData dynamicPricingData) This method will create a dynamic pricing rule in prosprotected DynamicPricingDatacreateDynamicPricingData(DynamicPricingRuleData dynamicPricingData) Creates the dynamic pricing dataprotected Stringthis method returns the account name to get call the pros service as configuredprotected StringThis method returns the authPassword as Configuredprotected StringThis method returns the authUserName as configuredprotected org.springframework.web.client.RestTemplateprotected de.hybris.platform.servicelayer.config.ConfigurationServicegetDynamicPricing(String dynamicPriceId) This method returns the dynamic pricing by dynamic price Id and calling pros service.protected StringThis method return the dynamic pricing endpoint as configured.This method returns the list of available dynamic pricing in pros.protected StringThis method return the pros server end point as configured.protected StringThis method return the dynamic pricing endpoint as configured.protected Stringthis method returns the user name to get call the pros service as configuredprotected voidpopulateBasicDynamicPricingInfo(DynamicPricingData dynamicPricingData) This method will populate basic information required for dynamic pricingvoidremoveDynamicPricing(DynamicPricingRuleData dynamicPricingData) This method will remove a dynamic pricing rule from both the system and pros.voidsetBackofficeRestTemplate(org.springframework.web.client.RestTemplate backofficeRestTemplate) voidsetConfigurationService(de.hybris.platform.servicelayer.config.ConfigurationService configurationService) updateDynamicPricing(DynamicPricingData dynamicPricingData, String dynamicPriceId) This method will update a dynamic pricing rule in pros
-
Field Details
-
GET_DYNAMIC_PRICING_ENDPOINT
- See Also:
-
PUT_DYNAMIC_PRICING_ENDPOINT
- See Also:
-
CONTEXT_DYNAMIC_PRICING
- See Also:
-
-
Constructor Details
-
DefaultDynamicPricingService
public DefaultDynamicPricingService()
-
-
Method Details
-
getDynamicPricings
public DynamicPricingData getDynamicPricings(Integer pageNumber, String sortDir, Map<String, Object> searchFilterMap) This method returns the list of available dynamic pricing in pros.- Specified by:
getDynamicPricingsin interfaceDynamicPricingService- Parameters:
pageNumber- the page Number to handle the paginationsortDir- the direction of the sort: ascendent or descendent or null, null for default sortingsearchFilterMap- the search filter attribute map- Returns:
- the
DynamicPricingData
-
getDynamicPricing
public DynamicPricingRuleData getDynamicPricing(String dynamicPriceId) throws org.springframework.web.client.HttpServerErrorException, org.springframework.web.client.HttpClientErrorException, org.springframework.web.client.ResourceAccessException This method returns the dynamic pricing by dynamic price Id and calling pros service.- Specified by:
getDynamicPricingin interfaceDynamicPricingService- Parameters:
dynamicPriceId- the dynamicPriceId- Returns:
- the ModificationData
- 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
-
removeDynamicPricing
This method will remove a dynamic pricing rule from both the system and pros.- Specified by:
removeDynamicPricingin interfaceDynamicPricingService- Parameters:
dynamicPricingData- the dynamic price to be removed- Throws:
org.springframework.web.client.RestClientException- if removal of dynamic pricing is unsuccessful
-
createDynamicPricingData
Creates the dynamic pricing data- Parameters:
dynamicPricingData- the dynamic pricing data- Returns:
- the dynamic pricing data
-
createDynamicPricing
public DynamicPricingData createDynamicPricing(DynamicPricingData dynamicPricingData) throws org.springframework.web.client.HttpServerErrorException, org.springframework.web.client.HttpClientErrorException, org.springframework.web.client.ResourceAccessException This method will create a dynamic pricing rule in pros- Specified by:
createDynamicPricingin interfaceDynamicPricingService- Parameters:
dynamicPricingData- the dynamic pricing data- Returns:
- the dynamic pricing data if http status response is 200 else return null
- 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
-
updateDynamicPricing
public DynamicPricingData updateDynamicPricing(DynamicPricingData dynamicPricingData, String dynamicPriceId) throws org.springframework.web.client.HttpServerErrorException, org.springframework.web.client.HttpClientErrorException, org.springframework.web.client.ResourceAccessException This method will update a dynamic pricing rule in pros- Specified by:
updateDynamicPricingin interfaceDynamicPricingService- Parameters:
dynamicPricingData- the dynamicPricingDatadynamicPriceId- the dynamic price id- Returns:
- the dynamic pricing data if http status response is 200 else return null
- 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
-
getProsEndpoint
This method return the pros server end point as configured.- Returns:
- the pros end point
-
getDynamicPricingEndpoint
This method return the dynamic pricing endpoint as configured.- Returns:
- the condition end point
-
getUpdateDynamicPricingEndpoint
This method return the dynamic pricing endpoint 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
-
populateBasicDynamicPricingInfo
This method will populate basic information required for dynamic pricing- Parameters:
dynamicPricingData- the dynamic pricing data
-
getAuthUserName
This method returns the authUserName as configured- Returns:
- authUserName
-
getAuthPassword
This method returns the authPassword as Configured- Returns:
- authPassword
-
getUserName
this method returns the user name to get call the pros service as configured- Returns:
- the user 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
-