Back to index

openldap  2.4.31
Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes
LDAPRequest Class Reference

For internal use only. More...

#include <LDAPRequest.h>

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

List of all members.

Public Member Functions

 LDAPRequest (const LDAPRequest &req)
 LDAPRequest (LDAPAsynConnection *conn, const LDAPConstraints *cons, bool isReferral=false, const LDAPRequest *parent=0)
virtual ~LDAPRequest ()
const LDAPConstraintsgetConstraints () const
const LDAPAsynConnectiongetConnection () const
virtual LDAPMsggetNextMessage () const
int getType () const
int getMsgID () const
int getHopCount () const
const LDAPRequestgetParent () const
bool isReferral () const
void unbind () const
virtual LDAPMessageQueuesendRequest ()=0
 This method encodes the request an calls the apprpriate functions of the C-API to send the Request to a LDAP-Server.
virtual LDAPRequestfollowReferral (LDAPMsg *ref)
virtual bool equals (const LDAPRequest *req) const
 Compare this request with another on.
bool isCycle () const

Static Public Attributes

static const int BIND = 0
static const int UNBIND = 2
static const int SEARCH = 3
static const int MODIFY = 7
static const int ADD = 8
static const int DELETE = 10
static const int COMPARE = 14

Protected Member Functions

 LDAPRequest ()

Protected Attributes

bool m_isReferral
int m_requestType
LDAPConstraintsm_cons
LDAPAsynConnectionm_connection
const LDAPRequestm_parent
int m_hopCount
int m_msgID

Detailed Description

For internal use only.

Each request that is sent to a LDAP-server by this library is represented by a special object that contains the parameters and some other info of the request. This virtual class is the common base classe for these specialized request classes.

Definition at line 25 of file LDAPRequest.h.


Constructor & Destructor Documentation

Definition at line 17 of file LDAPRequest.cpp.

                                              {
    DEBUG(LDAP_DEBUG_CONSTRUCT, "LDAPRequest::LDAPRequest(&)" << endl);
    m_isReferral=req.m_isReferral;
    m_cons = new LDAPConstraints(*(req.m_cons));
    m_connection = req.m_connection;
    m_parent = req.m_parent;
    m_hopCount = req.m_hopCount;
    m_msgID = req.m_msgID;
}
LDAPRequest::LDAPRequest ( LDAPAsynConnection conn,
const LDAPConstraints cons,
bool  isReferral = false,
const LDAPRequest parent = 0 
)

Definition at line 27 of file LDAPRequest.cpp.

                                                                              {
    DEBUG(LDAP_DEBUG_CONSTRUCT,"LDAPRequest::LDAPRequest()" << endl);
    m_connection=con;
    if(cons == 0){
        m_cons=new LDAPConstraints( *(con->getConstraints()) );
    }else{
        m_cons=new LDAPConstraints( *cons);
    }
    m_isReferral=isReferral; 
    if(m_isReferral){
        m_hopCount = (parent->getHopCount()+1);
        m_parent= parent;
    }else{
        m_hopCount=0;
        m_parent=0;
    }
}

Here is the call graph for this function:

Definition at line 46 of file LDAPRequest.cpp.

                         {
    DEBUG(LDAP_DEBUG_DESTROY,"LDAPRequest::~LDAPRequest()" << endl);
    delete m_cons;
}
LDAPRequest::LDAPRequest ( ) [protected]

Definition at line 13 of file LDAPRequest.cpp.

                        {
    DEBUG(LDAP_DEBUG_CONSTRUCT, "LDAPRequest::LDAPRequest()" << endl);
}

Member Function Documentation

bool LDAPRequest::equals ( const LDAPRequest req) const [virtual]

Compare this request with another on.

And returns true if they have the same parameters.

Reimplemented in LDAPSearchRequest.

Definition at line 116 of file LDAPRequest.cpp.

                                                    {
    DEBUG(LDAP_DEBUG_TRACE,"LDAPRequest::equals()" << endl);
    if( (this->m_requestType == req->getType()) && 
        (this->m_connection->getHost() == req->m_connection->getHost()) && 
        (this->m_connection->getPort() == req->m_connection->getPort())
      ){
        return true;
    }return false;        
}

Here is the call graph for this function:

Here is the caller graph for this function:

Reimplemented in LDAPSearchRequest, LDAPModifyRequest, LDAPAddRequest, LDAPModDNRequest, LDAPCompareRequest, LDAPDeleteRequest, and LDAPExtRequest.

Definition at line 74 of file LDAPRequest.cpp.

                                                  {
    DEBUG(LDAP_DEBUG_TRACE,"LDAPBindRequest::followReferral()" << endl);
    DEBUG(LDAP_DEBUG_TRACE,
            "ReferralChasing not implemented for this operation" << endl);
    return 0;
}

Here is the caller graph for this function:

