ldapsdk  0.0.1
LDAPMessage.h
Go to the documentation of this file.
1 // $OpenLDAP$
2 /*
3  * Copyright 2000-2011 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