Click or drag to resize

RepositoryConfigBaseTConfig Class

Base class for cached, repository-managed configuration settings.
Inheritance Hierarchy
SystemObject
  PDTec.IceNet.Sdk.ImplementationRepositoryConfigBaseTConfig
    More...

Namespace:  PDTec.IceNet.Sdk.Implementation
Assembly:  PDTec.IceNet.Sdk (in PDTec.IceNet.Sdk.dll) Version: 7.2.0.0 (7.2.7583.15464)
Syntax
C#
public abstract class RepositoryConfigBase<TConfig>
where TConfig : new(), Object

Type Parameters

TConfig
The specific configuration class.

The RepositoryConfigBaseTConfig type exposes the following members.

Constructors
  NameDescription
Protected methodRepositoryConfigBaseTConfig
Initializes a new instance of the RepositoryConfigBaseTConfig class
Top
Properties
  NameDescription
Public propertyStatic memberConfigKey
Gets the key for the configuration object/folder. Throws a ConfigurationException if the ConfigComponent.Key code attribute is not set. This method does not check if a configuration object with this key actually exists.
Public propertyStatic memberSectionName
Gets the name for the XML configuration section. Throws a ConfigurationException if the ConfigComponent.Section code attribute is not set. This method does not check if a configuration section with this name actually exists.
Public propertyStatic memberSettings
Retrieves the configuration settings.
Top
Methods
  NameDescription
Public methodStatic memberDiscardCache
Forces immediate reload of modified configuration settings without waiting for the latency period to expire. However, this method affects the current AppDomain only. There is no way to force other processes to reload configuration settings immediately (besides restarting the processes). Therefore, this method is typically used in environments testing configuration implementations.
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodStatic memberGetOrCreateConfigRootFolder
Gets or creates the configuration root folder. Use this method for maintaining configuration settings. This method is not suitable for retrieving configuration settings in the implementation of the Load(IRepository) method.
Public methodStatic memberGetSettings Obsolete.
Retrieves the configuration settings.
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodLoad
Loads the configuration settings into a new configuration instance. Implement this method to properly initialize the configuration instance that will be stored in the configuration cache until the configuration settings gobally expire.
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Protected methodThrowFolderNotFound
Throws a ConfigurationException to indicate that a configuration folder is missing.
Protected methodThrowObjectNotFound
Throws a ConfigurationException to indicate that a configuration object is missing.
Protected methodThrowXmlSectionNotFound
Throws a ConfigurationException to indicate that a configuration XML element is missing.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodStatic memberUpdated Obsolete.
Indicates that configuration settings have been updated and cached data must be reloaded from the repository after a specific latency period (5 seconds). Call this method after modifying a coherent chunk of configuration settings, typically before the end of a transaction.
Top
Examples

This example shows how to implement a configuration management class based on RepositoryConfigBase.

public class AuditTrailConfig : RepositoryConfigBase<AuditTrailConfig>
{
    public string VaultName;

    public AuditTrailConfig()
    {
        VaultName = "System.Database";
    }

    protected override void Load(IRepository pRepository)
    {
        IObject pAuditTrailConfig;
        if (pRepository.TryGetObjectByKey("Config.AuditTrail", out pAuditTrailConfig))
        {
            pAuditTrailConfig.TryGetAttrValue("IceNet.AuditTrail.AuditTrailConfig", "VaultName", out VaultName);
        }
    }
}

This example shows how to use the configuration management class.

string vaultName = AuditTrailConfig.Settings[Repository].VaultName;
See Also
Inheritance Hierarchy
SystemObject
  PDTec.IceNet.Sdk.ImplementationRepositoryConfigBaseTConfig
    PDTec.IceNet.Domain.AuditTrailAuditTrailConfig
    PDTec.IceNet.Domain.Lifecycle.CachedLifecycleDefinitionConfig
    PDTec.IceNet.Domain.LifecycleLifecycleConfig
    PDTec.IceNet.Domain.SubscriptionSubscriptionConfig
    PDTec.IceNet.Domain.UnitOfMeasurementUnitOfMeasurementConfig
    PDTec.IceNet.Domain.UserManagementUserManagementConfig
    PDTec.IceNet.Sdk.ApplicationApplicationConfig
    PDTec.IceNet.SdkVaultsConfig
    PDTec.IceNet.Web.PortalPortalConfig