Back to index

openldap  2.4.31
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Attributes | Private Member Functions | Private Attributes
LDAPSearchReference Class Reference

This class is used to represent Continuation References that were returned during a SEARCH-Operation. More...

#include <LDAPSearchReference.h>

Inheritance diagram for LDAPSearchReference:
Inheritance graph
[legend]
Collaboration diagram for LDAPSearchReference:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 LDAPSearchReference (const LDAPRequest *req, LDAPMessage *msg)
 Constructor that create an object from the C-API structures.
 ~LDAPSearchReference ()
 The Destructor.
const LDAPUrlListgetUrls () const
int getMessageType ()
int getMsgID ()
bool hasControls () const
const LDAPControlSetgetSrvControls () const

Static Public Member Functions

static LDAPMsgcreate (const LDAPRequest *req, LDAPMessage *msg)
 This method is used by the library to parse the results returned by the C-API.

Static Public Attributes

static const int BIND_RESPONSE = LDAP_RES_BIND
static const int SEARCH_ENTRY = LDAP_RES_SEARCH_ENTRY
static const int SEARCH_DONE = LDAP_RES_SEARCH_RESULT
static const int SEARCH_REFERENCE = LDAP_RES_SEARCH_REFERENCE
static const int MODIFY_RESPONSE = LDAP_RES_MODIFY
static const int ADD_RESPONSE = LDAP_RES_ADD
static const int DEL_RESPONSE = LDAP_RES_DELETE
static const int MODDN_RESPONSE = LDAP_RES_MODDN
static const int COMPARE_RESPONSE = LDAP_RES_COMPARE
static const int EXTENDED_RESPONSE = LDAP_RES_EXTENDED
static const int BIND_REQUEST = LDAP_REQ_BIND
static const int UNBIND_REQUEST = LDAP_REQ_UNBIND
static const int SEARCH_REQUEST = LDAP_REQ_SEARCH
static const int MODIFY_REQUEST = LDAP_REQ_MODIFY
static const int ADD_REQUEST = LDAP_REQ_ADD
static const int DELETE_REQUEST = LDAP_REQ_DELETE
static const int MODRDN_REQUEST = LDAP_REQ_MODRDN
static const int COMPARE_REQUEST = LDAP_REQ_COMPARE
static const int ABANDON_REQUEST = LDAP_REQ_ABANDON
static const int EXTENDED_REQUEST = LDAP_REQ_EXTENDED

Protected Attributes

LDAPControlSet m_srvControls
 This attribute stores Server-Control that were returned with the message.
bool m_hasControls

Private Member Functions

 LDAPSearchReference ()

Private Attributes

LDAPUrlList m_urlList

Detailed Description

This class is used to represent Continuation References that were returned during a SEARCH-Operation.

Definition at line 21 of file LDAPSearchReference.h.


Constructor & Destructor Documentation

LDAPSearchReference::LDAPSearchReference ( const LDAPRequest req,
LDAPMessage *  msg 
)

Constructor that create an object from the C-API structures.

Definition at line 18 of file LDAPSearchReference.cpp.

                          : LDAPMsg(msg){
    DEBUG(LDAP_DEBUG_CONSTRUCT,
            "LDAPSearchReference::LDAPSearchReference()" << endl;)    
    char **ref=0;
    LDAPControl** srvctrls=0;
    const LDAPAsynConnection* con=req->getConnection();
    int err = ldap_parse_reference(con->getSessionHandle(), msg, &ref, 
            &srvctrls,0);
    if (err != LDAP_SUCCESS){
        ber_memvfree((void**) ref);
        ldap_controls_free(srvctrls);
        throw LDAPException(err);
    }else{
        m_urlList=LDAPUrlList(ref);
        ber_memvfree((void**) ref);
        if (srvctrls){
            m_srvControls = LDAPControlSet(srvctrls);
            m_hasControls = true;
            ldap_controls_free(srvctrls);
        }else{
            m_hasControls = false;
        }
    }
}

Here is the call graph for this function:

The Destructor.

Definition at line 44 of file LDAPSearchReference.cpp.

                                         {
    DEBUG(LDAP_DEBUG_DESTROY,"LDAPSearchReference::~LDAPSearchReference()"
            << endl);
}

Member Function Documentation

LDAPMsg * LDAPMsg::create ( const LDAPRequest req,
LDAPMessage *  msg 
) [static, inherited]

This method is used by the library to parse the results returned by the C-API.

