ldapsdk  0.0.1
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | List of all members
LDAPMsg Class Reference

This class represents any type of LDAP- Message returned from the server. More...

#include <LDAPMessage.h>

Inheritance diagram for LDAPMsg:
LDAPResult LDAPSearchReference LDAPSearchResult LDAPExtResult LDAPSaslBindResult

Public Member Functions

virtual ~LDAPMsg ()
 The destructor has no implemenation, because this is an abstract class. More...
 
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. More...
 

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 Member Functions

 LDAPMsg (LDAPMessage *msg)
 This constructor make a copy of a LDAPMsg-pointer. More...
 
 LDAPMsg (int msgType, int msgID)
 

Protected Attributes

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

Detailed Description

This class represents any type of LDAP- Message returned from the server.

This class is never not instantiated directly. Only its subclasses are used. The main feature of this class is the static method create() (see below)

Constructor & Destructor Documentation

◆ ~LDAPMsg()

virtual LDAPMsg::~LDAPMsg ( )
inlinevirtual

The destructor has no implemenation, because this is an abstract class.

◆ LDAPMsg() [1/2]

LDAPMsg::LDAPMsg ( LDAPMessage *  msg)
protected

This constructor make a copy of a LDAPMsg-pointer.

The object itself (no the pointer) is copied. Only for internal use.

References DEBUG, and LDAP_DEBUG_CONSTRUCT.

◆ LDAPMsg() [2/2]

LDAPMsg::LDAPMsg ( int  msgType,
int  msgID = 0 
)
protected

References DEBUG, and LDAP_DEBUG_CONSTRUCT.

Member Function Documentation

◆ create()

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

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.

References DEBUG, and LDAP_DEBUG_TRACE.

Referenced by LDAPRequest::getNextMessage().

◆ getMessageType()

int LDAPMsg::getMessageType ( )
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

References DEBUG, and LDAP_DEBUG_TRACE.

Referenced by LDAPSearchRequest::followReferral(), LDAPMessageQueue::getNext(), and LDAPSearchResults::readMessageQueue().

◆ getMsgID()

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

References DEBUG, and LDAP_DEBUG_TRACE.

◆ getSrvControls()

const LDAPControlSet & LDAPMsg::getSrvControls ( ) const
Returns
Server controls that were sent back by the server.
Note
This feature is not test well yet.

◆ hasControls()

bool LDAPMsg::hasControls ( ) const
Returns
If any Control was sent back by the server this method returns true. Otherwise false is returned.

Member Data Documentation

◆ ABANDON_REQUEST

const int LDAPMsg::ABANDON_REQUEST =LDAP_REQ_ABANDON
static

◆ ADD_REQUEST

const int LDAPMsg::ADD_REQUEST =LDAP_REQ_ADD
static

◆ ADD_RESPONSE

const int LDAPMsg::ADD_RESPONSE =LDAP_RES_ADD
static

◆ BIND_REQUEST

const int LDAPMsg::BIND_REQUEST =LDAP_REQ_BIND
static

◆ BIND_RESPONSE

const int LDAPMsg::BIND_RESPONSE =LDAP_RES_BIND
static

◆ COMPARE_REQUEST

const int LDAPMsg::COMPARE_REQUEST =LDAP_REQ_COMPARE
static

◆ COMPARE_RESPONSE

const int LDAPMsg::COMPARE_RESPONSE =LDAP_RES_COMPARE
static

◆ DEL_RESPONSE

const int LDAPMsg::DEL_RESPONSE =LDAP_RES_DELETE
static

◆ DELETE_REQUEST

const int LDAPMsg::DELETE_REQUEST =LDAP_REQ_DELETE
static

◆ EXTENDED_REQUEST

const int LDAPMsg::EXTENDED_REQUEST =LDAP_REQ_EXTENDED
static

◆ EXTENDED_RESPONSE

const int LDAPMsg::EXTENDED_RESPONSE =LDAP_RES_EXTENDED
static

◆ m_hasControls

bool LDAPMsg::m_hasControls
protected

◆ m_srvControls

LDAPControlSet LDAPMsg::m_srvControls
protected

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

Referenced by LDAPResult::LDAPResult(), LDAPSearchReference::LDAPSearchReference(), and LDAPSearchResult::LDAPSearchResult().

◆ MODDN_RESPONSE

const int LDAPMsg::MODDN_RESPONSE =LDAP_RES_MODDN
static

◆ MODIFY_REQUEST

const int LDAPMsg::MODIFY_REQUEST =LDAP_REQ_MODIFY
static

◆ MODIFY_RESPONSE

const int LDAPMsg::MODIFY_RESPONSE =LDAP_RES_MODIFY
static

◆ MODRDN_REQUEST

const int LDAPMsg::MODRDN_REQUEST =LDAP_REQ_MODRDN
static

◆ SEARCH_DONE

const int LDAPMsg::SEARCH_DONE =LDAP_RES_SEARCH_RESULT
static

◆ SEARCH_ENTRY

const int LDAPMsg::SEARCH_ENTRY =LDAP_RES_SEARCH_ENTRY
static

◆ SEARCH_REFERENCE

const int LDAPMsg::SEARCH_REFERENCE =LDAP_RES_SEARCH_REFERENCE
static

◆ SEARCH_REQUEST

const int LDAPMsg::SEARCH_REQUEST =LDAP_REQ_SEARCH
static

◆ UNBIND_REQUEST

const int LDAPMsg::UNBIND_REQUEST =LDAP_REQ_UNBIND
static

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