]> git.sur5r.net Git - openldap/blob - contrib/ldapc++/src/LDAPRequest.h
- removed char* in favour of string
[openldap] / contrib / ldapc++ / src / LDAPRequest.h
1 /*
2  * Copyright 2000, OpenLDAP Foundation, All Rights Reserved.
3  * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
4  */
5
6
7 #ifndef LDAP_REQUEST_H
8 #define LDAP_REQUEST_H
9
10 #include "LDAPConstraints.h"
11 #include "LDAPAsynConnection.h"
12 #include "LDAPMessageQueue.h"
13
14 class LDAPUrl;
15
16 //!virtual class for Requests
17 class LDAPRequest{
18
19     public :
20         static const int BIND=0;
21         static const int UNBIND=2;
22         static const int SEARCH=3;
23         static const int MODIFY=7;
24         static const int ADD=8;
25                 static const int DELETE=10;
26         static const int COMPARE=14;
27
28         LDAPRequest(const LDAPRequest& req);
29         LDAPRequest(LDAPAsynConnection* conn, 
30                 const LDAPConstraints* cons, bool isReferral=false,
31                 const LDAPRequest* parent=0);
32         virtual ~LDAPRequest();
33         
34         const LDAPConstraints* getConstraints() const;
35         const LDAPAsynConnection* getConnection() const;
36         int getType()const;
37         int getMsgID() const;
38         int getHopCount() const;
39         const LDAPRequest* getParent() const;
40
41         bool isReferral() const;
42         void unbind() const; 
43         virtual LDAPMessageQueue* sendRequest()=0;
44         virtual LDAPRequest* followReferral(LDAPMsg* ref)=0;
45         virtual bool equals(const LDAPRequest* req) const;
46         bool isCycle() const;
47         
48     protected :
49         bool m_isReferral;
50         int m_requestType;
51         LDAPConstraints *m_cons;
52         LDAPAsynConnection *m_connection;
53         const LDAPRequest* m_parent;
54         int m_hopCount;
55         int m_msgID;  //the associated C-API Message ID
56         LDAPRequest();
57 };
58 #endif //LDAP_REQUEST_H 
59