IMASynchronization.ResolveJoinSearch Method

Called when a join rule is configured to use a rules extension to resolve conflicts, and when one or more results from a metaverse search match the values that are generated by the MapAttributesForJoin method.

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

Usage

'Usage
Dim instance As IMASynchronization
Dim joinCriteriaName As String
Dim csentry As CSEntry
Dim rgmventry As MVEntry()
Dim imventry As Integer
Dim MVObjectType As String
Dim returnValue As Boolean

returnValue = instance.ResolveJoinSearch(joinCriteriaName, csentry, rgmventry, imventry, MVObjectType)

Syntax

'Declaration
Function ResolveJoinSearch ( _
    joinCriteriaName As String, _
    csentry As CSEntry, _
    rgmventry As MVEntry(), _
    <OutAttribute> ByRef imventry As Integer, _
    ByRef MVObjectType As String _
) As Boolean
bool ResolveJoinSearch (
    string joinCriteriaName,
    CSEntry csentry,
    MVEntry[] rgmventry,
    out int imventry,
    ref string MVObjectType
)
bool ResolveJoinSearch (
    String^ joinCriteriaName, 
    CSEntry^ csentry, 
    array<MVEntry^>^ rgmventry, 
    [OutAttribute] int% imventry, 
    String^% MVObjectType
)
boolean ResolveJoinSearch (
    String joinCriteriaName, 
    CSEntry csentry, 
    MVEntry[] rgmventry, 
    /** @attribute OutAttribute() */ /** @ref */ int imventry, 
    /** @ref */ String MVObjectType
)

Parameters

  • joinCriteriaName
    Contains a string that contains the name of the join criteria. You must use only alphanumeric characters for the joinCriteriaName parameter, otherwise you can encounter problems in a rules extension.
  • csentry
    Contains the CSEntry object that represents the connector space entry that will be joined to the metaverse entry.
  • rgmventry
    Contains an array of CSEntry objects that represent the metaverse entries that match the join operation criteria. On return, the imventry parameter receives the index of the object in this array to which the connector space entry will be joined.
  • imventry
    If the method returns true, this parameter receives the index of the object in the rgmventry parameter to which the connector space entry will be joined.
  • MVObjectType
    Contains a string that contains the name of the metaverse class.

Return Value

Returns true if the join operation can be resolved. The imventry parameter receives the index of the object in the rgmventry array to which the connector space entry will be joined.

Returns false if the connector space entry should not be joined to any of the metaverse entries.

Example

The following example shows an implementation of this method. The method returns true and sets the index number of the CSEntry object in the collection if there is a CSEntry object type that is equal to the CSEntry object type. If there is no match, the method returns false, and the index number is set to -1.

Public Function ResolveJoinSearch(ByVal JoinResolution As String, _
        ByVal csentry As CSEntry, _
        ByVal rgmventry() As MVEntry, _
        ByRef imventry As Integer, ByRef MVObjectClass As String) _
        As Boolean Implements IMASynchronization.ResolveJoinSearch

    ResolveJoinSearch = False
    imventry = -1

    If csentry("employeeType").IsPresent Then
        Dim csemployeeType As String
        Dim mventry As MVEntry
        Dim index As Int32

        index = 0
        csemployeeType = csentry("employeeType").Value

            For Each mventry In rgmventry
                If mventry("employeeType").IsPresent AndAlso _
                    mventry("employeeType").Value.Equals(csemployeeType) Then
                    ResolveJoinSearch = True
                    imventry = index
                    Exit Function
                End If
                index = index + 1
            Next
        End If

End Function
bool IMASynchronization.ResolveJoinSearch (string JoinResolution, 
    CSEntry csentry,
    MVEntry[] rgmventry, 
    out int iMVEntry, 
    ref string MvObjectClass)
    
{
    bool ReturnValue = false;
    iMVEntry = -1;
    
    if (csentry["employeeType"].IsPresent)
    {
        string csemployeeType = csentry["employeeType"].Value;
        int index = 0;
        foreach (MVEntry mventry in rgmventry)
        {
            if (mventry["employeeType"].IsPresent && 
                mventry["employeeType"].Value.Equals(csemployeeType))
            {
                ReturnValue = true;
                iMVEntry = index;
                return ReturnValue;
            }
            index ++;
        }
    }    
    
    return ReturnValue;
}

Exceptions

Exception type Condition
EntryPointNotImplementedException

The rules extension does not implement this method.

UnexpectedDataException

The method received unexpected data.

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

IMASynchronization Interface
IMASynchronization Members
Microsoft.MetadirectoryServices Namespace
CSEntry Class
IMASynchronization Interface