2 * Copyright 2000, OpenLDAP Foundation, All Rights Reserved.
3 * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
8 #include "LDAPRequest.h"
12 LDAPRequest::LDAPRequest(){
13 DEBUG(LDAP_DEBUG_CONSTRUCT, "LDAPRequest::LDAPRequest()" << endl);
16 LDAPRequest::LDAPRequest(const LDAPRequest& req){
17 DEBUG(LDAP_DEBUG_CONSTRUCT, "LDAPRequest::LDAPRequest(&)" << endl);
18 m_isReferral=req.m_isReferral;
19 m_cons = new LDAPConstraints(*(req.m_cons));
20 m_connection = req.m_connection;
21 m_parent = req.m_parent;
22 m_hopCount = req.m_hopCount;
23 m_msgID = req.m_msgID;
26 LDAPRequest::LDAPRequest(LDAPAsynConnection* con,
27 const LDAPConstraints* cons,bool isReferral, const LDAPRequest* parent){
28 DEBUG(LDAP_DEBUG_CONSTRUCT,"LDAPRequest::LDAPRequest()" << endl);
31 m_cons=new LDAPConstraints( *(con->getConstraints()) );
33 m_cons=new LDAPConstraints( *cons);
35 m_isReferral=isReferral;
37 m_hopCount = (parent->getHopCount()+1);
45 LDAPRequest::~LDAPRequest(){
46 DEBUG(LDAP_DEBUG_DESTROY,"LDAPRequest::~LDAPRequest()" << endl);
50 const LDAPConstraints* LDAPRequest::getConstraints() const{
51 DEBUG(LDAP_DEBUG_TRACE,"LDAPRequest::getConstraints()" << endl);
55 const LDAPAsynConnection* LDAPRequest::getConnection() const{
56 DEBUG(LDAP_DEBUG_TRACE,"LDAPRequest::getConnection()" << endl);
60 int LDAPRequest::getType() const {
61 DEBUG(LDAP_DEBUG_TRACE,"LDAPRequest::getType()" << endl);
65 int LDAPRequest::getMsgID() const {
66 DEBUG(LDAP_DEBUG_TRACE,"LDAPRequest::getMsgId()" << endl);
70 int LDAPRequest::getHopCount() const {
71 DEBUG(LDAP_DEBUG_TRACE,"LDAPRequest::getHopCount()" << endl);
75 const LDAPRequest* LDAPRequest::getParent() const{
76 DEBUG(LDAP_DEBUG_TRACE,"LDAPRequest::getParent()" << endl);
80 bool LDAPRequest::isReferral() const {
81 DEBUG(LDAP_DEBUG_TRACE,"LDAPRequest::isReferral()" << endl);
85 bool LDAPRequest::equals(const LDAPRequest* req) const{
86 DEBUG(LDAP_DEBUG_TRACE,"LDAPRequest::equals()" << endl);
87 if( (this->m_requestType == req->getType()) &&
88 (this->m_connection->getHost() == req->m_connection->getHost()) &&
89 (this->m_connection->getPort() == req->m_connection->getPort())
95 bool LDAPRequest::isCycle() const{
96 DEBUG(LDAP_DEBUG_TRACE,"LDAPRequest::isCycle()" << endl);
97 const LDAPRequest* parent=m_parent;
100 if(this->equals(parent)){
103 parent=parent->getParent();
111 void LDAPRequest::unbind() const{
112 DEBUG(LDAP_DEBUG_TRACE,"LDAPRequest::unbind()" << endl);
113 m_connection->unbind();