Back to index

openldap  2.4.31
Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
LDAPAddRequest Class Reference

#include <LDAPAddRequest.h>

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

List of all members.

Public Member Functions

 LDAPAddRequest (const LDAPAddRequest &req)
 LDAPAddRequest (const LDAPEntry *entry, LDAPAsynConnection *connect, const LDAPConstraints *cons, bool isReferral=false, const LDAPRequest *parent=0)
virtual ~LDAPAddRequest ()
virtual LDAPMessageQueuesendRequest ()
 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 *refs)

Private Member Functions

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 bool equals (const LDAPRequest *req) const
 Compare this request with another on.
bool isCycle () const

Private Attributes

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

Static Private 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

Detailed Description

Definition at line 15 of file LDAPAddRequest.h.


Constructor & Destructor Documentation

Definition at line 20 of file LDAPAddRequest.cpp.

                                                        :
        LDAPRequest(req){
    DEBUG(LDAP_DEBUG_CONSTRUCT, "LDAPAddRequest::LDAPAddRequest(&)" << endl);
    m_entry=new LDAPEntry(*(req.m_entry));
}

Here is the caller graph for this function:

LDAPAddRequest::LDAPAddRequest ( const LDAPEntry entry,
LDAPAsynConnection connect,
const LDAPConstraints cons,
bool  isReferral = false,
const LDAPRequest parent = 0 
)

Definition at line 26 of file LDAPAddRequest.cpp.

        : LDAPRequest(connect, cons, isReferral,parent){
    DEBUG(LDAP_DEBUG_CONSTRUCT, "LDAPAddRequest::LDAPAddRequest()" << endl);
    DEBUG(LDAP_DEBUG_CONSTRUCT | LDAP_DEBUG_PARAMETER, 
            "   entry:" << entry << endl 
            << "   isReferral:" << isReferral << endl);
    m_requestType = LDAPRequest::ADD;
    m_entry = new LDAPEntry(*entry);
}

Definition at line 38 of file LDAPAddRequest.cpp.

                               {
    DEBUG(LDAP_DEBUG_DESTROY, "LDAPAddRequest::~LDAPAddRequest()" << endl);
    delete m_entry;
}

Member Function Documentation

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

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 from LDAPRequest.

Definition at line 63 of file LDAPAddRequest.cpp.

                                                       {
    DEBUG(LDAP_DEBUG_TRACE, "LDAPAddRequest::followReferral()"<< endl);
    LDAPUrlList::const_iterator usedUrl;
    LDAPUrlList urls = ((LDAPResult*)ref)->getReferralUrls();
    LDAPAsynConnection* con = 0;
    try {
        con = getConnection()->referralConnect(urls,usedUrl,m_cons);
    } catch(LDAPException e){
        delete con;
        return 0;
    }
    if(con != 0){
        return new LDAPAddRequest(m_entry, con, m_cons,true,this);
    }
    return 0;
}

Here is the call 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:

int LDAPRequest::getHopCount ( ) const [inherited]

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:

int LDAPRequest::getMsgID ( ) const [inherited]

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, inherited]

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:

const LDAPRequest * LDAPRequest::getParent ( ) const [inherited]
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:

int LDAPRequest::getType ( ) const [inherited]

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 [inherited]

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 [inherited]
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:

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

Implements LDAPRequest.

Definition at line 43 of file LDAPAddRequest.cpp.

                                             {
    DEBUG(LDAP_DEBUG_TRACE, "LDAPAddRequest::sendRequest()" << endl);
    int msgID=0;
    const LDAPAttributeList* list=m_entry->getAttributes();
    LDAPMod** attrs=list->toLDAPModArray();
    LDAPControl** tmpSrvCtrls = m_cons->getSrvCtrlsArray();
    LDAPControl** tmpClCtrls = m_cons->getClCtrlsArray();
    int err=ldap_add_ext(m_connection->getSessionHandle(),
            m_entry->getDN().c_str(),attrs,tmpSrvCtrls,tmpClCtrls,&msgID);
    LDAPControlSet::freeLDAPControlArray(tmpSrvCtrls);
    LDAPControlSet::freeLDAPControlArray(tmpClCtrls);
    ldap_mods_free(attrs,1);
    if(err != LDAP_SUCCESS){
        throw LDAPException(err);
    }else{
        m_msgID=msgID;
        return new LDAPMessageQueue(this);
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void LDAPRequest::unbind ( ) const [inherited]

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, inherited]

Definition at line 32 of file LDAPRequest.h.

const int LDAPRequest::BIND = 0 [static, inherited]

Definition at line 28 of file LDAPRequest.h.

const int LDAPRequest::COMPARE = 14 [static, inherited]

Definition at line 34 of file LDAPRequest.h.

const int LDAPRequest::DELETE = 10 [static, inherited]

Definition at line 33 of file LDAPRequest.h.

Definition at line 82 of file LDAPRequest.h.

LDAPConstraints* LDAPRequest::m_cons [protected, inherited]

Definition at line 81 of file LDAPRequest.h.

Definition at line 26 of file LDAPAddRequest.h.

int LDAPRequest::m_hopCount [protected, inherited]

Definition at line 84 of file LDAPRequest.h.

bool LDAPRequest::m_isReferral [protected, inherited]

Definition at line 79 of file LDAPRequest.h.

int LDAPRequest::m_msgID [protected, inherited]

Definition at line 85 of file LDAPRequest.h.

const LDAPRequest* LDAPRequest::m_parent [protected, inherited]

Definition at line 83 of file LDAPRequest.h.

int LDAPRequest::m_requestType [protected, inherited]

Definition at line 80 of file LDAPRequest.h.

const int LDAPRequest::MODIFY = 7 [static, inherited]

Definition at line 31 of file LDAPRequest.h.

const int LDAPRequest::SEARCH = 3 [static, inherited]

Definition at line 30 of file LDAPRequest.h.

const int LDAPRequest::UNBIND = 2 [static, inherited]

Definition at line 29 of file LDAPRequest.h.


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