Back to index

openldap  2.4.31
LDAPRequest.h
Go to the documentation of this file.
00001 // $OpenLDAP$
00002 /*
00003  * Copyright 2000-2012 The OpenLDAP Foundation, All Rights Reserved.
00004  * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
00005  */
00006 
00007 
00008 #ifndef LDAP_REQUEST_H
00009 #define LDAP_REQUEST_H
00010 
00011 #include <LDAPConstraints.h>
00012 #include <LDAPAsynConnection.h>
00013 #include <LDAPMessageQueue.h>
00014 
00015 class LDAPUrl;
00016 
00025 class LDAPRequest{
00026 
00027     public :
00028         static const int BIND=0;
00029         static const int UNBIND=2;
00030         static const int SEARCH=3;
00031         static const int MODIFY=7;
00032         static const int ADD=8;
00033               static const int DELETE=10;
00034         static const int COMPARE=14;
00035 
00036         LDAPRequest(const LDAPRequest& req);
00037         LDAPRequest(LDAPAsynConnection* conn, 
00038                 const LDAPConstraints* cons, bool isReferral=false,
00039                 const LDAPRequest* parent=0);
00040         virtual ~LDAPRequest();
00041         
00042         const LDAPConstraints* getConstraints() const;
00043         const LDAPAsynConnection* getConnection() const;
00044         virtual LDAPMsg *getNextMessage() const;
00045         int getType()const;
00046         int getMsgID() const;
00047         int getHopCount() const;
00048 
00053         const LDAPRequest* getParent() const;
00054 
00059         bool isReferral() const;
00060         
00061         void unbind() const; 
00062 
00067         virtual LDAPMessageQueue* sendRequest()=0;
00068         virtual LDAPRequest* followReferral(LDAPMsg* ref);
00069 
00074         virtual bool equals(const LDAPRequest* req) const;
00075 
00076         bool isCycle() const;
00077         
00078     protected :
00079         bool m_isReferral;
00080         int m_requestType;
00081         LDAPConstraints *m_cons;
00082         LDAPAsynConnection *m_connection;
00083         const LDAPRequest* m_parent;
00084         int m_hopCount;
00085         int m_msgID;  //the associated C-API Message ID
00086         LDAPRequest();
00087 };
00088 #endif //LDAP_REQUEST_H 
00089