3 * Copyright 2000-2012 The OpenLDAP Foundation, All Rights Reserved.
4 * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
11 #include <LDAPConstraints.h>
12 #include <LDAPAsynConnection.h>
13 #include <LDAPMessageQueue.h>
18 * For internal use only
20 * Each request that is sent to a LDAP-server by this library is
21 * represented by a special object that contains the parameters and some
22 * other info of the request. This virtual class is the common base classe
23 * for these specialized request classes.
28 static const int BIND=0;
29 static const int UNBIND=2;
30 static const int SEARCH=3;
31 static const int MODIFY=7;
32 static const int ADD=8;
33 static const int DELETE=10;
34 static const int COMPARE=14;
36 LDAPRequest(const LDAPRequest& req);
37 LDAPRequest(LDAPAsynConnection* conn,
38 const LDAPConstraints* cons, bool isReferral=false,
39 const LDAPRequest* parent=0);
40 virtual ~LDAPRequest();
42 const LDAPConstraints* getConstraints() const;
43 const LDAPAsynConnection* getConnection() const;
44 virtual LDAPMsg *getNextMessage() const;
47 int getHopCount() const;
50 * @return The LDAPRequest that has created this object. Or 0 if
51 * this object was not created by another request.
53 const LDAPRequest* getParent() const;
56 * @return true if this object was created during the automatic
57 * chasing of referrals. Otherwise false
59 bool isReferral() const;
64 * This method encodes the request an calls the apprpriate
65 * functions of the C-API to send the Request to a LDAP-Server
67 virtual LDAPMessageQueue* sendRequest()=0;
68 virtual LDAPRequest* followReferral(LDAPMsg* ref);
71 * Compare this request with another on. And returns true if they
72 * have the same parameters.
74 virtual bool equals(const LDAPRequest* req) const;
81 LDAPConstraints *m_cons;
82 LDAPAsynConnection *m_connection;
83 const LDAPRequest* m_parent;
85 int m_msgID; //the associated C-API Message ID
88 #endif //LDAP_REQUEST_H