iterates services in ServiceGroup, starting adaptation launchers More...
#include <Iterator.h>


Public Types | |
typedef CbcPointer< AsyncJob > | Pointer |
Public Member Functions | |
Iterator (Http::Message *virginHeader, HttpRequest *virginCause, AccessLogEntry::Pointer &alp, const Adaptation::ServiceGroupPointer &aGroup) | |
virtual | ~Iterator () |
void | noteInitiatorAborted () |
virtual void | noteAdaptationAnswer (const Answer &answer) |
void | initiator (const CbcPointer< Initiator > &i) |
sets initiator More... | |
bool | canBeCalled (AsyncCall &call) const |
whether we can be called More... | |
void | callStart (AsyncCall &call) |
virtual void | callEnd () |
called right after the called job method More... | |
virtual void | callException (const std::exception &e) |
called when the job throws during an async call More... | |
virtual void * | toCbdata ()=0 |
virtual void | noteAdaptationAclCheckDone (Adaptation::ServiceGroupPointer group) |
Static Public Member Functions | |
static Pointer | Start (AsyncJob *job) |
starts a freshly created job (i.e., makes the job asynchronous) More... | |
Protected Member Functions | |
virtual void | start () |
called by AsyncStart; do not call directly More... | |
virtual bool | doneAll () const |
whether positive goal has been reached More... | |
virtual void | swanSong () |
void | step () |
launches adaptation for the service selected by the plan More... | |
bool | updatePlan (bool adopt) |
replace the current group and plan with service-proposed ones if needed More... | |
ServiceFilter | filter () const |
creates service filter for the current step More... | |
void | handleAdaptedHeader (Http::Message *msg) |
void | handleAdaptationBlock (const Answer &answer) |
void | handleAdaptationError (bool final) |
void | sendAnswer (const Answer &answer) |
void | tellQueryAborted (bool final) |
void | clearInitiator () |
virtual const char * | status () const |
internal cleanup; do not call directly More... | |
void | deleteThis (const char *aReason) |
void | mustStop (const char *aReason) |
bool | done () const |
the job is destroyed in callEnd() when done() More... | |
CbcPointer< Initiate > | initiateAdaptation (Initiate *x) |
< starts freshly created initiate and returns a safe pointer to it More... | |
void | clearAdaptation (CbcPointer< Initiate > &x) |
clears the pointer (does not call announceInitiatorAbort) More... | |
void | announceInitiatorAbort (CbcPointer< Initiate > &x) |
inform the transaction about abnormal termination and clear the pointer More... | |
bool | initiated (const CbcPointer< AsyncJob > &job) const |
Must(initiated(initiate)) instead of Must(initiate.set()), for clarity. More... | |
Protected Attributes | |
ServiceGroupPointer | theGroup |
the service group we are iterating More... | |
ServicePlan | thePlan |
which services to use and in what order More... | |
Http::Message * | theMsg |
the message being adapted (virgin for each step) More... | |
HttpRequest * | theCause |
the cause of the original virgin message More... | |
AccessLogEntry::Pointer | al |
info for the future access.log entry More... | |
CbcPointer< Adaptation::Initiate > | theLauncher |
current transaction launcher More... | |
int | iterations |
number of steps initiated More... | |
bool | adapted |
whether the virgin message has been replaced More... | |
CbcPointer< Initiator > | theInitiator |
const char * | stopReason |
reason for forcing done() to be true More... | |
const char * | typeName |
kid (leaf) class name, for debugging More... | |
AsyncCall::Pointer | inCall |
the asynchronous call being handled, if any More... | |
const InstanceId< AsyncJob > | id |
job identifier More... | |
Private Member Functions | |
CBDATA_CLASS (Iterator) | |
Detailed Description
Definition at line 31 of file Iterator.h.
Member Typedef Documentation
◆ Pointer
|
inherited |
Definition at line 34 of file AsyncJob.h.
Constructor & Destructor Documentation
◆ Iterator()
Adaptation::Iterator::Iterator | ( | Http::Message * | virginHeader, |
HttpRequest * | virginCause, | ||
AccessLogEntry::Pointer & | alp, | ||
const Adaptation::ServiceGroupPointer & | aGroup | ||
) |
Definition at line 22 of file Iterator.cc.
References HTTPMSGLOCK(), NULL, theCause, and theMsg.
◆ ~Iterator()
|
virtual |
Definition at line 43 of file Iterator.cc.
References assert, and HTTPMSGUNLOCK().
Member Function Documentation
◆ announceInitiatorAbort()
|
protectedinherited |
Definition at line 38 of file Initiator.cc.
References CallJobHere.
Referenced by ClientHttpRequest::~ClientHttpRequest(), and Client::cleanAdaptation().
◆ callEnd()
|
virtualinherited |
called right after the called job method
Reimplemented in Adaptation::Icap::Xaction.
Definition at line 136 of file AsyncJob.cc.
References AsyncCall::debugLevel, debugs, AsyncCall::debugSection, AsyncJob::done(), HERE(), AsyncJob::inCall, NULL, AsyncJob::status(), AsyncJob::swanSong(), and AsyncJob::typeName.
Referenced by Adaptation::Icap::Xaction::callEnd(), and AsyncJob::deleteThis().
◆ callException()
|
virtualinherited |
Reimplemented in ClientHttpRequest, Ftp::Server, Ipc::Inquirer, Ipc::Forwarder, Adaptation::Icap::Xaction, Adaptation::Icap::ServiceRep, Adaptation::Icap::ModXact, and ConnStateData.
Definition at line 127 of file AsyncJob.cc.
References cbdataReferenceValid(), debugs, Must, AsyncJob::mustStop(), and CbdataParent::toCbdata().
Referenced by ConnStateData::callException(), Adaptation::Icap::Xaction::callException(), Ipc::Forwarder::callException(), Ipc::Inquirer::callException(), and Ftp::Server::callException().
◆ callStart()
|
inherited |
called just before the called method
Definition at line 114 of file AsyncJob.cc.
References cbdataReferenceValid(), AsyncCall::debugLevel, debugs, AsyncCall::debugSection, AsyncJob::inCall, Must, AsyncJob::status(), CbdataParent::toCbdata(), and AsyncJob::typeName.
◆ canBeCalled()
|
inherited |
Definition at line 101 of file AsyncJob.cc.
References AsyncCall::cancel(), debugs, HERE(), AsyncJob::inCall, and NULL.
◆ CBDATA_CLASS()
|
private |
◆ clearAdaptation()
|
protectedinherited |
Definition at line 32 of file Initiator.cc.
References CbcPointer< Cbc >::clear().
Referenced by ClientHttpRequest::handleAdaptedHeader(), ClientHttpRequest::noteAdaptationAnswer(), and Client::noteAdaptationAnswer().
◆ clearInitiator()
|
protectedinherited |
Definition at line 74 of file Initiate.cc.
◆ deleteThis()
|
protectedinherited |
Definition at line 49 of file AsyncJob.cc.
References asyncCall(), AsyncJob::callEnd(), debugs, AsyncJob::inCall, JobMemFun(), Must, NULL, AsyncJob::stopReason, and AsyncJob::typeName.
Referenced by ConnStateData::connStateClosed().
◆ done()
|
protectedinherited |
Definition at line 90 of file AsyncJob.cc.
References AsyncJob::doneAll(), NULL, and AsyncJob::stopReason.
Referenced by AsyncJob::callEnd(), HappyConnOpener::checkForNewConnection(), and Downloader::downloadFinished().
◆ doneAll()
|
protectedvirtual |
Reimplemented from AsyncJob.
Definition at line 210 of file Iterator.cc.
References AsyncJob::doneAll().
◆ filter()
|
protected |
Definition at line 266 of file Iterator.cc.
References method, Adaptation::methodNone, Adaptation::methodReqmod, Adaptation::methodRespmod, Must, and NULL.
◆ handleAdaptationBlock()
|
protected |
Definition at line 166 of file Iterator.cc.
◆ handleAdaptationError()
|
protected |
Definition at line 175 of file Iterator.cc.
References debugs, Adaptation::Answer::Forward(), HERE(), Must, and NULL.
◆ handleAdaptedHeader()
|
protected |
Definition at line 133 of file Iterator.cc.
References debugs, HERE(), HTTPMSGLOCK(), HTTPMSGUNLOCK(), and Must.
◆ initiateAdaptation()
|
protectedinherited |
Definition at line 23 of file Initiator.cc.
References Adaptation::Initiate::initiator(), and Ident::Start().
Referenced by ClientHttpRequest::startAdaptation(), and Client::startAdaptation().
◆ initiated()
|
inlineprotectedinherited |
Definition at line 52 of file Initiator.h.
References CbcPointer< Cbc >::set().
Referenced by ClientHttpRequest::startAdaptation(), and Client::startAdaptation().
◆ initiator()
|
inherited |
Definition at line 54 of file Initiate.cc.
References Must, and CbcPointer< Cbc >::valid().
Referenced by Adaptation::Initiator::initiateAdaptation().
◆ mustStop()
|
protectedinherited |
Definition at line 69 of file AsyncJob.cc.
References debugs, AsyncJob::inCall, Must, NULL, AsyncJob::stopReason, and AsyncJob::typeName.
Referenced by HttpStateData::abortAll(), AsyncJob::callException(), HttpStateData::continueAfterParsingHeader(), HttpStateData::drop1xx(), HttpStateData::handleMoreRequestBodyAvailable(), HttpStateData::httpStateConnClosed(), HttpStateData::httpTimeout(), Comm::ConnOpener::noteAbort(), HttpStateData::proceedAfter1xx(), ConnStateData::proxyProtocolError(), HttpStateData::readReply(), HttpStateData::start(), and HttpStateData::wroteLast().
◆ noteAdaptationAclCheckDone()
|
virtualinherited |
AccessCheck calls this back with a possibly nil service group to signal whether adaptation is needed and where it should start.
Reimplemented in Client, and ClientHttpRequest.
Definition at line 17 of file Initiator.cc.
References Must.
◆ noteAdaptationAnswer()
|
virtual |
called with the initial adaptation decision (adapt, block, error); virgin and/or adapted body transmission may continue after this
Implements Adaptation::Initiator.
Definition at line 115 of file Iterator.cc.
References Adaptation::Answer::akBlock, Adaptation::Answer::akError, Adaptation::Answer::akForward, Adaptation::Answer::final, RefCount< C >::getRaw(), Adaptation::Answer::kind, and Adaptation::Answer::message.
◆ noteInitiatorAborted()
|
virtual |
Implements Adaptation::Initiate.
Definition at line 159 of file Iterator.cc.
◆ sendAnswer()
|
protectedinherited |
Definition at line 79 of file Initiate.cc.
References Adaptation::Initiator::noteAdaptationAnswer(), and ScheduleCallHere.
◆ start()
|
protectedvirtual |
Reimplemented from AsyncJob.
Definition at line 50 of file Iterator.cc.
References Must, Adaptation::Config::needHistory, Adaptation::History::recordAdaptationService(), request(), AsyncJob::start(), and StringToSBuf().
◆ Start()
|
staticinherited |
Definition at line 23 of file AsyncJob.cc.
References CallJobHere, and AsyncJob::start().
Referenced by Ftp::Server::AcceptCtrlConnection(), Ftp::Server::checkDataConnPre(), clientListenerConnectionOpened(), Ftp::Client::connectDataChannel(), FwdState::connectStart(), Adaptation::Icap::Xaction::dnsLookupDone(), Log::TcpLogger::doConnect(), FwdState::establishTunnelThruProxy(), TunnelStateData::establishTunnelThruProxy(), Ipc::Coordinator::handleCacheMgrRequest(), PeerPoolMgr::handleOpenedConnection(), Ipc::Coordinator::handleSnmpRequest(), httpAccept(), httpsAccept(), httpStart(), idnsInitVC(), Ftp::Gateway::listenForDataChannel(), Ftp::Server::listenForDataConnection(), Adaptation::Icap::Xaction::noteCommConnected(), Log::TcpLogger::Open(), HappyConnOpener::openFreshConnection(), PeerPoolMgr::openNewConnection(), peerProbeConnect(), Mgr::FunAction::respond(), Mgr::InfoAction::respond(), FwdState::secureConnectionToPeer(), TunnelStateData::secureConnectionToPeer(), Ipc::SendMessage(), Mgr::Inquirer::sendResponse(), snmpConstructReponse(), SquidMain(), CacheManager::start(), Ident::Start(), Adaptation::AccessCheck::Start(), Rock::Rebuild::Start(), Security::PeerConnector::startCertDownloading(), TunnelStateData::startConnecting(), Ftp::StartGateway(), Ftp::StartRelay(), PeerPoolMgrsRr::syncConfig(), and Rock::SwapDir::updateHeaders().
◆ status()
|
protectedvirtualinherited |
for debugging, starts with space
Reimplemented from AsyncJob.
Reimplemented in Adaptation::Icap::Xaction, and Adaptation::Ecap::XactionRep.
Definition at line 92 of file Initiate.cc.
References AsyncJob::status().
◆ step()
|
protected |
Definition at line 71 of file Iterator.cc.
References assert, Adaptation::Service::cfg(), DBG_CRITICAL, debugs, Adaptation::Answer::Forward(), HERE(), Adaptation::ServiceConfig::key, Adaptation::Service::makeXactLauncher(), Must, Adaptation::Config::needHistory, NULL, Adaptation::History::recordAdaptationService(), request(), Adaptation::Config::service_iteration_limit, StringToSBuf(), and TexcHere.
◆ swanSong()
|
protectedvirtual |
Reimplemented from Adaptation::Initiate.
Definition at line 215 of file Iterator.cc.
References Adaptation::Initiate::swanSong().
◆ tellQueryAborted()
|
protectedinherited |
Definition at line 87 of file Initiate.cc.
References Adaptation::Answer::Error().
◆ toCbdata()
|
pure virtualinherited |
Implemented in HttpStateData, ClientHttpRequest, and BodySink.
Referenced by AsyncJob::callException(), and AsyncJob::callStart().
◆ updatePlan()
|
protected |
Definition at line 226 of file Iterator.cc.
References HttpRequest::adaptHistory(), debugs, Adaptation::DynamicGroupCfg::empty(), Adaptation::History::extractNextServices(), HERE(), Must, Adaptation::History::setFutureServices(), and Adaptation::DynamicServiceChain::Split().
Member Data Documentation
◆ adapted
|
protected |
Definition at line 73 of file Iterator.h.
◆ al
|
protected |
Definition at line 70 of file Iterator.h.
◆ id
|
protectedinherited |
Definition at line 72 of file AsyncJob.h.
◆ inCall
|
protectedinherited |
Definition at line 71 of file AsyncJob.h.
Referenced by AsyncJob::callEnd(), AsyncJob::callStart(), AsyncJob::canBeCalled(), AsyncJob::deleteThis(), and AsyncJob::mustStop().
◆ iterations
|
protected |
Definition at line 72 of file Iterator.h.
◆ stopReason
|
protectedinherited |
Definition at line 69 of file AsyncJob.h.
Referenced by AsyncJob::deleteThis(), AsyncJob::done(), AsyncJob::mustStop(), AsyncJob::status(), and HappyConnOpener::status().
◆ theCause
|
protected |
Definition at line 69 of file Iterator.h.
Referenced by Iterator().
◆ theGroup
|
protected |
Definition at line 66 of file Iterator.h.
◆ theInitiator
|
protectedinherited |
Definition at line 51 of file Initiate.h.
◆ theLauncher
|
protected |
Definition at line 71 of file Iterator.h.
◆ theMsg
|
protected |
Definition at line 68 of file Iterator.h.
Referenced by Iterator().
◆ thePlan
|
protected |
Definition at line 67 of file Iterator.h.
◆ typeName
|
protectedinherited |
Definition at line 70 of file AsyncJob.h.
Referenced by AsyncJob::AsyncJob(), Adaptation::Icap::Xaction::Xaction(), AsyncJob::~AsyncJob(), AsyncJob::callEnd(), AsyncJob::callStart(), AsyncJob::deleteThis(), and AsyncJob::mustStop().
The documentation for this class was generated from the following files:
- src/adaptation/Iterator.h
- src/adaptation/Iterator.cc