Class DefaultDynamicPricingService

java.lang.Object
de.hybris.platform.unifieduibackofficeservices.service.impl.DefaultDynamicPricingService
All Implemented Interfaces:
DynamicPricingService

public class DefaultDynamicPricingService extends Object implements DynamicPricingService
This Service integrated with the pros api to call dynamic pricing related api's
  • Field Details

  • 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:
      getDynamicPricings in interface DynamicPricingService
      Parameters:
      pageNumber - the page Number to handle the pagination
      sortDir - the direction of the sort: ascendent or descendent or null, null for default sorting
      searchFilterMap - 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:
      getDynamicPricing in interface DynamicPricingService
      Parameters:
      dynamicPriceId - the dynamicPriceId
      Returns:
      the ModificationData
      Throws:
      org.springframework.web.client.HttpServerErrorException - the exception when http response is not 200 e.g. status 5xx
      org.springframework.web.client.HttpClientErrorException - the exception when http response is not 200 e.g. status 4xx
      org.springframework.web.client.ResourceAccessException - the resource is not accessible exception
    • removeDynamicPricing

      public void removeDynamicPricing(DynamicPricingRuleData dynamicPricingData)
      This method will remove a dynamic pricing rule from both the system and pros.
      Specified by:
      removeDynamicPricing in interface DynamicPricingService
      Parameters:
      dynamicPricingData - the dynamic price to be removed
      Throws:
      org.springframework.web.client.RestClientException - if removal of dynamic pricing is unsuccessful
    • createDynamicPricingData

      protected DynamicPricingData createDynamicPricingData(DynamicPricingRuleData dynamicPricingData)
      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:
      createDynamicPricing in interface DynamicPricingService
      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 5xx
      org.springframework.web.client.HttpClientErrorException - the exception when http response is not 200 e.g. status 4xx
      org.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:
      updateDynamicPricing in interface DynamicPricingService
      Parameters:
      dynamicPricingData - the dynamicPricingData
      dynamicPriceId - 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 5xx
      org.springframework.web.client.HttpClientErrorException - the exception when http response is not 200 e.g. status 4xx
      org.springframework.web.client.ResourceAccessException - the resource is not accessible exception
    • getProsEndpoint

      protected String getProsEndpoint()
      This method return the pros server end point as configured.
      Returns:
      the pros end point
    • getDynamicPricingEndpoint

      protected String getDynamicPricingEndpoint()
      This method return the dynamic pricing endpoint as configured.
      Returns:
      the condition end point
    • getUpdateDynamicPricingEndpoint

      protected String getUpdateDynamicPricingEndpoint()
      This method return the dynamic pricing endpoint as configured.
      Returns:
      the condition end point
    • getAccountName

      protected String getAccountName()
      this method returns the account name to get call the pros service as configured
      Returns:
      the account name
    • populateBasicDynamicPricingInfo

      protected void populateBasicDynamicPricingInfo(DynamicPricingData dynamicPricingData)
      This method will populate basic information required for dynamic pricing
      Parameters:
      dynamicPricingData - the dynamic pricing data
    • getAuthUserName

      protected String getAuthUserName()
      This method returns the authUserName as configured
      Returns:
      authUserName
    • getAuthPassword

      protected String getAuthPassword()
      This method returns the authPassword as Configured
      Returns:
      authPassword
    • getUserName

      protected String 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