Definition at line 86 of file LDAPRequest.cpp.

                                                          {
    DEBUG(LDAP_DEBUG_TRACE,"LDAPRequest::getConnection()" << endl);
    return m_connection;
}

Here is the caller graph for this function:

Definition at line 81 of file LDAPRequest.cpp.

                                                        {
    DEBUG(LDAP_DEBUG_TRACE,"LDAPRequest::getConstraints()" << endl);
    return m_cons;
}

Here is the caller graph for this function:

Definition at line 101 of file LDAPRequest.cpp.

                                   {
    DEBUG(LDAP_DEBUG_TRACE,"LDAPRequest::getHopCount()" << endl);
    return m_hopCount;
}

Here is the caller graph for this function:

Definition at line 96 of file LDAPRequest.cpp.

                                {
    DEBUG(LDAP_DEBUG_TRACE,"LDAPRequest::getMsgId()" << endl);
    return m_msgID;
}

Here is the caller graph for this function:

LDAPMsg * LDAPRequest::getNextMessage ( ) const [virtual]

Reimplemented in LDAPSaslInteractiveBind.

Definition at line 51 of file LDAPRequest.cpp.

{
    DEBUG(LDAP_DEBUG_DESTROY,"LDAPRequest::getNextMessage()" << endl);
    int res;
    LDAPMessage *msg;

    res=ldap_result(this->m_connection->getSessionHandle(),
            this->m_msgID,0,0,&msg);

    if (res <= 0){
        if(msg != 0){
            ldap_msgfree(msg);
        }
        throw  LDAPException(this->m_connection);
    }else{    
        LDAPMsg *ret=0;
        //this can  throw an exception (Decoding Error)
        ret = LDAPMsg::create(this,msg);
        ldap_msgfree(msg);
        return ret;
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

Returns:
The LDAPRequest that has created this object. Or 0 if this object was not created by another request.

Definition at line 106 of file LDAPRequest.cpp.

                                               {
    DEBUG(LDAP_DEBUG_TRACE,"LDAPRequest::getParent()" << endl);
    return m_parent;
}

Here is the caller graph for this function:

Definition at line 91 of file LDAPRequest.cpp.

                               {
    DEBUG(LDAP_DEBUG_TRACE,"LDAPRequest::getType()" << endl);
    return m_requestType;
}

Here is the caller graph for this function:

bool LDAPRequest::isCycle ( ) const

Definition at line 126 of file LDAPRequest.cpp.

                               {
    DEBUG(LDAP_DEBUG_TRACE,"LDAPRequest::isCycle()" << endl);
    const LDAPRequest* parent=m_parent;
    if(parent != 0){
        do{
            if(this->equals(parent)){
                return true;
            }else{
                parent=parent->getParent();
            }
        }
        while(parent != 0);
    }
    return false;
}

Here is the call graph for this function:

Here is the caller graph for this function:

bool LDAPRequest::isReferral ( ) const
Returns:
true if this object was created during the automatic chasing of referrals. Otherwise false

Definition at line 111 of file LDAPRequest.cpp.

                                   {
    DEBUG(LDAP_DEBUG_TRACE,"LDAPRequest::isReferral()" << endl);
    return m_isReferral;
}

Here is the caller graph for this function:

virtual LDAPMessageQueue* LDAPRequest::sendRequest ( ) [pure virtual]

This method encodes the request an calls the apprpriate functions of the C-API to send the Request to a LDAP-Server.

Implemented in LDAPSaslInteractiveBind, LDAPSaslBindRequest, LDAPSearchRequest, LDAPBindRequest, LDAPModifyRequest, LDAPAddRequest, LDAPModDNRequest, LDAPCompareRequest, LDAPDeleteRequest, and LDAPExtRequest.

Here is the caller graph for this function:

Definition at line 142 of file LDAPRequest.cpp.

                              {
    DEBUG(LDAP_DEBUG_TRACE,"LDAPRequest::unbind()" << endl);
    m_connection->unbind();
}

Here is the caller graph for this function:


Member Data Documentation

const int LDAPRequest::ADD = 8 [static]

Definition at line 32 of file LDAPRequest.h.

const int LDAPRequest::BIND = 0 [static]

Definition at line 28 of file LDAPRequest.h.

Definition at line 34 of file LDAPRequest.h.

const int LDAPRequest::DELETE = 10 [static]

Definition at line 33 of file LDAPRequest.h.

Definition at line 82 of file LDAPRequest.h.

Definition at line 81 of file LDAPRequest.h.

Definition at line 84 of file LDAPRequest.h.

bool LDAPRequest::m_isReferral [protected]

Definition at line 79 of file LDAPRequest.h.

Definition at line 85 of file LDAPRequest.h.

Definition at line 83 of file LDAPRequest.h.

Definition at line 80 of file LDAPRequest.h.

Definition at line 31 of file LDAPRequest.h.

Definition at line 30 of file LDAPRequest.h.

Definition at line 29 of file LDAPRequest.h.


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