java.lang.Object
de.hybris.platform.unifieduibackofficeservices.service.impl.DefaultBucketService
All Implemented Interfaces:
BucketService

public class DefaultBucketService extends Object implements BucketService
This Service integrated with the pros api to call buckets related api's
  • Field Details

  • Constructor Details

    • DefaultBucketService

      public DefaultBucketService()
  • Method Details

    • getBuckets

      public List<Bucket> getBuckets(Map<String,Object> searchFilterMap)
      This method returns the buckets by calling pros service.
      Specified by:
      getBuckets in interface BucketService
      Parameters:
      searchFilterMap - the map of filters to apply to the request
      Returns:
      list of bucket
    • createBucket

      public boolean createBucket(Bucket bucket) throws org.springframework.web.client.HttpServerErrorException, org.springframework.web.client.ResourceAccessException
      This method creates bucket in pros as well as shopping fare product and bundle type in hybris
      Specified by:
      createBucket in interface BucketService
      Parameters:
      bucket - the bucket
      Returns:
      the boolean, return true if bucket is created in pros as well as in hybris else return false
      Throws:
      org.springframework.web.client.HttpServerErrorException - the exception when http response is not 200
      org.springframework.web.client.ResourceAccessException - the resource is not accessible exception
    • getBucket

      public Bucket getBucket(Bucket bucket)
      This method returns the bucket by bucket code and bucket username by calling pros service.
      Specified by:
      getBucket in interface BucketService
      Parameters:
      bucket - the bucket
      Returns:
      the Bucket
    • updateBucket

      public boolean updateBucket(Bucket bucket)
      This method updates bucket in pros
      Specified by:
      updateBucket in interface BucketService
      Parameters:
      bucket - the bucket
      Returns:
      the boolean, return true if response from pros service is 200 else return false
    • createBucketInPros

      protected boolean createBucketInPros(Bucket bucket)
      call pros api to create bucket in pros
      Parameters:
      bucket - the bucket
      Returns:
      the boolean, return true if response from pros service is 200 else return false
    • createShoppingFareProductModel

      protected void createShoppingFareProductModel(Bucket bucket, CatalogVersionModel catalogVersion)
      this method will create ShoppingFareProductModel
      Parameters:
      bucket - the pros bucket
      catalogVersion - the catalog version
    • crateBundleType

      protected void crateBundleType(Bucket bucket)
      this method will create and return BundleType
      Parameters:
      bucket - the bucket
    • removeBucket

      public boolean removeBucket(Bucket bucket)
      Description copied from interface: BucketService
      This method removes the BundleTemplate,BundleSelection Criteria reference from hybris for the given bucket and delete the corresponding bucket from the pros
      Specified by:
      removeBucket in interface BucketService
      Returns:
    • removeFareProductRelatedItemsAndUnApproveFareProduct

      protected void removeFareProductRelatedItemsAndUnApproveFareProduct(Bucket bucket)
      This method removes the bundle templates, selection Criteria, bundle type corresponding to fare product associated with bucket and changes status of fare product to UnApproved
      Parameters:
      bucket -
    • removeBucketFromPros

      protected boolean removeBucketFromPros(Bucket bucket)
      This method removes the bucket from Pros for the given bucket
      Parameters:
      bucket -
    • getProductCatalogId

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

      protected String getCatalogVersion()
      Returns the product catalog version as configured.
      Returns:
      catalog Id
    • getProsEndpoint

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

      protected String getBucketEndpoint()
      This method return the bucket end point as configured.
      Returns:
      the bucket end point
    • 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
    • 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
    • getModelService

      protected de.hybris.platform.servicelayer.model.ModelService getModelService()
      Returns:
      the modelService
    • setModelService

      public void setModelService(de.hybris.platform.servicelayer.model.ModelService modelService)
      Parameters:
      modelService - the modelService to set
    • getEnumerationService

      protected de.hybris.platform.enumeration.EnumerationService getEnumerationService()
      Returns:
      the categoryService
    • setEnumerationService

      public void setEnumerationService(de.hybris.platform.enumeration.EnumerationService enumerationService)
      Parameters:
      enumerationService - the enumerationService to set
    • getCategoryService

      protected de.hybris.platform.category.CategoryService getCategoryService()
      Returns:
      the categoryService
    • setCategoryService

      public void setCategoryService(de.hybris.platform.category.CategoryService categoryService)
      Parameters:
      categoryService - the categoryService 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
    • getProsShoppingFareProductService

      public DefaultPROSShoppingFareProductService getProsShoppingFareProductService()
      Gets the prosShoppingFareProduct service.
      Returns:
      the prosShoppingFareProductService
    • setProsShoppingFareProductService

      public void setProsShoppingFareProductService(DefaultPROSShoppingFareProductService prosShoppingFareProductService)
      Sets prosShoppingFareProduct service.
      Parameters:
      prosShoppingFareProductService - the prosShoppingFareProductService
    • getTypeService

      protected de.hybris.platform.servicelayer.type.TypeService getTypeService()
      Gets type service
      Returns:
      type service
    • setTypeService

      public void setTypeService(de.hybris.platform.servicelayer.type.TypeService typeService)
      Sets the type service
      Parameters:
      typeService - the type service
    • getProsBucketIDGenerator

      protected de.hybris.platform.servicelayer.keygenerator.KeyGenerator getProsBucketIDGenerator()
      Gets the prosBucketIDGenerator
      Returns:
      the prosBucketIDGenerator
    • setProsBucketIDGenerator

      public void setProsBucketIDGenerator(de.hybris.platform.servicelayer.keygenerator.KeyGenerator prosBucketIDGenerator)
      Sets the prosBucketIDGenerator
      Parameters:
      prosBucketIDGenerator -
    • getProsApiUserService

      protected PROSAPIUserService getProsApiUserService()
      Gets the prosApiUserService
      Returns:
      the prosApiUserService
    • setProsApiUserService

      public void setProsApiUserService(PROSAPIUserService prosApiUserService)
      Sets the prosApiUserService
      Parameters:
      prosApiUserService -
    • getProsTravelBundleTemplateService

      protected PROSTravelBundleTemplateService getProsTravelBundleTemplateService()
      Gets pros travel bundle template service.
      Returns:
      the pros travel bundle template service
    • setProsTravelBundleTemplateService

      public void setProsTravelBundleTemplateService(PROSTravelBundleTemplateService prosTravelBundleTemplateService)
      Sets pros travel bundle template service.
      Parameters:
      prosTravelBundleTemplateService - the pros travel bundle template service