Class SessionAccessServiceImpl

    • Constructor Detail

      • SessionAccessServiceImpl

        public SessionAccessServiceImpl()
    • Method Detail

      • setSessionService

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

        @Deprecated(since="1811",
                    forRemoval=true)
        public java.lang.String getSessionId()
        Deprecated, for removal: This API element is subject to removal in a future version.
        since 18.11.0 - call {@link SessionService#getCurrentSession()#getSessionId()}
        Description copied from interface: SessionAccessService
        returns the unique session id
        Specified by:
        getSessionId in interface SessionAccessService
        Returns:
        session id
      • setConfigIdForCartEntry

        public void setConfigIdForCartEntry​(java.lang.String cartEntryKey,
                                            java.lang.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 java.lang.String getConfigIdForCartEntry​(java.lang.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 java.lang.String getDraftConfigIdForCartEntry​(java.lang.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​(java.lang.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​(java.lang.String key,
                                               boolean forCart,
                                               java.lang.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​(java.lang.String cartEntryKey,
                                            java.lang.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 java.lang.Object getUiStatusForProduct​(java.lang.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​(java.lang.String productKey,
                                          java.lang.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​(java.lang.String key,
                                              java.lang.Object uiStatus,
                                              boolean forCart,
                                              java.lang.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​(java.lang.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​(java.lang.String key,
                                                 boolean forCart,
                                                 java.lang.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
      • getCartEntryForConfigId

        public java.lang.String getCartEntryForConfigId​(java.lang.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 java.lang.String getCartEntryForDraftConfigId​(java.lang.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 java.util.List<java.lang.String> findConfigIdInMap​(java.lang.String configId,
                                                                     java.util.Map<java.lang.String,​java.lang.String> sessionCartEntryConfigurations)
      • removeProductRelatedSessionArtifacts

        protected void removeProductRelatedSessionArtifacts​(java.lang.String configId)
      • getCartEntryConfigCache

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

        protected java.util.Map<java.lang.String,​java.lang.String> getCartEntryDraftConfigCache()
      • getCachedNameMap

        @Deprecated(since="1811",
                    forRemoval=true)
        public java.util.Map<java.lang.String,​ClassificationSystemCPQAttributesContainer> getCachedNameMap()
        Deprecated, for removal: This API element is subject to removal in a future version.
        call ProductConfigurationCacheAccessService#getCachedNameMap() instead
        Specified by:
        getCachedNameMap in interface SessionAccessService
        Returns:
        Map of names from the hybris classification system
        Since:
        18.11.0
      • getSolrIndexedProperties

        @Deprecated(since="1811",
                    forRemoval=true)
        public java.util.Set<java.lang.String> getSolrIndexedProperties()
        Deprecated, for removal: This API element is subject to removal in a future version.
        since 18.11.0 - no longer used
        Specified by:
        getSolrIndexedProperties in interface SessionAccessService
        Returns:
        Set of indexed properties
      • setSolrIndexedProperties

        @Deprecated(since="1811",
                    forRemoval=true)
        public void setSolrIndexedProperties​(java.util.Set<java.lang.String> solrTypes)
        Deprecated, for removal: This API element is subject to removal in a future version.
        since 18.11.0 - no longer used
        Description copied from interface: SessionAccessService
        Stores set of indexed properties
        Specified by:
        setSolrIndexedProperties in interface SessionAccessService
        Parameters:
        solrTypes - solr types to be stored
      • getConfigurationProvider

        @Deprecated(since="1811",
                    forRemoval=true)
        public ConfigurationProvider getConfigurationProvider()
        Deprecated, for removal: This API element is subject to removal in a future version.
        * @deprecated since 18.11.0 - caching decision is moved to ProviderFactory
        Specified by:
        getConfigurationProvider in interface SessionAccessService
        Returns:
        Configuration provider
      • setConfigurationProvider

        @Deprecated(since="1811",
                    forRemoval=true)
        public void setConfigurationProvider​(ConfigurationProvider provider)
        Deprecated, for removal: This API element is subject to removal in a future version.
        * @deprecated since 18.11.0 - caching decision is moved to ProviderFactory
        Specified by:
        setConfigurationProvider in interface SessionAccessService
        Parameters:
        provider - provider to cache
      • removeConfigAttributeStates

        @Deprecated(since="1811",
                    forRemoval=true)
        public void removeConfigAttributeStates()
        Deprecated, for removal: This API element is subject to removal in a future version.
        since 18.11.0 - this method is obsolete because the key under which the configuration engine state and price summary states have been saved consists of configuration id an user session id
        Description copied from interface: SessionAccessService
        Clears the read cache for the configuration engine state and price summary states for the whole user session
        Specified by:
        removeConfigAttributeStates in interface SessionAccessService
      • setPricingProvider

        @Deprecated(since="1811",
                    forRemoval=true)
        public void setPricingProvider​(PricingProvider provider)
        Deprecated, for removal: This API element is subject to removal in a future version.
        * @deprecated since 18.11.0 - caching decision is moved to ProviderFactory
        Specified by:
        setPricingProvider in interface SessionAccessService
        Parameters:
        provider - provider to cache
      • getPricingProvider

        @Deprecated(since="1811",
                    forRemoval=true)
        public PricingProvider getPricingProvider()
        Deprecated, for removal: This API element is subject to removal in a future version.
        * @deprecated since 18.11.0 - caching decision is moved to ProviderFactory
        Specified by:
        getPricingProvider in interface SessionAccessService
        Returns:
        Configuration provider
      • setAnalyticsProvider

        @Deprecated(since="1811",
                    forRemoval=true)
        public void setAnalyticsProvider​(AnalyticsProvider analyticsProvider)
        Deprecated, for removal: This API element is subject to removal in a future version.
        * @deprecated since 18.11.0 - caching decision is moved to ProviderFactory
        Specified by:
        setAnalyticsProvider in interface SessionAccessService
      • getAnalyticsProvider

        @Deprecated(since="1811",
                    forRemoval=true)
        public AnalyticsProvider getAnalyticsProvider()
        Deprecated, for removal: This API element is subject to removal in a future version.
        * @deprecated since 18.11.0 - caching decision is moved to ProviderFactory
        Specified by:
        getAnalyticsProvider in interface SessionAccessService
        Returns:
        return the cached analytics provider
      • getMaxCachedConfigsInSession

        protected int getMaxCachedConfigsInSession()
      • setMaxCachedConfigsInSession

        public void setMaxCachedConfigsInSession​(int maxCachedConfigsInSession)
        Re-reading a configuration from the configuration engine can be expensive, especially for large configurations. This is only necessary when the configuration was updated since the last time being read. To make life for callers easier, this implementation features a simple read-cache for configurations based on the user session. So any calls to read configuration will always result in a cache hit until the configuration is updated.
        Parameters:
        maxCachedConfigsInSession - set the maximum number of configs to be cached in the session. Default is 10.
      • ensureThatNotToManyConfigsAreCachedInSession

        protected void ensureThatNotToManyConfigsAreCachedInSession()
      • removeConfigAttributesFromSessionCache

        protected void removeConfigAttributesFromSessionCache​(java.lang.String configId)
      • getConfigIdForProduct

        public java.lang.String getConfigIdForProduct​(java.lang.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​(java.lang.String productCode,
                                          java.lang.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​(java.lang.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
      • setCartEntryForProduct

        @Deprecated(since="1808",
                    forRemoval=true)
        public void setCartEntryForProduct​(java.lang.String productKey,
                                           java.lang.String cartEntryId)
        Deprecated, for removal: This API element is subject to removal in a future version.
        since 18.08.0 - only link cart entries to configs and configs to products, no direct linking.
        Description copied from interface: SessionAccessService
        Stores cart entry in session per product key
        Specified by:
        setCartEntryForProduct in interface SessionAccessService
        Parameters:
        productKey - product key
        cartEntryId - String representation of the cart entry primary key
      • getCartEntryForProduct

        @Deprecated(since="1808",
                    forRemoval=true)
        public java.lang.String getCartEntryForProduct​(java.lang.String productKey)
        Deprecated, for removal: This API element is subject to removal in a future version.
        since 18.08.0 - only link cart entries to configs and configs to products, no direct linking.
        Description copied from interface: SessionAccessService
        Retrieves cart entry key per product
        Specified by:
        getCartEntryForProduct in interface SessionAccessService
        Parameters:
        productKey - product key
        Returns:
        String representation of the cart entry primary key
      • removeCartEntryForProduct

        @Deprecated(since="1808",
                    forRemoval=true)
        public void removeCartEntryForProduct​(java.lang.String productKey)
        Deprecated, for removal: This API element is subject to removal in a future version.
        since 18.08.0 - only link cart entries to configs and configs to products, no direct linking.
        Description copied from interface: SessionAccessService
        Removes cart entry key for product
        Specified by:
        removeCartEntryForProduct in interface SessionAccessService
        Parameters:
        productKey - product key
      • setDraftConfigIdForCartEntry

        public void setDraftConfigIdForCartEntry​(java.lang.String cartEntryKey,
                                                 java.lang.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
      • getProductForConfigId

        public java.lang.String getProductForConfigId​(java.lang.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