Skip to content

Legacy Extended Configuration Adapter

Legacy extended configuration adapters are special classes that can be registered for connectors and agents that will be used when UNIFYConnect attempts to upgrade legacy XML extensibility configuration to the new, configuration object JSON format.

Legacy extended configuration adapters are implementations of one of these interfaces:

  • Unify.IdentityBroker.Agent.Interfaces.IAgentLegacyExtendedConfigurationAdapter
  • Unify.IdentityBroker.Connector.Engine.Interfaces.IConnectorLegacyExtendedConfigurationAdapter

When implementing a legacy extended configuration adapter, base the XML value extraction logic for the adapter on the on the v5.3 version of the connector plugin, to ensure these processes are equivalent. UNIFYConnect v6 only supports migrations from v5.3, so older configuration schemas do not need to be considered. If there is no v5.3 version of a connector, manual migrations may be required.

Legacy configuration adapters should always convert legacy configuration to the earliest supported schema version, ideally 1.0. The justification for this is that so the legacy adapter can exist as is in perpetuity without having to be maintained as configuration schemas evolve, when configuration reading and writing should already being handling conversion of older, version configuration.

C#
public class ExampleConnectorLegacyExtendedConfigurationAdapter : IConnectorLegacyExtendedConfigurationAdapter
{
    public IConfigObject Transform(XElement sourceValue)
    {
        // Based on old configuration reading logic
        int count = sourceValue.AttributeIntegerValue(ExampleConfigConstants.Legacy.CountAttributeName);
        string label = sourceValue.AttributeValue(ExampleConfigConstants.Legacy.CountAttributeName, null);

        // Converted to v1.0 schema
        var configObject = new ConfigObject(ExtensibilityHelper.ExtensibilityAdapterObjectVersion);

        configObject.Set(ExampleConfigConstants.CountValue, count);
        configObject.Set(ExampleConfigConstants.LabelValue, label);

        return configObject;
    }
}