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;
45 int getHopCount() const;
48 * @return The LDAPRequest that has created this object. Or 0 if
49 * this object was not created by another request.
51 const LDAPRequest* getParent() const;
54 * @return true if this object was created during the automatic
55 * chasing of referrals. Otherwise false
57 bool isReferral() const;
62 * This method encodes the request an calls the apprpriate
63 * functions of the C-API to send the Request to a LDAP-Server
65 virtual LDAPMessageQueue* sendRequest()=0;
66 virtual LDAPRequest* followReferral(LDAPMsg* ref)=0;
69 * Compare this request with another on. And returns true if they
70 * have the same parameters.
72 virtual bool equals(const LDAPRequest* req) const;
79 LDAPConstraints *m_cons;
80 LDAPAsynConnection *m_connection;
81 const LDAPRequest* m_parent;
83 int m_msgID; //the associated C-API Message ID
86 #endif //LDAP_REQUEST_H