Back to index

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

Object of this class are created by the LDAPMsg::create method if results for an Extended Operation were returned by a LDAP server. More...

#include <LDAPSaslBindResult.h>

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

List of all members.

Public Member Functions

 LDAPSaslBindResult (const LDAPRequest *req, LDAPMessage *msg)
 Constructor that creates an LDAPExtResult-object from the C-API structures.
virtual ~LDAPSaslBindResult ()
 The Destructor.
const std::string & getServerCreds () const
int getResultCode () const
std::string resToString () const
 This method transforms the result code to a human-readable result message.
const std::string & getErrMsg () const
 In some case of error the server may return addional error messages.
const std::string & getMatchedDN () const
 For messages with a result code of: NO_SUCH_OBJECT, ALIAS_PROBLEM, ALIAS_DEREFERENCING_PROBLEM or INVALID_DN_SYNTAX the server returns the DN of deepest entry in the DIT that could be found for this operation.
const LDAPUrlListgetReferralUrls () 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 SUCCESS = 0
static const int OPERATIONS_ERROR = 1
static const int PROTOCOL_ERROR = 2
static const int TIME_LIMIT_EXCEEDED = 3
static const int SIZE_LIMIT_EXCEEDED = 4
static const int COMPARE_FALSE = 5
static const int COMPARE_TRUE = 6
static const int AUTH_METHOD_NOT_SUPPORTED = 7
static const int STRONG_AUTH_REQUIRED = 8
static const int REFERRAL = 10
static const int ADMIN_LIMIT_EXCEEDED = 11
static const int UNAVAILABLE_CRITICAL_EXTENSION = 12
static const int CONFIDENTIALITY_REQUIRED = 13
static const int SASL_BIND_IN_PROGRESS = 14
static const int NO_SUCH_ATTRIBUTE = 16
static const int UNDEFINED_ATTRIBUTE_TYP = 17
static const int INAPPROPRIATE_MATCHING = 18
static const int CONSTRAINT_VIOLATION = 19
static const int ATTRIBUTE_OR_VALUE_EXISTS = 20
static const int INVALID_ATTRIBUTE_SYNTAX = 21
static const int NO_SUCH_OBJECT = 32
static const int ALIAS_PROBLEM = 33
static const int INVALID_DN_SYNTAX = 34
static const int ALIAS_DEREFERENCING_PROBLEM = 36
static const int INAPPROPRIATE_AUTENTICATION = 48
static const int INVALID_CREDENTIALS = 49
static const int INSUFFICIENT_ACCESS = 50
static const int BUSY = 51
static const int UNAVAILABLE = 52
static const int UNWILLING_TO_PERFORM = 53
static const int LOOP_DETECT = 54
static const int NAMING_VIOLATION = 64
static const int OBJECT_CLASS_VIOLATION = 65
static const int NOT_ALLOWED_ON_NONLEAF = 66
static const int NOT_ALLOWED_ON_RDN = 67
static const int ENTRY_ALREADY_EXISTS = 68
static const int OBJECT_CLASS_MODS_PROHIBITED = 69
static const int AFFECTS_MULTIPLE_DSAS = 71
static const int OTHER = 80
static const int SERVER_DOWN = 81
static const int LOCAL_ERROR = 82
static const int ENCODING_ERROR = 83
static const int DECODING_ERROR = 84
static const int TIMEOUT = 85
static const int AUTH_UNKNOWN = 86
static const int FILTER_ERROR = 87
static const int USER_CANCELLED = 88
static const int PARAM_ERROR = 89
static const int NO_MEMORY = 90
static const int CONNECT_ERROR = 91
static const int NOT_SUPPORTED = 92
static const int CONTROL_NOT_FOUND = 93
static const int NO_RESULTS_RETURNED = 94
static const int MORE_RESULTS_TO_RETURN = 95
static const int CLIENT_LOOP = 96
static const int REFERRAL_LIMIT_EXCEEDED = 97
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 Attributes

std::string m_creds

Detailed Description

Object of this class are created by the LDAPMsg::create method if results for an Extended Operation were returned by a LDAP server.

Definition at line 20 of file LDAPSaslBindResult.h.


Constructor & Destructor Documentation

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

Constructor that creates an LDAPExtResult-object from the C-API structures.

Definition at line 17 of file LDAPSaslBindResult.cpp.

                                                                               :
        LDAPResult(req, msg){
    DEBUG(LDAP_DEBUG_CONSTRUCT,"LDAPSaslBindResult::LDAPSaslBindResult()" 
            << std::endl);
    BerValue* data = 0;
    LDAP* lc = req->getConnection()->getSessionHandle();
    int err = ldap_parse_sasl_bind_result(lc, msg, &data, 0);
    if( err != LDAP_SUCCESS && err != LDAP_SASL_BIND_IN_PROGRESS ){
        ber_bvfree(data);
        throw LDAPException(err);
    }else{
        if(data){
            DEBUG(LDAP_DEBUG_TRACE, "   creds present" << std::endl);
            m_creds=string(data->bv_val, data->bv_len);
            ber_bvfree(data);
        } else {
            DEBUG(LDAP_DEBUG_TRACE, "   no creds present" << std::endl);
        }
    }
}

