Interface ConfigurationProvider

    • Method Detail

      • createDefaultConfiguration

        ConfigModel createDefaultConfiguration​(KBKey kbKey)
        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.
        Parameters:
        kbKey - Information needed to identify a knowledge base
        Returns:
        The configurable product with default configuration
      • updateConfiguration

        boolean updateConfiguration​(ConfigModel model)
                             throws ConfigurationEngineException
        Checks the configuration model for changes since the last update and will send only the changes to the configuration engine, if any.
        Parameters:
        model - Updated model
        Returns:
        true, only if it was necessary to send an update to the configuration engine
        Throws:
        ConfigurationEngineException
      • changeConfiguration

        java.lang.String changeConfiguration​(ConfigModel model)
                                      throws ConfigurationEngineException
        Checks the configuration model for changes since the last update and will send only the changes to the configuration engine, if any. The version of the runtime configuration must be included in the configuration model and the method returns the new version after the update.
        Parameters:
        model - Updated model
        Returns:
        new configuration runtime version if update successful, otherwise null
        Throws:
        ConfigurationEngineException
      • retrieveConfigurationModel

        ConfigModel retrieveConfigurationModel​(java.lang.String configId)
                                        throws ConfigurationEngineException
        Retrieve the current state of the configuration model for the requested configId.
        Parameters:
        configId - Unique configuration ID
        Returns:
        The actual configuration
        Throws:
        ConfigurationEngineException - Service has failed, e.g. because session timed out
      • retrieveConfigurationModel

        default ConfigModel retrieveConfigurationModel​(java.lang.String configId,
                                                       ConfigurationRetrievalOptions options)
                                                throws ConfigurationEngineException
        Retrieve the current state of the configuration model for the requested configId.
        Parameters:
        configId - Unique configuration ID
        options - options to consider while reading the configuration, such as additional/updated variant conditions for pricing
        Returns:
        The actual configuration
        Throws:
        ConfigurationEngineException - Service has failed, e.g. because session timed out
      • retrieveExternalConfiguration

        java.lang.String retrieveExternalConfiguration​(java.lang.String configId)
                                                throws ConfigurationEngineException
        Retrieve the current state of the configuration for the requested configId as an XML string containing the configuration in external format.
        Parameters:
        configId - Unique configuration ID
        Returns:
        The actual configuration as XML string
        Throws:
        ConfigurationEngineException - Service has failed, e.g. because session timed out
      • createConfigurationFromExternalSource

        ConfigModel createConfigurationFromExternalSource​(Configuration extConfig)
        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.
        Parameters:
        extConfig - External configuration in external format
        Returns:
        Configuration model
      • createConfigurationFromExternalSource

        ConfigModel createConfigurationFromExternalSource​(KBKey kbKey,
                                                          java.lang.String extConfig)
        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.
        Parameters:
        kbKey - Information needed to create a knowledge base
        extConfig - External configuration as XML string
        Returns:
        Configuration model
      • releaseSession

        void releaseSession​(java.lang.String configId)
        Releases the configuration sessions identified by the provided ID and all associated resources. Accessing the session afterwards is not possible anymore.
        Parameters:
        configId - session id
      • releaseSession

        void releaseSession​(java.lang.String configId,
                            java.lang.String version)
        Releases the configuration sessions identified by the provided ID and all associated resources. Accessing the session afterwards is not possible anymore.
        Parameters:
        configId - session id
        version - version of the runtime configuration
      • retrieveConfigurationFromVariant

        default ConfigModel retrieveConfigurationFromVariant​(java.lang.String baseProductCode,
                                                             java.lang.String variantProductCode)
        Get configuration for the base product, initialized with given configuration of the variant
        Parameters:
        baseProductCode -
        variantProductCode -
        Returns:
        The pre-filled configuration model
      • isKbForDateExists

        boolean isKbForDateExists​(java.lang.String productCode,
                                  java.util.Date kbDate)
        Parameters:
        productCode -
        kbDate -
        Returns:
        true only if a valid KBVersion exists for the given product and date.
      • isKbVersionExists

        @Deprecated(since="1808",
                    forRemoval=true)
        default boolean isKbVersionExists​(KBKey kbKey,
                                          java.lang.String externalConfig)
        Deprecated, for removal: This API element is subject to removal in a future version.
        since 18.08.0 - please call extractKbKey(String, String) and isKbVersionExists(KBKey) instead
        Parameters:
        kbKey -
        externalConfig -
        Returns:
        true if KB exist in required version
      • extractKbKey

        default KBKey extractKbKey​(java.lang.String productCode,
                                   java.lang.String externalConfig)
        extracts the KBKey from the external configuration
        Parameters:
        externalConfig -
        productCode -
        Returns:
        returns the kBKey of the given external config
      • isKbVersionExists

        default boolean isKbVersionExists​(KBKey kbKey)
        Parameters:
        kbKey -
        Returns:
        returns true only if the KB version identified by the the given KBKey is known by the underlying configuration engine.
      • isKbVersionValid

        default boolean isKbVersionValid​(KBKey kbKey)
        Parameters:
        kbKey -
        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.
      • isConfigureVariantSupported

        @Deprecated(since="1905",
                    forRemoval=true)
        default boolean isConfigureVariantSupported()
        Deprecated, for removal: This API element is subject to removal in a future version.
        since 19.05 - not used anymore, all providers should support variants
        Returns:
        Does this provide support the re-configuration of a variant?