7.6.2.6 Following an LDAP Referral or Continuation Reference
This task follows an LDAP referral or continuation reference ([RFC2251] sections 4.1.11, Referral, and 4.5.3, Continuation References in the Search Result, and section 3.1.1.3.1.4, Referrals in LDAPv2 and LDAPv3).
The parameters for this task are as follows:
Name |
Type |
Description |
Optional |
---|---|---|---|
TaskInputLdapRequest |
LDAPRequest |
The request that originally generated this referral or continuation reference. |
No |
TaskInputReferralUrl |
LDAP URL |
An LDAP URL (see [RFC2255]) that was returned by the server. |
No |
The task returns the following results to the caller:
Name |
Type |
Description |
---|---|---|
TaskReturnStatus |
Boolean |
This task returns TRUE if the client successfully sends the referral request to the directory server. Otherwise, it returns FALSE. |
The task performs the following actions:
Let containingConnectionInfo be the ConnectionInfo instance for which containingConnectionInfo.pendingRequestList contains TaskInputLdapRequest.
Let containingADConnection be the ADConnection instance contained in ADCList for which containingADConnection.primaryConnection is set to containingConnectionInfo or for which the containingADConnection.referralConnections list contains containingConnectionInfo.
If TaskInputLdapRequest.numReferrals is greater than or equal to containingADConnection.LDAP_OPT_REFERRAL_HOP_LIMIT, return FALSE.
Let newServer be a string initialized to the host portion of the hostport element of TaskInputReferralUrl, or NULL if there is no host portion. See [RFC2255].
Let newPort be an unsigned integer initialized to the port portion of the hostport element of TaskInputReferralUrl, or 389 if there is no port portion. See [RFC2255].
Let newConnectionInfo be the result of invoking the Initializing a Connection to a Directory Server (section 7.6.2.1) task with the following parameters: TaskInputTargetName is set to newServer and TaskInputPortNumber is set to newPort.
Append newConnectionInfo to containingADConnection.referralConnections.
Invoke the Connecting to a Directory Server (section 7.6.2.2) task with the following parameter: TaskInputConnectionInfo is set to newConnectionInfo. If the invocation returns FALSE, remove newConnectionInfo from containingADConnection.referralConnections and this task returns FALSE.
If containingConnectionInfo.bindHasHappened is TRUE:
Invoke the Performing an LDAP Bind Against a Directory Server (section 7.6.2.3) task with the following parameter: TaskInputConnectionInfo is set to newConnectionInfo. If this invocation returns FALSE, newConnectionInfo is removed from containingADConnection.referralConnections and this task returns FALSE.
The fields of TaskInputLdapRequest.requestMessage are modified, for example setting the dn or filter, based on TaskInputReferralUrl according to the rules in [RFC2255] section 5, URL Processing, and [RFC2251] sections 4.1.1, Message Envelope, and 4.5.3, Continuation References in the Search Result.
Invoke the Performing an LDAP Operation Against a Directory Server (section 7.6.2.5) task with the following parameters: TaskInputConnectionInfo is set to newConnectionInfo and TaskInputRequestMessage is set to the TaskInputLdapRequest parameter of this task.
Invoke the Performing an LDAP Unbind Against a Directory Server (section 7.6.2.4) task with the following parameter: TaskInputConnectionInfo is set to newConnectionInfo.
Remove newConnectionInfo from containingADConnection.referralConnections.
If the invocation of Performing an LDAP Operation Against a Directory Server (section 7.6.2.5) task in step 11 returned TRUE, then TaskInputLdapRequest.numReferrals is incremented and this task returns TRUE. Otherwise this task returns FALSE.