Here is the call graph for this function:

The Destructor.

Definition at line 38 of file LDAPSaslBindResult.cpp.

                                       {
    DEBUG(LDAP_DEBUG_DESTROY,"LDAPSaslBindResult::~LDAPSaslBindResult()" << 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:

const string & LDAPResult::getErrMsg ( ) const [inherited]

In some case of error the server may return addional error messages.

Returns:
The additional error message returned by the server.

Definition at line 76 of file LDAPResult.cpp.

                                         {
    DEBUG(LDAP_DEBUG_TRACE,"LDAPResult::getErrMsg()" << endl);
    return m_errMsg;
}

Here is the caller graph for this function:

const string & LDAPResult::getMatchedDN ( ) const [inherited]

For messages with a result code of: NO_SUCH_OBJECT, ALIAS_PROBLEM, ALIAS_DEREFERENCING_PROBLEM or INVALID_DN_SYNTAX the server returns the DN of deepest entry in the DIT that could be found for this operation.

Returns:
The Matched-DN value that was returned by the server.

Definition at line 81 of file LDAPResult.cpp.

                                            {
    DEBUG(LDAP_DEBUG_TRACE,"LDAPResult::getMatchedDN()" << endl);
    return m_matchedDN;
}
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;
}
Returns:
If the result code is REFERRAL this methode returns the URLs of the referral that was sent by the server.

Definition at line 86 of file LDAPResult.cpp.

                                                    {
    DEBUG(LDAP_DEBUG_TRACE,"LDAPResult::getReferralUrl()" << endl);
    return m_referrals;
}

Here is the caller graph for this function:

int LDAPResult::getResultCode ( ) const [inherited]
Returns:
The result code of the Message. Possible values are the integer constants defined in this class.

Definition at line 66 of file LDAPResult.cpp.

                                   {
    DEBUG(LDAP_DEBUG_TRACE,"LDAPResult::getResultCode()" << endl);
    return m_resCode;
}

Here is the caller graph for this function:

Returns:
If the result contained data this method will return the data to the caller as a std::string.

Definition at line 42 of file LDAPSaslBindResult.cpp.

                                                      {
    return m_creds;
}
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;
}
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;
}
string LDAPResult::resToString ( ) const [inherited]

This method transforms the result code to a human-readable result message.

Returns:
A std::string containing the result message.

Definition at line 71 of file LDAPResult.cpp.

                                    {
    DEBUG(LDAP_DEBUG_TRACE,"LDAPResult::resToString()" << endl);
    return string(ldap_err2string(m_resCode));
}

Here is the call graph for this function:


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.

const int LDAPResult::ADMIN_LIMIT_EXCEEDED = 11 [static, inherited]

Definition at line 44 of file LDAPResult.h.

const int LDAPResult::AFFECTS_MULTIPLE_DSAS = 71 [static, inherited]

Definition at line 77 of file LDAPResult.h.

Definition at line 60 of file LDAPResult.h.

const int LDAPResult::ALIAS_PROBLEM = 33 [static, inherited]

Definition at line 57 of file LDAPResult.h.

Definition at line 53 of file LDAPResult.h.

Definition at line 40 of file LDAPResult.h.

const int LDAPResult::AUTH_UNKNOWN = 86 [static, inherited]

Definition at line 86 of file LDAPResult.h.

Definition at line 37 of file LDAPMessage.h.

Definition at line 26 of file LDAPMessage.h.

const int LDAPResult::BUSY = 51 [static, inherited]

Definition at line 65 of file LDAPResult.h.

const int LDAPResult::CLIENT_LOOP = 96 [static, inherited]

Definition at line 96 of file LDAPResult.h.

const int LDAPResult::COMPARE_FALSE = 5 [static, inherited]

Definition at line 38 of file LDAPResult.h.

Definition at line 44 of file LDAPMessage.h.

Definition at line 34 of file LDAPMessage.h.

const int LDAPResult::COMPARE_TRUE = 6 [static, inherited]

Definition at line 39 of file LDAPResult.h.

Definition at line 46 of file LDAPResult.h.

const int LDAPResult::CONNECT_ERROR = 91 [static, inherited]

Definition at line 91 of file LDAPResult.h.

const int LDAPResult::CONSTRAINT_VIOLATION = 19 [static, inherited]

Definition at line 52 of file LDAPResult.h.

const int LDAPResult::CONTROL_NOT_FOUND = 93 [static, inherited]

Definition at line 93 of file LDAPResult.h.

const int LDAPResult::DECODING_ERROR = 84 [static, inherited]

Definition at line 84 of file LDAPResult.h.

Definition at line 32 of file LDAPMessage.h.

Definition at line 42 of file LDAPMessage.h.

const int LDAPResult::ENCODING_ERROR = 83 [static, inherited]

Definition at line 83 of file LDAPResult.h.

const int LDAPResult::ENTRY_ALREADY_EXISTS = 68 [static, inherited]

