Back to index

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

#include <LDAPBindRequest.h>

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

List of all members.

Public Member Functions

 LDAPSaslBindRequest (const std::string &mech, const std::string &cred, LDAPAsynConnection *connect, const LDAPConstraints *cons, bool isReferral=false)
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 ~LDAPSaslBindRequest ()

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

Private Attributes

std::string m_mech
std::string m_cred
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 30 of file LDAPBindRequest.h.


Constructor & Destructor Documentation

LDAPSaslBindRequest::LDAPSaslBindRequest ( const std::string &  mech,
const std::string &  cred,
LDAPAsynConnection connect,
const LDAPConstraints cons,
bool  isReferral = false 
)

Definition at line 80 of file LDAPBindRequest.cpp.

                         : LDAPRequest(connect, cons, isReferral),m_mech(mech), m_cred(cred) {}

Definition at line 112 of file LDAPBindRequest.cpp.

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

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:

LDAPRequest * LDAPRequest::followReferral ( LDAPMsg ref) [virtual, inherited]

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:

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 86 of file LDAPBindRequest.cpp.

{
    DEBUG(LDAP_DEBUG_TRACE,"LDAPSaslBindRequest::sendRequest()" << endl);
    int msgID=0;
    
    BerValue tmpcred;
    tmpcred.bv_val = (char*) malloc( m_cred.size() * sizeof(char));
    m_cred.copy(tmpcred.bv_val,string::npos);
    tmpcred.bv_len = m_cred.size();
    
    LDAPControl** tmpSrvCtrls=m_cons->getSrvCtrlsArray();
    LDAPControl** tmpClCtrls=m_cons->getClCtrlsArray();
    int err=ldap_sasl_bind(m_connection->getSessionHandle(), "", m_mech.c_str(), 
            &tmpcred, tmpSrvCtrls, tmpClCtrls, &msgID);
    LDAPControlSet::freeLDAPControlArray(tmpSrvCtrls);
    LDAPControlSet::freeLDAPControlArray(tmpClCtrls);
    free(tmpcred.bv_val);

    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.

std::string LDAPSaslBindRequest::m_cred [private]

Definition at line 41 of file LDAPBindRequest.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.

std::string LDAPSaslBindRequest::m_mech [private]

Definition at line 40 of file LDAPBindRequest.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: