Class SessionAccessServiceImpl

java.lang.Object
de.hybris.platform.sap.productconfig.services.impl.SessionAccessServiceImpl
All Implemented Interfaces:
SessionAccessService

public class SessionAccessServiceImpl extends Object implements SessionAccessService
Default implementation of SessionAccessService
  • Constructor Details

    • SessionAccessServiceImpl

      public SessionAccessServiceImpl()
  • Method Details

    • setConfigIdForCartEntry

      public void setConfigIdForCartEntry(String cartEntryKey, String configId)
      Description copied from interface: SessionAccessService
      Stores configuration ID for a cart entry key into the session
      Specified by:
      setConfigIdForCartEntry in interface SessionAccessService
      Parameters:
      cartEntryKey - String representation of the cart entry primary key
      configId - ID of a runtime configuration object
    • getConfigIdForCartEntry

      public String getConfigIdForCartEntry(String cartEntryKey)
      Description copied from interface: SessionAccessService
      Retrieves config identifier from the session for a given cart entry key
      Specified by:
      getConfigIdForCartEntry in interface SessionAccessService
      Parameters:
      cartEntryKey - String representation of the cart entry primary key
      Returns:
      ID of a runtime configuration object
    • getDraftConfigIdForCartEntry

      public String getDraftConfigIdForCartEntry(String cartEntryKey)
      Description copied from interface: SessionAccessService
      gets the config id linked as draft to the given cart entry
      Specified by:
      getDraftConfigIdForCartEntry in interface SessionAccessService
      Parameters:
      cartEntryKey - cart entry key
      Returns:
      config Id
    • getUiStatusForCartEntry

      public <T> T getUiStatusForCartEntry(String cartEntryKey)
      Description copied from interface: SessionAccessService
      Retrieves object from the session for a given cart entry key
      Specified by:
      getUiStatusForCartEntry in interface SessionAccessService
      Parameters:
      cartEntryKey - String representation of the cart entry primary key
      Returns:
      ui status for cart entry
    • getUiStatusFromSession

      protected <T> T getUiStatusFromSession(String key, boolean forCart, String traceMessage)
      Retrieves UiStatus from session
      Parameters:
      key - Key of object in map
      forCart - true for UI Statuses for cart entries, false for catalog products
      traceMessage - Post fix of the trace message which identifies the type of key
      Returns:
      UiStatus
    • setUiStatusForCartEntry

      public void setUiStatusForCartEntry(String cartEntryKey, Object uiStatus)
      Description copied from interface: SessionAccessService
      Stores object for a cart entry key into the session
      Specified by:
      setUiStatusForCartEntry in interface SessionAccessService
      Parameters:
      cartEntryKey - String representation of the cart entry primary key
      uiStatus - ui status for cart entry
    • getUiStatusForProduct

      public Object getUiStatusForProduct(String productKey)
      Description copied from interface: SessionAccessService
      Retrieves object from the session for a given cart entry key
      Specified by:
      getUiStatusForProduct in interface SessionAccessService
      Parameters:
      productKey - Product key
      Returns:
      ui status for product
    • setUiStatusForProduct

      public void setUiStatusForProduct(String productKey, Object uiStatus)
      Description copied from interface: SessionAccessService
      Stores object for a product key into the session
      Specified by:
      setUiStatusForProduct in interface SessionAccessService
      Parameters:
      productKey - Product key
      uiStatus - ui status for product
    • setUiStatusIntoSession

      protected void setUiStatusIntoSession(String key, Object uiStatus, boolean forCart, String traceMessage)
      Puts UiStatus object into session
      Parameters:
      key - Key for object
      uiStatus - The object we want to store in session
      forCart - true for UI Statuses for cart entries, false for catalog products
      traceMessage - Post fix of the trace message which identifies the type of key
    • removeUiStatusForCartEntry

      public void removeUiStatusForCartEntry(String cartEntryKey)
      Description copied from interface: SessionAccessService
      Removes object for a cart entry
      Specified by:
      removeUiStatusForCartEntry in interface SessionAccessService
      Parameters:
      cartEntryKey - String representation of the cart entry primary key
    • removeUiStatusFromSession

      protected void removeUiStatusFromSession(String key, boolean forCart, String traceMessage)
      Removes UiStatus object from session
      Parameters:
      key - Key for object
      forCart - true for UI Statuses for cart entries, false for catalog products
      traceMessage - Post fix of the trace message which identifies the type of key
    • removeUiStatusForProduct

      public void removeUiStatusForProduct(String productKey)
      Description copied from interface: SessionAccessService
      Removes object for a product
      Specified by:
      removeUiStatusForProduct in interface SessionAccessService
      Parameters:
      productKey - Product key
    • getCartEntryForConfigId

      public String getCartEntryForConfigId(String configId)
      Description copied from interface: SessionAccessService
      Retrieves cart entry key belonging to a specific config ID
      Specified by:
      getCartEntryForConfigId in interface SessionAccessService
      Parameters:
      configId - id of the configuration
      Returns:
      String representation of the cart entry primary key
    • getCartEntryForDraftConfigId

      public String getCartEntryForDraftConfigId(String configId)
      Description copied from interface: SessionAccessService
      get cart entry linked to the given draft configuration
      Specified by:
      getCartEntryForDraftConfigId in interface SessionAccessService
      Parameters:
      configId - runtime configuration id
      Returns:
      cartItemHandle
    • findConfigIdInMap

      protected List<String> findConfigIdInMap(String configId, Map<String,String> sessionCartEntryConfigurations)
    • removeSessionArtifactsForCartEntry

      public void removeSessionArtifactsForCartEntry(String cartEntryId)
      Description copied from interface: SessionAccessService
      Removes all session artifacts belonging to a cart entry
      Specified by:
      removeSessionArtifactsForCartEntry in interface SessionAccessService
      Parameters:
      cartEntryId - cart entry key
    • removeProductRelatedSessionArtifacts

      protected void removeProductRelatedSessionArtifacts(String configId)
    • removeConfigIdForCartEntry

      public void removeConfigIdForCartEntry(String cartEntryKey)
      Description copied from interface: SessionAccessService
      Removes config ID for cart entry
      Specified by:
      removeConfigIdForCartEntry in interface SessionAccessService
      Parameters:
      cartEntryKey - cart entry key
    • getCartEntryConfigCache

      protected Map<String,String> getCartEntryConfigCache()
      Returns:
      Map: Configuration ID's for cart entry
    • getCartEntryDraftConfigCache

      protected Map<String,String> getCartEntryDraftConfigCache()
    • retrieveSessionAttributeContainer

      protected ProductConfigSessionAttributeContainer retrieveSessionAttributeContainer()
    • retrieveSessionAttributeContainer

      protected ProductConfigSessionAttributeContainer retrieveSessionAttributeContainer(boolean createLazy)
    • purge

      public void purge()
      Description copied from interface: SessionAccessService
      Purges the entire session (with regards to CPQ artifacts)
      Specified by:
      purge in interface SessionAccessService
    • setSessionService

      public void setSessionService(SessionService sessionService)
      Parameters:
      sessionService - the sessionService to set
    • getSessionService

      protected SessionService getSessionService()
    • getConfigIdForProduct

      public String getConfigIdForProduct(String productCode)
      Description copied from interface: SessionAccessService
      Get the runtime configuration currently associated with the given product
      Specified by:
      getConfigIdForProduct in interface SessionAccessService
      Parameters:
      productCode - code of product, for which the link to the runtime configuration should be returned
      Returns:
      runtime configuration id that is currently linked to the given product
    • setConfigIdForProduct

      public void setConfigIdForProduct(String productCode, String configId)
      Description copied from interface: SessionAccessService
      Links a product code with a given runtime configuration
      Specified by:
      setConfigIdForProduct in interface SessionAccessService
      Parameters:
      productCode - code of product, for which the link to the runtime configuration should be created
      configId - runtime configuration id
    • removeConfigIdForProduct

      public void removeConfigIdForProduct(String pCode)
      Description copied from interface: SessionAccessService
      Removes the link between product code and runtime configuration
      Specified by:
      removeConfigIdForProduct in interface SessionAccessService
      Parameters:
      pCode - code of product, for which the link to the runtime configuration should be deleted
    • setDraftConfigIdForCartEntry

      public void setDraftConfigIdForCartEntry(String cartEntryKey, String configId)
      Description copied from interface: SessionAccessService
      Stores darfat configuration ID for a cart entry key into the session
      Specified by:
      setDraftConfigIdForCartEntry in interface SessionAccessService
      Parameters:
      cartEntryKey - String representation of the cart entry primary key
      configId - ID of a runtime configuration object
    • removeDraftConfigIdForCartEntry

      public void removeDraftConfigIdForCartEntry(String cartEntryKey)
      Description copied from interface: SessionAccessService
      Removes draft config ID for cart entry
      Specified by:
      removeDraftConfigIdForCartEntry in interface SessionAccessService
      Parameters:
      cartEntryKey - cart entry key
    • getProductForConfigId

      public String getProductForConfigId(String configId)
      Description copied from interface: SessionAccessService
      Get the product for the given runtime configuration id
      Specified by:
      getProductForConfigId in interface SessionAccessService
      Parameters:
      configId - configuration id
      Returns:
      product code if link is present, otherwise null