Definition at line 74 of file LDAPResult.h.

Definition at line 46 of file LDAPMessage.h.

Definition at line 35 of file LDAPMessage.h.

const int LDAPResult::FILTER_ERROR = 87 [static, inherited]

Definition at line 87 of file LDAPResult.h.

Definition at line 62 of file LDAPResult.h.

const int LDAPResult::INAPPROPRIATE_MATCHING = 18 [static, inherited]

Definition at line 51 of file LDAPResult.h.

const int LDAPResult::INSUFFICIENT_ACCESS = 50 [static, inherited]

Definition at line 64 of file LDAPResult.h.

Definition at line 54 of file LDAPResult.h.

const int LDAPResult::INVALID_CREDENTIALS = 49 [static, inherited]

Definition at line 63 of file LDAPResult.h.

const int LDAPResult::INVALID_DN_SYNTAX = 34 [static, inherited]

Definition at line 58 of file LDAPResult.h.

const int LDAPResult::LOCAL_ERROR = 82 [static, inherited]

Definition at line 82 of file LDAPResult.h.

const int LDAPResult::LOOP_DETECT = 54 [static, inherited]

Definition at line 68 of file LDAPResult.h.

std::string LDAPSaslBindResult::m_creds [private]

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

const int LDAPResult::MORE_RESULTS_TO_RETURN = 95 [static, inherited]

Definition at line 95 of file LDAPResult.h.

const int LDAPResult::NAMING_VIOLATION = 64 [static, inherited]

Definition at line 70 of file LDAPResult.h.

const int LDAPResult::NO_MEMORY = 90 [static, inherited]

Definition at line 90 of file LDAPResult.h.

const int LDAPResult::NO_RESULTS_RETURNED = 94 [static, inherited]

Definition at line 94 of file LDAPResult.h.

const int LDAPResult::NO_SUCH_ATTRIBUTE = 16 [static, inherited]

Definition at line 49 of file LDAPResult.h.

const int LDAPResult::NO_SUCH_OBJECT = 32 [static, inherited]

Definition at line 56 of file LDAPResult.h.

const int LDAPResult::NOT_ALLOWED_ON_NONLEAF = 66 [static, inherited]

Definition at line 72 of file LDAPResult.h.

const int LDAPResult::NOT_ALLOWED_ON_RDN = 67 [static, inherited]

Definition at line 73 of file LDAPResult.h.

const int LDAPResult::NOT_SUPPORTED = 92 [static, inherited]

Definition at line 92 of file LDAPResult.h.

Definition at line 75 of file LDAPResult.h.

const int LDAPResult::OBJECT_CLASS_VIOLATION = 65 [static, inherited]

Definition at line 71 of file LDAPResult.h.

const int LDAPResult::OPERATIONS_ERROR = 1 [static, inherited]

Definition at line 34 of file LDAPResult.h.

const int LDAPResult::OTHER = 80 [static, inherited]

Definition at line 80 of file LDAPResult.h.

const int LDAPResult::PARAM_ERROR = 89 [static, inherited]

Definition at line 89 of file LDAPResult.h.

const int LDAPResult::PROTOCOL_ERROR = 2 [static, inherited]

Definition at line 35 of file LDAPResult.h.

const int LDAPResult::REFERRAL = 10 [static, inherited]

Definition at line 43 of file LDAPResult.h.

const int LDAPResult::REFERRAL_LIMIT_EXCEEDED = 97 [static, inherited]

Definition at line 97 of file LDAPResult.h.

const int LDAPResult::SASL_BIND_IN_PROGRESS = 14 [static, inherited]

Definition at line 47 of file LDAPResult.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.

const int LDAPResult::SERVER_DOWN = 81 [static, inherited]

Definition at line 81 of file LDAPResult.h.

const int LDAPResult::SIZE_LIMIT_EXCEEDED = 4 [static, inherited]

Definition at line 37 of file LDAPResult.h.

const int LDAPResult::STRONG_AUTH_REQUIRED = 8 [static, inherited]

Definition at line 41 of file LDAPResult.h.

const int LDAPResult::SUCCESS = 0 [static, inherited]

Definition at line 33 of file LDAPResult.h.

const int LDAPResult::TIME_LIMIT_EXCEEDED = 3 [static, inherited]

Definition at line 36 of file LDAPResult.h.

const int LDAPResult::TIMEOUT = 85 [static, inherited]

Definition at line 85 of file LDAPResult.h.

const int LDAPResult::UNAVAILABLE = 52 [static, inherited]

Definition at line 66 of file LDAPResult.h.

Definition at line 45 of file LDAPResult.h.

Definition at line 38 of file LDAPMessage.h.

const int LDAPResult::UNDEFINED_ATTRIBUTE_TYP = 17 [static, inherited]

Definition at line 50 of file LDAPResult.h.

const int LDAPResult::UNWILLING_TO_PERFORM = 53 [static, inherited]

Definition at line 67 of file LDAPResult.h.

const int LDAPResult::USER_CANCELLED = 88 [static, inherited]

Definition at line 88 of file LDAPResult.h.


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