Class DefaultAncillaryProductService

java.lang.Object
de.hybris.platform.unifieduibackofficeservices.service.impl.DefaultAncillaryProductService
All Implemented Interfaces:
AncillaryProductService

public class DefaultAncillaryProductService extends Object implements AncillaryProductService
This Service integrated with the pros api to call services related api's
  • Field Details

  • Constructor Details

    • DefaultAncillaryProductService

      public DefaultAncillaryProductService()
  • Method Details

    • getATPCOServices

      public ServiceData getATPCOServices(String carrierCode, Integer pageNumber, Integer pageSize)
      Description copied from interface: AncillaryProductService
      This method returns the ATPCO services from the Merchandising Data service.
      Specified by:
      getATPCOServices in interface AncillaryProductService
      Parameters:
      carrierCode - the carrier to filter the request basing on them
      pageNumber - the number of page to send for the pagination configuration
      pageSize - the number of the entries in a single page
      Returns:
      the list of ATPCO services
    • getAncillaryProducts

      public ServiceData getAncillaryProducts(int pageNumber, Map<String,Object> searchFilterMap)
      This method returns the Ancillary Products by calling pros service.
      Specified by:
      getAncillaryProducts in interface AncillaryProductService
      Parameters:
      pageNumber - the page number
      searchFilterMap - the map of filters to apply to the request
      Returns:
      the list of Ancillary Products
    • getNonATPCOAncillaryProducts

      public ServiceData getNonATPCOAncillaryProducts(int pageNumber)
      This method returns the NonATPCO Ancillary Products by calling pros service.
      Specified by:
      getNonATPCOAncillaryProducts in interface AncillaryProductService
      Parameters:
      pageNumber - the page number
      Returns:
      the list of Ancillary Products
    • getAncillaryProduct

      public AncillaryProduct getAncillaryProduct(String serviceId)
      This method returns the Ancillary Product by calling pros service.
      Specified by:
      getAncillaryProduct in interface AncillaryProductService
      Parameters:
      serviceId - the serviceId
      Returns:
      the list of Ancillary Products
    • createAncillaryProducts

      public boolean createAncillaryProducts(AncillaryProduct ancillaryProduct) throws org.springframework.web.client.HttpServerErrorException, org.springframework.web.client.HttpClientErrorException, org.springframework.web.client.ResourceAccessException
      This method will create ancillary product in pros
      Specified by:
      createAncillaryProducts in interface AncillaryProductService
      Parameters:
      ancillaryProduct - the ancillaryProduct
      Returns:
      the boolean, return true if ancillary product is created in pros else return false
      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
    • createAncillaryInPros

      protected boolean createAncillaryInPros(AncillaryProduct ancillaryProduct)
      This method will call pros service to create ancillary product
      Parameters:
      ancillaryProduct - the ancillaryProduct
      Returns:
      the boolean, return true if ancillary product is created in pros else return false
    • updateAncillaryProduct

      public boolean updateAncillaryProduct(AncillaryProduct ancillaryProduct, String serviceId) throws org.springframework.web.client.HttpServerErrorException, org.springframework.web.client.HttpClientErrorException, org.springframework.web.client.ResourceAccessException
      This method will update ancillary product in pros
      Specified by:
      updateAncillaryProduct in interface AncillaryProductService
      Parameters:
      ancillaryProduct - the ancillaryProduct
      serviceId - the serviceId
      Returns:
      the boolean, return true if ancillary product is updated in pros else return false
      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
    • updateAncillaryProductInPros

      protected boolean updateAncillaryProductInPros(AncillaryProduct ancillaryProduct, String serviceId)
      This method will update ancillary product in pros
      Parameters:
      ancillaryProduct - the ancillaryProduct
      serviceId - the serviceId
      Returns:
      the boolean, return true if ancillary product is updated in pros else return false
    • removeAncillaryProduct

      public boolean removeAncillaryProduct(AncillaryProduct ancillaryProduct)
      This method removes the ancillary product from the pros and will change sap ancillary product status from approved to unapproved
      Specified by:
      removeAncillaryProduct in interface AncillaryProductService
      Parameters:
      ancillaryProduct - the ancillaryProduct
      Returns:
      the boolean, return true if ancillary product is removed in pros else return false
    • removeAncillaryProductInPros

      protected boolean removeAncillaryProductInPros(AncillaryProduct ancillaryProduct)
      This method removes ancillary product from the pros
      Parameters:
      ancillaryProduct - the ancillaryProduct
      Returns:
      the boolean, return true if ancillary product is removed in pros else return false
    • getServiceKeys

      public List<ServiceKey> getServiceKeys(String serviceType, List<String> carriers)
      This method returns the service keys by calling pros service.
      Specified by:
      getServiceKeys in interface AncillaryProductService
      Parameters:
      serviceType - the service type
      carriers - the carriers
      Returns:
      the list of ServiceKey
    • getServiceKeysFromPros

      protected List<ServiceKey> getServiceKeysFromPros(String serviceType, String carrier)
      This method will call service
      Parameters:
      serviceType -
      carrier -
      Returns:
    • getServiceKeys

      public List<String> getServiceKeys(Category category)
      This method returns the sub codes for a given category.
      Specified by:
      getServiceKeys in interface AncillaryProductService
      Parameters:
      category - The category for the sub codes
      Returns:
      list of service sub codes
    • getProductCatalogId

      protected String getProductCatalogId()
      Returns the product catalog id as configured.
      Returns:
      catalog Id
    • getProsEndpoint

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

      protected String getServiceEndpoint()
      This method return the service end point as configured.
      Returns:
      the service end point
    • getBasketServiceEndpoint

      protected String getBasketServiceEndpoint()
      This method return the basket service end point as configured.
      Returns:
      the basket service end point
    • getServiceSubCodesEndpoint

      protected String getServiceSubCodesEndpoint()
    • getAccountName

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

      protected Map<String,UnifiedUICreateUpdateRemoveServiceStrategy> getUnifiedUINonATPCOServicesStrategyMap()
      Gets unified ui non atpco services strategy map.
      Returns:
      the unified ui non atpco services strategy map
    • setUnifiedUINonATPCOServicesStrategyMap

      public void setUnifiedUINonATPCOServicesStrategyMap(Map<String,UnifiedUICreateUpdateRemoveServiceStrategy> unifiedUINonATPCOServicesStrategyMap)
      Sets unified ui non atpco services strategy map.
      Parameters:
      unifiedUINonATPCOServicesStrategyMap - the unified ui non atpco services strategy map
    • getCatalogVersionService

      protected de.hybris.platform.catalog.CatalogVersionService getCatalogVersionService()
      Returns:
      the catalogVersionService
    • setCatalogVersionService

      public void setCatalogVersionService(de.hybris.platform.catalog.CatalogVersionService catalogVersionService)
      Parameters:
      catalogVersionService - the catalogVersionService to set