ldapsdk  0.0.1
LDAPMessage.h
Go to the documentation of this file.
1 // $OpenLDAP$
2 /*
3  * Copyright 2000-2013 The OpenLDAP Foundation, All Rights Reserved.
4  * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
5  */
6 
7 
8 #ifndef LDAP_MSG_H
9 #define LDAP_MSG_H
10 #include <ldap.h>
11 
12 #include <LDAPControlSet.h>
13 
14 class LDAPRequest;
23 class LDAPMsg{
24  public:
25  //public Constants defining the response message types
26  static const int BIND_RESPONSE=LDAP_RES_BIND;
27  static const int SEARCH_ENTRY=LDAP_RES_SEARCH_ENTRY;
28  static const int SEARCH_DONE=LDAP_RES_SEARCH_RESULT;
29  static const int SEARCH_REFERENCE=LDAP_RES_SEARCH_REFERENCE;
30  static const int MODIFY_RESPONSE=LDAP_RES_MODIFY;
31  static const int ADD_RESPONSE=LDAP_RES_ADD;
32  static const int DEL_RESPONSE=LDAP_RES_DELETE;
33  static const int MODDN_RESPONSE=LDAP_RES_MODDN;
34  static const int COMPARE_RESPONSE=LDAP_RES_COMPARE;
35  static const int EXTENDED_RESPONSE=LDAP_RES_EXTENDED;
36  //public Constants defining the request message types
37  static const int BIND_REQUEST=LDAP_REQ_BIND;
38  static const int UNBIND_REQUEST=LDAP_REQ_UNBIND;
39  static const int SEARCH_REQUEST=LDAP_REQ_SEARCH;
40  static const int MODIFY_REQUEST=LDAP_REQ_MODIFY;
41  static const int ADD_REQUEST=LDAP_REQ_ADD;
42  static const int DELETE_REQUEST=LDAP_REQ_DELETE;
43  static const int MODRDN_REQUEST=LDAP_REQ_MODRDN;
44  static const int COMPARE_REQUEST=LDAP_REQ_COMPARE;
45  static const int ABANDON_REQUEST=LDAP_REQ_ABANDON;
46  static const int EXTENDED_REQUEST=LDAP_REQ_EXTENDED;
47 
52  virtual ~LDAPMsg() {}
53 
70  static LDAPMsg* create(const LDAPRequest *req, LDAPMessage *msg);
71 
86  int getMessageType();
87 
92  int getMsgID();
93 
98  bool hasControls() const;
99 
104  const LDAPControlSet& getSrvControls() const;
105 
106  protected:
112  LDAPMsg(LDAPMessage *msg);
113  LDAPMsg(int msgType, int msgID);
114 
120 
122 
123  private:
124  int msgType;
125  int msgID;
126 };
127 #endif //ifndef LDAP_MSG_H
LDAPControlSet.h
LDAPSearchResult.h
LDAPMsg::COMPARE_REQUEST
static const int COMPARE_REQUEST
Definition: LDAPMessage.h:44
LDAP_DEBUG_TRACE
#define LDAP_DEBUG_TRACE
Definition: debug.h:12
LDAPMsg
This class represents any type of LDAP- Message returned from the server.
Definition: LDAPMessage.h:23
LDAPSaslBindResult
Object of this class are created by the LDAPMsg::create method if results for an Extended Operation w...
Definition: LDAPSaslBindResult.h:20
LDAPMsg::MODDN_RESPONSE
static const int MODDN_RESPONSE
Definition: LDAPMessage.h:33
LDAPExtResult
Object of this class are created by the LDAPMsg::create method if results for an Extended Operation w...
Definition: LDAPExtResult.h:20
LDAPMsg::getMsgID
int getMsgID()
Definition: LDAPMessage.cpp:60
LDAPMsg::DELETE_REQUEST
static const int DELETE_REQUEST
Definition: LDAPMessage.h:42
LDAPMsg::BIND_RESPONSE
static const int BIND_RESPONSE
Definition: LDAPMessage.h:26
LDAPMsg::ABANDON_REQUEST
static const int ABANDON_REQUEST
Definition: LDAPMessage.h:45
LDAPMsg::SEARCH_REQUEST
static const int SEARCH_REQUEST
Definition: LDAPMessage.h:39
LDAPMsg::m_srvControls
LDAPControlSet m_srvControls
This attribute stores Server-Control that were returned with the message.
Definition: LDAPMessage.h:119
LDAPMsg::SEARCH_ENTRY
static const int SEARCH_ENTRY
Definition: LDAPMessage.h:27
LDAPMsg::SEARCH_REFERENCE
static const int SEARCH_REFERENCE
Definition: LDAPMessage.h:29
LDAPMsg::~LDAPMsg
virtual ~LDAPMsg()
The destructor has no implemenation, because this is an abstract class.
Definition: LDAPMessage.h:52
LDAPMsg::DEL_RESPONSE
static const int DEL_RESPONSE
Definition: LDAPMessage.h:32
LDAPMsg::getMessageType
int getMessageType()
Definition: LDAPMessage.cpp:55
DEBUG
#define DEBUG(level, arg)
Definition: debug.h:30
LDAPSearchResult
This class is used to represent the result entries of a SEARCH-operation.
Definition: LDAPSearchResult.h:20
LDAPMessage.h
LDAPSearchReference
This class is used to represent Continuation References that were returned during a SEARCH-Operation.
Definition: LDAPSearchReference.h:21
LDAPMsg::SEARCH_DONE
static const int SEARCH_DONE
Definition: LDAPMessage.h:28
LDAPMsg::COMPARE_RESPONSE
static const int COMPARE_RESPONSE
Definition: LDAPMessage.h:34
LDAPMsg::MODIFY_RESPONSE
static const int MODIFY_RESPONSE
Definition: LDAPMessage.h:30
LDAPResult
This class is for representing LDAP-Result-Messages.
Definition: LDAPResult.h:30
LDAPMsg::MODRDN_REQUEST
static const int MODRDN_REQUEST
Definition: LDAPMessage.h:43
LDAPMsg::ADD_REQUEST
static const int ADD_REQUEST
Definition: LDAPMessage.h:41
LDAPMsg::EXTENDED_REQUEST
static const int EXTENDED_REQUEST
Definition: LDAPMessage.h:46
LDAPControlSet
This container class is used to store multiple LDAPCtrl-objects.
Definition: LDAPControlSet.h:19
LDAP_DEBUG_CONSTRUCT
#define LDAP_DEBUG_CONSTRUCT
Definition: debug.h:13
LDAPMsg::getSrvControls
const LDAPControlSet & getSrvControls() const
Definition: LDAPMessage.cpp:69
LDAPMsg::m_hasControls
bool m_hasControls
Definition: LDAPMessage.h:121
LDAPMsg::EXTENDED_RESPONSE
static const int EXTENDED_RESPONSE
Definition: LDAPMessage.h:35
LDAPMsg::ADD_RESPONSE
static const int ADD_RESPONSE
Definition: LDAPMessage.h:31
LDAPMsg::create
static LDAPMsg * create(const LDAPRequest *req, LDAPMessage *msg)
This method is used by the library to parse the results returned by the C-API.
Definition: LDAPMessage.cpp:34
LDAPMsg::BIND_REQUEST
static const int BIND_REQUEST
Definition: LDAPMessage.h:37
LDAPMsg::LDAPMsg
LDAPMsg(LDAPMessage *msg)
This constructor make a copy of a LDAPMsg-pointer.
Definition: LDAPMessage.cpp:21
LDAPExtResult.h
LDAPMsg::UNBIND_REQUEST
static const int UNBIND_REQUEST
Definition: LDAPMessage.h:38
LDAPMsg::hasControls
bool hasControls() const
Definition: LDAPMessage.cpp:65
LDAPSaslBindResult.h
LDAPMsg::MODIFY_REQUEST
static const int MODIFY_REQUEST
Definition: LDAPMessage.h:40
LDAPSearchReference.h
LDAPResult.h
LDAPRequest.h
LDAPRequest
For internal use only.
Definition: LDAPRequest.h:25
debug.h