Based on msgtype-Value of the *msg-Parameter this method creates an Object of one of the subtypes of LDAPMsg (e.g. LDAPSearchResult or LDAPResult) that represents the same Message as the *msg-Parameter. *msg is e.g. a Message returned by the C-API's ldap_result call.

Parameters:
reqThe LDAPRequest-object this result message is associated with.
msgThe LDAPMessage-structure from the C-API that contains the LDAP-message to parse.
Returns:
An Object of one of the subtypes of this class. It contains the parsed LDAP-message.

Definition at line 34 of file LDAPMessage.cpp.

                                                                {
    DEBUG(LDAP_DEBUG_TRACE,"LDAPMsg::create()" << endl);
    switch(ldap_msgtype(msg)){
        case SEARCH_ENTRY :
            return new LDAPSearchResult(req,msg);
        break;
        case SEARCH_REFERENCE :
            return new LDAPSearchReference(req, msg);
        break;
        case EXTENDED_RESPONSE :
            return new LDAPExtResult(req,msg);
        break;
        case BIND_RESPONSE :
            return new LDAPSaslBindResult(req,msg);
        default :
            return new LDAPResult(req, msg);
    }
    return 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int LDAPMsg::getMessageType ( ) [inherited]
Returns:
The Type of message that this object contains. Possible values are:
BIND_RESPONSE
SEARCH_ENTRY
SEARCH_DONE
SEARCH_REFERENCE
MODIFY_RESPONSE
ADD_RESPONSE
DEL_RESPONSE
MODDN_RESPONSE
COMPARE_RESPONSE
EXTENDED_REPONSE

Definition at line 55 of file LDAPMessage.cpp.

                           {
    DEBUG(LDAP_DEBUG_TRACE,"LDAPMsg::getMessageType()" << endl);
    return msgType;
}

Here is the caller graph for this function:

int LDAPMsg::getMsgID ( ) [inherited]
Returns:
The message-ID that the C-API return for the Result-message.

Definition at line 60 of file LDAPMessage.cpp.

                     {
    DEBUG(LDAP_DEBUG_TRACE,"LDAPMsg::getMsgID()" << endl);
    return msgID;
}
const LDAPControlSet & LDAPMsg::getSrvControls ( ) const [inherited]
Returns:
Server controls that were sent back by the server.
Note:
This feature is not test well yet.

Definition at line 69 of file LDAPMessage.cpp.

                                                    {
    return m_srvControls;
}
Returns:
The destination URLs that were send with this message

Definition at line 49 of file LDAPSearchReference.cpp.

                                                     {
    DEBUG(LDAP_DEBUG_TRACE,"LDAPSearchReference::getUrls()" << endl);
    return m_urlList;
}
bool LDAPMsg::hasControls ( ) const [inherited]
Returns:
If any Control was sent back by the server this method returns true. Otherwise false is returned.

Definition at line 65 of file LDAPMessage.cpp.

                               {
    return m_hasControls;
}

Member Data Documentation

Definition at line 45 of file LDAPMessage.h.

const int LDAPMsg::ADD_REQUEST = LDAP_REQ_ADD [static, inherited]

Definition at line 41 of file LDAPMessage.h.

Definition at line 31 of file LDAPMessage.h.

Definition at line 37 of file LDAPMessage.h.

Definition at line 26 of file LDAPMessage.h.

Definition at line 44 of file LDAPMessage.h.

Definition at line 34 of file LDAPMessage.h.

Definition at line 32 of file LDAPMessage.h.

Definition at line 42 of file LDAPMessage.h.

Definition at line 46 of file LDAPMessage.h.

Definition at line 35 of file LDAPMessage.h.

bool LDAPMsg::m_hasControls [protected, inherited]

Definition at line 121 of file LDAPMessage.h.

LDAPControlSet LDAPMsg::m_srvControls [protected, inherited]

This attribute stores Server-Control that were returned with the message.

Definition at line 119 of file LDAPMessage.h.

Definition at line 40 of file LDAPSearchReference.h.

Definition at line 33 of file LDAPMessage.h.

Definition at line 40 of file LDAPMessage.h.

Definition at line 30 of file LDAPMessage.h.

Definition at line 43 of file LDAPMessage.h.

Definition at line 28 of file LDAPMessage.h.

Definition at line 27 of file LDAPMessage.h.

Definition at line 29 of file LDAPMessage.h.

Definition at line 39 of file LDAPMessage.h.

Definition at line 38 of file LDAPMessage.h.


The documentation for this class was generated from the following files: