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