Share via


IMAExtensible2GetSchema.GetSchema Method

This method is used to define objects and attributes contained by the data source.

Namespace: Microsoft.MetadirectoryServices
Assembly: Microsoft.MetadirectoryServicesEx (in Microsoft.MetadirectoryServicesEx.dll)

Usage

'Usage
Dim instance As IMAExtensible2GetSchema
Dim configParameters As KeyedCollection(Of String, ConfigParameter)
Dim returnValue As Schema

returnValue = instance.GetSchema(configParameters)

Syntax

'Declaration
Function GetSchema ( _
    configParameters As KeyedCollection(Of String, ConfigParameter) _
) As Schema
Schema GetSchema (
    KeyedCollection<string,ConfigParameter> configParameters
)
Schema^ GetSchema (
    KeyedCollection<String^, ConfigParameter^>^ configParameters
)
Schema GetSchema (
    KeyedCollection<String,ConfigParameter> configParameters
)
function GetSchema (
    configParameters : KeyedCollection<String,ConfigParameter>
) : Schema

Parameters

Return Value

Returns Schema object that represents the management agent’s schema.

Remarks

This method is mandatory to implement for a call-based Management Agent.

The goal of this method is to return a schema representation where all objects have associated attributes. For each returned object a list of attributes should be returned. The attribute will be associated with its type. Note that the attribute list is shared between the object types so if an attribute name is reused between objects the attribute definition cannot be different.

An attribute can be designed to be an anchor attribute. Anchor attribute(s) are used to uniquely identify an object (see topic Understanding identifiers for a detailed description). If the anchor definition is marked as “Locked” then the administrator cannot change the anchor attribute for the object. If the anchors are not locked then attributes marked as anchors is the default list of anchors but the administrator is allowed to add and remove any attribute as an anchor. An attribute cannot be an anchor for one object type and be used as a non-anchor for a different object. Anchor attributes can be of type String, Integer, and Binary.

Non-anchor attributes are either single-valued or multi-valued and can be of type String, Integer, Reference, Boolean, and Binary. An attribute can also have an optional Operation specified. The default operation is ImportExport which defines that the attribute can be used for both import and export attribute flows. An ExportOnly attribute is used in cases where an exported value will not be seen in a confirming import, e.g. for password-style attributes. An ImportOnly attribute is used when the attribute is read-only in the connected system and an export attribute flow should not be allowed, e.g. system generated attributes for object create date/time.

If the management agent is using LDAP syle DNs then it is possible to return the DN components for which the object type is a possible candidate for automatic provisioning of a structure. E.g. if you return an object named organizationUnit you would also set the list of DN components to include “ou”. This will allow the administrator to link the DN component “ou=” to the organizationUnit schema type and the engine will be able to automatically create new instances if needed to represent the hierarchy in the connected directory.

Exceptions: Return values, Errors, and Exceptions

The following code is an example of GetSchema:

public Schema GetSchema(KeyedCollection<string, ConfigParameter> configParameters)
        {
 
            SchemaType personType = SchemaType.Create("Person", false);
 
            personType.Attributes.Add(SchemaAttribute.CreateAnchorAttribute("anchor-attribute", AttributeType.String));
            personType.Attributes.Add(SchemaAttribute.CreateSingleValuedAttribute("name", AttributeType.String));
            personType.Attributes.Add(SchemaAttribute.CreateSingleValuedAttribute("email", AttributeType.String));
            personType.Attributes.Add(SchemaAttribute.CreateMultiValuedAttribute("multiAttr", AttributeType.String));
 
            Schema schema = Schema.Create();
            schema.Types.Add(personType);
 
            return schema;
        }

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Target Platforms

Change History

See Also

Reference

IMAExtensible2GetSchema Interface
IMAExtensible2GetSchema Members
Microsoft.MetadirectoryServices Namespace