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
14class LDAPRequest;
23class 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
This container class is used to store multiple LDAPCtrl-objects.
Definition: LDAPControlSet.h:19
This class represents any type of LDAP- Message returned from the server.
Definition: LDAPMessage.h:23
static const int DELETE_REQUEST
Definition: LDAPMessage.h:42
LDAPControlSet m_srvControls
This attribute stores Server-Control that were returned with the message.
Definition: LDAPMessage.h:119
static const int MODDN_RESPONSE
Definition: LDAPMessage.h:33
static const int UNBIND_REQUEST
Definition: LDAPMessage.h:38
int getMessageType()
Definition: LDAPMessage.cpp:55
static const int SEARCH_REFERENCE
Definition: LDAPMessage.h:29
static const int ADD_REQUEST
Definition: LDAPMessage.h:41
static const int MODRDN_REQUEST
Definition: LDAPMessage.h:43
static const int BIND_RESPONSE
Definition: LDAPMessage.h:26
static const int EXTENDED_REQUEST
Definition: LDAPMessage.h:46
bool m_hasControls
Definition: LDAPMessage.h:121
virtual ~LDAPMsg()
The destructor has no implemenation, because this is an abstract class.
Definition: LDAPMessage.h:52
bool hasControls() const
Definition: LDAPMessage.cpp:65
static const int ABANDON_REQUEST
Definition: LDAPMessage.h:45
static const int COMPARE_RESPONSE
Definition: LDAPMessage.h:34
const LDAPControlSet & getSrvControls() const
Definition: LDAPMessage.cpp:69
static const int ADD_RESPONSE
Definition: LDAPMessage.h:31
static const int SEARCH_DONE
Definition: LDAPMessage.h:28
static const int MODIFY_RESPONSE
Definition: LDAPMessage.h:30
static const int MODIFY_REQUEST
Definition: LDAPMessage.h:40
static const int BIND_REQUEST
Definition: LDAPMessage.h:37
static const int EXTENDED_RESPONSE
Definition: LDAPMessage.h:35
int getMsgID()
Definition: LDAPMessage.cpp:60
static const int SEARCH_REQUEST
Definition: LDAPMessage.h:39
static const int COMPARE_REQUEST
Definition: LDAPMessage.h:44
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(LDAPMessage *msg)
This constructor make a copy of a LDAPMsg-pointer.
Definition: LDAPMessage.cpp:21
static const int DEL_RESPONSE
Definition: LDAPMessage.h:32
static const int SEARCH_ENTRY
Definition: LDAPMessage.h:27
For internal use only.
Definition: LDAPRequest.h:25