Class BaseConfigurationProviderSSCImpl

    • Constructor Detail

      • BaseConfigurationProviderSSCImpl

        public BaseConfigurationProviderSSCImpl()
    • Method Detail

      • setConfigurationSessionContainer

        public void setConfigurationSessionContainer​(ConfigurationSessionContainer configurationSessionContainer)
        Parameters:
        configurationSessionContainer - configuration session container
      • createDefaultConfiguration

        public ConfigModel createDefaultConfiguration​(KBKey kbKey)
        Description copied from interface: ConfigurationProvider
        Creates a default configuration for the required knowledge base. The knowledge base (KB) can be identified e.g. via the product code or via the KB name, version and logical system.
        Specified by:
        createDefaultConfiguration in interface ConfigurationProvider
        Parameters:
        kbKey - Information needed to identify a knowledge base
        Returns:
        The configurable product with default configuration
      • updateConfiguration

        public boolean updateConfiguration​(ConfigModel configModel)
        Description copied from interface: ConfigurationProvider
        Checks the configuration model for changes since the last update and will send only the changes to the configuration engine, if any.
        Specified by:
        updateConfiguration in interface ConfigurationProvider
        Parameters:
        configModel - Updated model
        Returns:
        true, only if it was necessary to send an update to the configuration engine
      • getValuesToBeAssigned

        protected java.util.List<java.lang.String> getValuesToBeAssigned​(CsticModel csticModel)
      • getValuesPreviouslyAssigned

        protected java.util.List<java.lang.String> getValuesPreviouslyAssigned​(com.sap.custdev.projects.fbs.slc.cfg.client.ICsticData csticData)
      • retrieveConfigurationModel

        public ConfigModel retrieveConfigurationModel​(java.lang.String qualifiedConfigId)
        Description copied from interface: ConfigurationProvider
        Retrieve the current state of the configuration model for the requested configId.
        Specified by:
        retrieveConfigurationModel in interface ConfigurationProvider
        Parameters:
        qualifiedConfigId - Unique configuration ID
        Returns:
        The actual configuration
      • retrieveExternalConfiguration

        public java.lang.String retrieveExternalConfiguration​(java.lang.String qualifiedId)
        Description copied from interface: ConfigurationProvider
        Retrieve the current state of the configuration for the requested configId as an XML string containing the configuration in external format.
        Specified by:
        retrieveExternalConfiguration in interface ConfigurationProvider
        Parameters:
        qualifiedId -
        Returns:
        String external configuration as XML
      • initializeDefaultConfiguration

        protected java.lang.String initializeDefaultConfiguration​(KBKey kbKey)
      • createConfig

        protected java.lang.String createConfig​(KBKey kbKey,
                                                com.sap.custdev.projects.fbs.slc.cfg.IConfigSession session)
                                         throws com.sap.custdev.projects.fbs.slc.cfg.exception.IpcCommandException
        Throws:
        com.sap.custdev.projects.fbs.slc.cfg.exception.IpcCommandException
      • getFormattedDate

        protected java.lang.String getFormattedDate​(KBKey kbKey)
      • fillConfigModel

        protected abstract ConfigModel fillConfigModel​(java.lang.String qualifiedId)
      • calculateStaticDomainLength

        protected int calculateStaticDomainLength​(com.sap.custdev.projects.fbs.slc.cfg.IConfigSession session,
                                                  java.lang.String configId,
                                                  java.lang.String instanceId,
                                                  java.lang.String csticName)
                                           throws com.sap.custdev.projects.fbs.slc.cfg.exception.IpcCommandException
        Throws:
        com.sap.custdev.projects.fbs.slc.cfg.exception.IpcCommandException
      • adjustCsticAuthor

        protected void adjustCsticAuthor​(CsticModel csticModel,
                                         boolean containesValueSetByUser)
        Parameters:
        csticModel -
        containesValueSetByUser -
      • retrieveQualifiedId

        protected java.lang.String retrieveQualifiedId​(java.lang.String sessionId,
                                                       java.lang.String configId)
      • retrievePlainConfigId

        protected java.lang.String retrievePlainConfigId​(java.lang.String qualifiedId)
      • retrieveSessionId

        protected java.lang.String retrieveSessionId​(java.lang.String qualifiedId)
      • holdConfigSession

        protected void holdConfigSession​(java.lang.String qualifiedId,
                                         com.sap.custdev.projects.fbs.slc.cfg.IConfigSession configSession)
      • retrieveConfigSession

        protected com.sap.custdev.projects.fbs.slc.cfg.IConfigSession retrieveConfigSession​(java.lang.String qualifiedId)
      • setContextAndPricingWrapper

        public void setContextAndPricingWrapper​(ConfigurationContextAndPricingWrapper contextAndPricingWrapper)
        Parameters:
        contextAndPricingWrapper - configuration context and pricing wrapper
      • preparePricingContext

        protected void preparePricingContext​(com.sap.custdev.projects.fbs.slc.cfg.IConfigSession session,
                                             java.lang.String configId,
                                             KBKey kbKey)
                                      throws com.sap.custdev.projects.fbs.slc.cfg.ipintegration.InteractivePricingException
        Throws:
        com.sap.custdev.projects.fbs.slc.cfg.ipintegration.InteractivePricingException
      • retrievePrice

        protected void retrievePrice​(com.sap.custdev.projects.fbs.slc.cfg.IConfigSession session,
                                     ConfigModel configModel)
                              throws com.sap.custdev.projects.fbs.slc.cfg.ipintegration.InteractivePricingException
        Throws:
        com.sap.custdev.projects.fbs.slc.cfg.ipintegration.InteractivePricingException
      • createSession

        public com.sap.custdev.projects.fbs.slc.cfg.IConfigSession createSession​(KBKey kbKey)
                                                                          throws com.sap.custdev.projects.fbs.slc.cfg.exception.IpcCommandException
        Creates session
        Parameters:
        kbKey - Not used in default implementation but provided since subclasses can make use of it.
        Returns:
        config session
        Throws:
        com.sap.custdev.projects.fbs.slc.cfg.exception.IpcCommandException
      • createSSCSession

        protected com.sap.custdev.projects.fbs.slc.cfg.IConfigSession createSSCSession()
                                                                                throws com.sap.custdev.projects.fbs.slc.cfg.exception.IpcCommandException
        Throws:
        com.sap.custdev.projects.fbs.slc.cfg.exception.IpcCommandException
      • createConfigurationFromExternalSource

        public ConfigModel createConfigurationFromExternalSource​(Configuration extConfig)
        Description copied from interface: ConfigurationProvider
        Creates a configuration from the configuration in external format which can be provided from outside, e.g. from the configuration prepared in the back end.

        This API does _not_ force the KB related attributes to be existing. In case only the product ID is provided, a matching KB version is determined.
        Specified by:
        createConfigurationFromExternalSource in interface ConfigurationProvider
        Parameters:
        extConfig - External configuration in external format
        Returns:
        Configuration model
      • updateProductCode

        protected void updateProductCode​(ConfigModel configModel,
                                         java.lang.String productCode)
      • initializeConfigurationFromExternalSource

        protected java.lang.String initializeConfigurationFromExternalSource​(Configuration extConfig)
      • setExternalContext

        protected void setExternalContext​(com.sap.custdev.projects.fbs.slc.cfg.IConfigSession session,
                                          Configuration extConfig)
                                   throws com.sap.custdev.projects.fbs.slc.cfg.exception.IpcCommandException
        Throws:
        com.sap.custdev.projects.fbs.slc.cfg.exception.IpcCommandException
      • isNotProvided

        protected boolean isNotProvided​(java.lang.String attribute)
      • createConfigFromExternalSource

        protected java.lang.String createConfigFromExternalSource​(com.sap.custdev.projects.fbs.slc.cfg.IConfigSession session,
                                                                  Configuration extConfig)
                                                           throws com.sap.custdev.projects.fbs.slc.cfg.exception.IpcCommandException
        Throws:
        com.sap.custdev.projects.fbs.slc.cfg.exception.IpcCommandException
      • prepareCsticDataArrayFromExternalSource

        protected com.sap.custdev.projects.fbs.slc.cfg.client.ICsticData[] prepareCsticDataArrayFromExternalSource​(Configuration extConfig)
      • addCsticValue

        protected void addCsticValue​(com.sap.custdev.projects.fbs.slc.cfg.client.ICsticHeader csticHeader,
                                     com.sap.custdev.projects.fbs.slc.cfg.client.ICsticValueData[] csticValues,
                                     int i,
                                     CharacteristicValue value)
      • createConfigurationFromExternalSource

        public ConfigModel createConfigurationFromExternalSource​(KBKey kbKey,
                                                                 java.lang.String extConfig)
        Description copied from interface: ConfigurationProvider
        Creates a configuration from an XML string containing the configuration in external format.

        This API requires the KB related attributes as part of the external configuration to be available, they are directly forwarded to the configuration engine.
        Specified by:
        createConfigurationFromExternalSource in interface ConfigurationProvider
        Parameters:
        kbKey - Information needed to create a knowledge base
        extConfig - External configuration as XML string
        Returns:
        Configuration model
      • releaseSession

        public void releaseSession​(java.lang.String sessionId)
        Description copied from interface: ConfigurationProvider
        Releases the configuration sessions identified by the provided ID and all associated resources. Accessing the session afterwards is not possible anymore.
        Specified by:
        releaseSession in interface ConfigurationProvider
        Parameters:
        sessionId - session id
      • getSessionMap

        public java.util.Map<java.lang.String,​com.sap.custdev.projects.fbs.slc.cfg.IConfigSession> getSessionMap()
        Returns:
        sessionMap
      • setConfigModelFactory

        public void setConfigModelFactory​(ConfigModelFactory configModelFactory)
        Parameters:
        configModelFactory -
      • getConfigModelFactory

        protected ConfigModelFactory getConfigModelFactory()
        Returns:
        configModelFactory
      • getTextConverter

        protected TextConverter getTextConverter()
        Returns:
        textConverter
      • setTextConverter

        public void setTextConverter​(TextConverter textConverter)
        Parameters:
        textConverter -
      • getTimer

        protected SSCTimer getTimer()
        Returns:
        timer
      • getConfigurationUpdateAdapter

        public ConfigurationUpdateAdapter getConfigurationUpdateAdapter()
        Returns:
        the configurationUpdateAdapter
      • setConfigurationUpdateAdapter

        public void setConfigurationUpdateAdapter​(ConfigurationUpdateAdapter configurationUpdateAdapter)
        Parameters:
        configurationUpdateAdapter - the configurationUpdateAdapter to set
      • getI18NService

        protected I18NService getI18NService()
        Returns:
        i18NService
      • setI18NService

        public void setI18NService​(I18NService i18nService)
        Parameters:
        i18nService -
      • setConflictAdapter

        public void setConflictAdapter​(SolvableConflictAdapter conflictAdapter)
        Parameters:
        conflictAdapter - the conflictAdapter to set
      • isKbForDateExists

        public boolean isKbForDateExists​(java.lang.String productCode,
                                         java.util.Date kbDate)
        Specified by:
        isKbForDateExists in interface ConfigurationProvider
        Returns:
        true only if a valid KBVersion exists for the given product and date.
      • isKbVersionExists

        public boolean isKbVersionExists​(KBKey kbKey)
        Specified by:
        isKbVersionExists in interface ConfigurationProvider
        Returns:
        returns true only if the KB version identified by the the given KBKey is known by the underlying configuration engine.
      • isKbVersionValid

        public boolean isKbVersionValid​(KBKey kbKey)
        Specified by:
        isKbVersionValid in interface ConfigurationProvider
        Returns:
        returns true only if the KB version identified by the the given KBKey is known by the underlying configuration engine and if it is still valid on the given date.
      • extractKbKey

        public KBKey extractKbKey​(java.lang.String productCode,
                                  java.lang.String externalConfig)
        Description copied from interface: ConfigurationProvider
        extracts the KBKey from the external configuration
        Specified by:
        extractKbKey in interface ConfigurationProvider
        Returns:
        returns the kBKey of the given external config
      • findKBs

        protected com.sap.custdev.projects.fbs.slc.cfg.client.IKnowledgeBaseData[] findKBs​(KBKey kbKey,
                                                                                           boolean considerDate)
      • callSSCtoFindKBs

        protected com.sap.custdev.projects.fbs.slc.cfg.client.IKnowledgeBaseData[] callSSCtoFindKBs​(KBKey kbKey,
                                                                                                    java.lang.String kbDateString)
                                                                                             throws com.sap.custdev.projects.fbs.slc.cfg.exception.IpcCommandException
        Throws:
        com.sap.custdev.projects.fbs.slc.cfg.exception.IpcCommandException
      • findKBInList

        protected com.sap.custdev.projects.fbs.slc.cfg.client.IKnowledgeBaseData findKBInList​(KBKey kbKey,
                                                                                              com.sap.custdev.projects.fbs.slc.cfg.client.IKnowledgeBaseData[] allKBVersions)
      • extractConfigurationFromXml

        protected java.lang.String extractConfigurationFromXml​(java.lang.String extConfiguration)
      • setEnginePropertiesInitializer

        public void setEnginePropertiesInitializer​(SSCEnginePopertiesInitializer enginePropertiesInitializer)
        Parameters:
        enginePropertiesInitializer - engine property initializer