2 * Copyright 2000, OpenLDAP Foundation, All Rights Reserved.
3 * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
8 #include "LDAPRequest.h"
10 LDAPRequest::LDAPRequest(){
11 DEBUG(LDAP_DEBUG_CONSTRUCT, "LDAPRequest::LDAPRequest()" << endl);
14 LDAPRequest::LDAPRequest(const LDAPRequest& req){
15 DEBUG(LDAP_DEBUG_CONSTRUCT, "LDAPRequest::LDAPRequest(&)" << endl);
16 m_isReferral=req.m_isReferral;
17 m_cons = new LDAPConstraints(*(req.m_cons));
18 m_connection = req.m_connection;
19 m_parent = req.m_parent;
20 m_hopCount = req.m_hopCount;
21 m_msgID = req.m_msgID;
24 LDAPRequest::LDAPRequest(LDAPAsynConnection* con,
25 const LDAPConstraints* cons,bool isReferral, const LDAPRequest* parent){
26 DEBUG(LDAP_DEBUG_CONSTRUCT,"LDAPRequest::LDAPRequest()" << endl);
29 m_cons=new LDAPConstraints( *(con->getConstraints()) );
31 m_cons=new LDAPConstraints( *cons);
33 m_isReferral=isReferral;
35 m_hopCount = (parent->getHopCount()+1);
43 LDAPRequest::~LDAPRequest(){
44 DEBUG(LDAP_DEBUG_DESTROY,"LDAPRequest::~LDAPRequest()" << endl);
48 const LDAPConstraints* LDAPRequest::getConstraints() const{
49 DEBUG(LDAP_DEBUG_TRACE,"LDAPRequest::getConstraints()" << endl);
53 const LDAPAsynConnection* LDAPRequest::getConnection() const{
54 DEBUG(LDAP_DEBUG_TRACE,"LDAPRequest::getConnection()" << endl);
58 int LDAPRequest::getType() const {
59 DEBUG(LDAP_DEBUG_TRACE,"LDAPRequest::getType()" << endl);
63 int LDAPRequest::getMsgID() const {
64 DEBUG(LDAP_DEBUG_TRACE,"LDAPRequest::getMsgId()" << endl);
68 int LDAPRequest::getHopCount() const {
69 DEBUG(LDAP_DEBUG_TRACE,"LDAPRequest::getHopCount()" << endl);
73 const LDAPRequest* LDAPRequest::getParent() const{
74 DEBUG(LDAP_DEBUG_TRACE,"LDAPRequest::getParent()" << endl);
78 bool LDAPRequest::isReferral() const {
79 DEBUG(LDAP_DEBUG_TRACE,"LDAPRequest::isReferral()" << endl);
83 bool LDAPRequest::equals(const LDAPRequest* req) const{
84 DEBUG(LDAP_DEBUG_TRACE,"LDAPRequest::equals()" << endl);
85 if( (this->m_requestType == req->getType()) &&
86 (this->m_connection->getHost() == req->m_connection->getHost()) &&
87 (this->m_connection->getPort() == req->m_connection->getPort())
93 bool LDAPRequest::isCycle() const{
94 DEBUG(LDAP_DEBUG_TRACE,"LDAPRequest::isCycle()" << endl);
95 const LDAPRequest* parent=m_parent;
98 if(this->equals(parent)){
101 parent=parent->getParent();
109 void LDAPRequest::unbind() const{
110 DEBUG(LDAP_DEBUG_TRACE,"LDAPRequest::unbind()" << endl);
111 m_connection->unbind();