#include <XactionRep.h>

Inheritance diagram for Adaptation::Ecap::XactionRep:
Collaboration diagram for Adaptation::Ecap::XactionRep:

Public Types

typedef libecap::shared_ptr< libecap::adapter::Xaction > AdapterXaction
 
typedef CbcPointer< AsyncJobPointer
 
typedef CbcPointer< BodyConsumerPointer
 
typedef CbcPointer< BodyProducerPointer
 

Public Member Functions

 XactionRep (Http::Message *virginHeader, HttpRequest *virginCause, AccessLogEntry::Pointer &alp, const Adaptation::ServicePointer &service)
 
virtual ~XactionRep ()
 
void master (const AdapterXaction &aMaster)
 
virtual const libecap::Area option (const libecap::Name &name) const
 
virtual void visitEachOption (libecap::NamedValueVisitor &visitor) const
 
virtual libecap::Message & virgin ()
 
virtual const libecap::Message & cause ()
 
virtual libecap::Message & adapted ()
 
virtual void useVirgin ()
 
virtual void useAdapted (const libecap::shared_ptr< libecap::Message > &msg)
 
virtual void blockVirgin ()
 
virtual void adaptationDelayed (const libecap::Delay &)
 
virtual void adaptationAborted ()
 
virtual void resume ()
 
virtual void vbDiscard ()
 
virtual void vbMake ()
 
virtual void vbStopMaking ()
 
virtual void vbMakeMore ()
 
virtual libecap::Area vbContent (libecap::size_type offset, libecap::size_type size)
 
virtual void vbContentShift (libecap::size_type size)
 
virtual void noteAbContentDone (bool atEnd)
 
virtual void noteAbContentAvailable ()
 
virtual void noteMoreBodySpaceAvailable (RefCount< BodyPipe > bp)
 
virtual void noteBodyConsumerAborted (RefCount< BodyPipe > bp)
 
virtual void noteMoreBodyDataAvailable (RefCount< BodyPipe > bp)
 
virtual void noteBodyProductionEnded (RefCount< BodyPipe > bp)
 
virtual void noteBodyProducerAborted (RefCount< BodyPipe > bp)
 
virtual void noteInitiatorAborted ()
 
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 ()
 
virtual const char * status () const
 internal cleanup; do not call directly More...
 
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
 

Static Public Member Functions

static Pointer Start (AsyncJob *job)
 starts a freshly created job (i.e., makes the job asynchronous) More...
 

Protected Member Functions

Serviceservice ()
 
Adaptation::Messageanswer ()
 
void sinkVb (const char *reason)
 
void preserveVb (const char *reason)
 
void forgetVb (const char *reason)
 
void moveAbContent ()
 
void updateHistory (Http::Message *adapted)
 
void terminateMaster ()
 
void scheduleStop (const char *reason)
 
void updateSources (Http::Message *adapted)
 
const libecap::Area clientIpValue () const
 
const libecap::Area usernameValue () const
 
const libecap::Area masterxSharedValue (const libecap::Name &name) const
 
const libecap::Area metaValue (const libecap::Name &name) const
 Return the adaptation meta header value for the given header "name". More...
 
void visitEachMetaHeader (libecap::NamedValueVisitor &visitor) const
 Return the adaptation meta headers and their values. More...
 
void doResume ()
 
void sendAnswer (const Answer &answer)
 
void tellQueryAborted (bool final)
 
void clearInitiator ()
 
void deleteThis (const char *aReason)
 
void mustStop (const char *aReason)
 
bool done () const
 the job is destroyed in callEnd() when done() More...
 
void stopConsumingFrom (RefCount< BodyPipe > &)
 
void stopProducingFor (RefCount< BodyPipe > &, bool atEof)
 

Protected Attributes

CbcPointer< InitiatortheInitiator
 
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< AsyncJobid
 job identifier More...
 

Private Types

enum  OperationState {
  opUndecided,
  opOn,
  opComplete,
  opNever
}
 
typedef libecap::shared_ptr< libecap::Message > MessagePtr
 

Private Member Functions

 CBDATA_CLASS (XactionRep)
 

Private Attributes

AdapterXaction theMaster
 
Adaptation::ServicePointer theService
 xaction's adaptation service More...
 
MessageRep theVirginRep
 
MessageReptheCauseRep
 
MessagePtr theAnswerRep
 
OperationState makingVb
 
OperationState proxyingAb
 
int adaptHistoryId
 adaptation history slot reservation More...
 
bool vbProductionFinished
 
bool abProductionFinished
 
bool abProductionAtEnd
 
AccessLogEntry::Pointer al
 Master transaction AccessLogEntry. More...
 

Detailed Description

Definition at line 32 of file XactionRep.h.

Member Typedef Documentation

◆ AdapterXaction

typedef libecap::shared_ptr<libecap::adapter::Xaction> Adaptation::Ecap::XactionRep::AdapterXaction

Definition at line 41 of file XactionRep.h.

◆ MessagePtr

typedef libecap::shared_ptr<libecap::Message> Adaptation::Ecap::XactionRep::MessagePtr
private

Definition at line 116 of file XactionRep.h.

◆ Pointer [1/3]

Definition at line 25 of file BodyPipe.h.

◆ Pointer [2/3]

Definition at line 34 of file AsyncJob.h.

◆ Pointer [3/3]

Definition at line 45 of file BodyPipe.h.

Member Enumeration Documentation

◆ OperationState

Enumerator
opUndecided 
opOn 
opComplete 
opNever 

Definition at line 119 of file XactionRep.h.

Constructor & Destructor Documentation

◆ XactionRep()

Adaptation::Ecap::XactionRep::XactionRep ( Http::Message virginHeader,
HttpRequest virginCause,
AccessLogEntry::Pointer alp,
const Adaptation::ServicePointer service 
)

Definition at line 48 of file XactionRep.cc.

References theCauseRep.

◆ ~XactionRep()

Adaptation::Ecap::XactionRep::~XactionRep ( )
virtual

Definition at line 65 of file XactionRep.cc.

References assert, theAnswerRep, theCauseRep, and theMaster.

Member Function Documentation

◆ adaptationAborted()

void Adaptation::Ecap::XactionRep::adaptationAborted ( )
virtual

◆ adaptationDelayed()

void Adaptation::Ecap::XactionRep::adaptationDelayed ( const libecap::Delay &  d)
virtual

Definition at line 614 of file XactionRep.cc.

References debugs, and HERE().

◆ adapted()

libecap::Message & Adaptation::Ecap::XactionRep::adapted ( )
virtual

Definition at line 319 of file XactionRep.cc.

References Must, and theAnswerRep.

◆ answer()

Adaptation::Message & Adaptation::Ecap::XactionRep::answer ( )
protected

◆ blockVirgin()

void Adaptation::Ecap::XactionRep::blockVirgin ( )
virtual

◆ callEnd()

void AsyncJob::callEnd ( )
virtualinherited

◆ callException()

◆ callStart()

void AsyncJob::callStart ( AsyncCall call)
inherited

◆ canBeCalled()

bool AsyncJob::canBeCalled ( AsyncCall call) const
inherited

Definition at line 101 of file AsyncJob.cc.

References AsyncCall::cancel(), debugs, HERE(), AsyncJob::inCall, and NULL.

Referenced by AsyncJob::swanSong().

◆ cause()

const libecap::Message & Adaptation::Ecap::XactionRep::cause ( )
virtual

Definition at line 312 of file XactionRep.cc.

References Must, NULL, and theCauseRep.

◆ CBDATA_CLASS()

Adaptation::Ecap::XactionRep::CBDATA_CLASS ( XactionRep  )
private

◆ clearInitiator()

◆ clientIpValue()

◆ deleteThis()

void AsyncJob::deleteThis ( const char *  aReason)
protectedinherited

◆ done()

◆ doneAll()

bool Adaptation::Ecap::XactionRep::doneAll ( ) const
virtual

Reimplemented from AsyncJob.

Definition at line 344 of file XactionRep.cc.

References AsyncJob::doneAll(), makingVb, opComplete, and proxyingAb.

◆ doResume()

void Adaptation::Ecap::XactionRep::doResume ( )
protected

the guts of libecap::host::Xaction::resume() API implementation which just goes async in Adaptation::Ecap::XactionRep::resume().

Definition at line 299 of file XactionRep.cc.

References Must, and theMaster.

Referenced by resume().

◆ forgetVb()

void Adaptation::Ecap::XactionRep::forgetVb ( const char *  reason)
protected

◆ initiator()

void Adaptation::Initiate::initiator ( const CbcPointer< Initiator > &  i)
inherited

◆ master()

void Adaptation::Ecap::XactionRep::master ( const AdapterXaction aMaster)

Definition at line 73 of file XactionRep.cc.

References Must, and theMaster.

◆ masterxSharedValue()

const libecap::Area Adaptation::Ecap::XactionRep::masterxSharedValue ( const libecap::Name &  name) const
protected

◆ metaValue()

const libecap::Area Adaptation::Ecap::XactionRep::metaValue ( const libecap::Name &  name) const
protected

◆ moveAbContent()

void Adaptation::Ecap::XactionRep::moveAbContent ( )
protected

◆ mustStop()

void AsyncJob::mustStop ( const char *  aReason)
protectedinherited

Definition at line 69 of file AsyncJob.cc.

References debugs, AsyncJob::inCall, Must, NULL, AsyncJob::stopReason, and AsyncJob::typeName.

Referenced by HttpStateData::abortAll(), Ftp::Client::abortAll(), Comm::TcpAcceptor::acceptOne(), adaptationAborted(), Adaptation::AccessCheck::callBack(), AsyncJob::callException(), Security::PeerConnector::connectionClosed(), HttpStateData::continueAfterParsingHeader(), Ftp::Client::ctrlClosed(), Adaptation::Iterator::handleAdaptationBlock(), Adaptation::Iterator::handleAdaptationError(), Log::TcpLogger::handleClosure(), Adaptation::Icap::Xaction::handleCommClosed(), Mgr::Forwarder::handleError(), Ipc::Forwarder::handleError(), Ipc::Forwarder::handleException(), Ipc::Inquirer::handleException(), HttpStateData::handleMoreRequestBodyAvailable(), Ipc::Inquirer::handleRemoteAck(), Ipc::Forwarder::handleTimeout(), HttpStateData::httpStateConnClosed(), HttpStateData::httpTimeout(), Comm::ConnOpener::noteAbort(), Adaptation::Icap::ModXact::noteBodyConsumerAborted(), Snmp::Forwarder::noteCommClosed(), Snmp::Inquirer::noteCommClosed(), Mgr::Inquirer::noteCommClosed(), Mgr::Forwarder::noteCommClosed(), Mgr::StoreToCommWriter::noteCommClosed(), Adaptation::Icap::Xaction::noteCommRead(), Rock::HeaderUpdater::noteDoneReading(), Adaptation::Iterator::noteInitiatorAborted(), Adaptation::Icap::Xaction::noteInitiatorAborted(), noteInitiatorAborted(), HttpStateData::readReply(), Comm::ConnOpener::sendAnswer(), Rock::Rebuild::start(), Security::PeerConnector::start(), HttpStateData::start(), Ipc::UdsSender::timedout(), and HttpStateData::wroteLast().

◆ noteAbContentAvailable()

void Adaptation::Ecap::XactionRep::noteAbContentAvailable ( )
virtual

◆ noteAbContentDone()

void Adaptation::Ecap::XactionRep::noteAbContentDone ( bool  atEnd)
virtual

◆ noteBodyConsumerAborted()

void Adaptation::Ecap::XactionRep::noteBodyConsumerAborted ( RefCount< BodyPipe bp)
virtual

Implements BodyProducer.

Definition at line 636 of file XactionRep.cc.

References answer(), Must, opComplete, opOn, proxyingAb, BodyProducer::stopProducingFor(), and theMaster.

◆ noteBodyProducerAborted()

void Adaptation::Ecap::XactionRep::noteBodyProducerAborted ( RefCount< BodyPipe bp)
virtual

Implements BodyConsumer.

Definition at line 663 of file XactionRep.cc.

References makingVb, Must, opOn, theMaster, and vbProductionFinished.

◆ noteBodyProductionEnded()

void Adaptation::Ecap::XactionRep::noteBodyProductionEnded ( RefCount< BodyPipe bp)
virtual

Implements BodyConsumer.

Definition at line 654 of file XactionRep.cc.

References makingVb, Must, opOn, theMaster, and vbProductionFinished.

◆ noteInitiatorAborted()

void Adaptation::Ecap::XactionRep::noteInitiatorAborted ( )
virtual

Implements Adaptation::Initiate.

Definition at line 672 of file XactionRep.cc.

References AsyncJob::mustStop().

◆ noteMoreBodyDataAvailable()

void Adaptation::Ecap::XactionRep::noteMoreBodyDataAvailable ( RefCount< BodyPipe bp)
virtual

Implements BodyConsumer.

Definition at line 646 of file XactionRep.cc.

References makingVb, Must, opOn, and theMaster.

◆ noteMoreBodySpaceAvailable()

void Adaptation::Ecap::XactionRep::noteMoreBodySpaceAvailable ( RefCount< BodyPipe bp)
virtual

Implements BodyProducer.

Definition at line 629 of file XactionRep.cc.

References moveAbContent(), Must, opOn, and proxyingAb.

◆ option()

const libecap::Area Adaptation::Ecap::XactionRep::option ( const libecap::Name &  name) const
virtual

◆ preserveVb()

void Adaptation::Ecap::XactionRep::preserveVb ( const char *  reason)
protected

◆ resume()

void Adaptation::Ecap::XactionRep::resume ( )
virtual

Definition at line 287 of file XactionRep.cc.

References asyncCall(), doResume(), and ScheduleCallHere.

◆ scheduleStop()

void Adaptation::Ecap::XactionRep::scheduleStop ( const char *  reason)
protected

◆ sendAnswer()

◆ service()

Adaptation::Service & Adaptation::Ecap::XactionRep::service ( )
protected

Definition at line 81 of file XactionRep.cc.

References Must, NULL, and theService.

Referenced by blockVirgin(), start(), updateHistory(), and updateSources().

◆ sinkVb()

void Adaptation::Ecap::XactionRep::sinkVb ( const char *  reason)
protected

◆ Start()

◆ start()

◆ status()

◆ stopConsumingFrom()

◆ stopProducingFor()

◆ swanSong()

◆ tellQueryAborted()

◆ terminateMaster()

void Adaptation::Ecap::XactionRep::terminateMaster ( )
protected

Definition at line 334 of file XactionRep.cc.

References theMaster.

Referenced by swanSong().

◆ toCbdata()

virtual void* CbdataParent::toCbdata ( )
pure virtualinherited

◆ updateHistory()

◆ updateSources()

◆ useAdapted()

void Adaptation::Ecap::XactionRep::useAdapted ( const libecap::shared_ptr< libecap::Message > &  msg)
virtual

◆ usernameValue()

const libecap::Area Adaptation::Ecap::XactionRep::usernameValue ( ) const
protected

◆ useVirgin()

◆ vbContent()

libecap::Area Adaptation::Ecap::XactionRep::vbContent ( libecap::size_type  offset,
libecap::size_type  size 
)
virtual

◆ vbContentShift()

void Adaptation::Ecap::XactionRep::vbContentShift ( libecap::size_type  size)
virtual

◆ vbDiscard()

void Adaptation::Ecap::XactionRep::vbDiscard ( )
virtual

Definition at line 510 of file XactionRep.cc.

References makingVb, Must, opNever, opUndecided, and sinkVb().

◆ vbMake()

void Adaptation::Ecap::XactionRep::vbMake ( )
virtual

◆ vbMakeMore()

◆ vbStopMaking()

void Adaptation::Ecap::XactionRep::vbStopMaking ( )
virtual

Definition at line 529 of file XactionRep.cc.

References makingVb, Must, opComplete, opOn, and sinkVb().

◆ virgin()

libecap::Message & Adaptation::Ecap::XactionRep::virgin ( )
virtual

Definition at line 306 of file XactionRep.cc.

References theVirginRep.

◆ visitEachMetaHeader()

void Adaptation::Ecap::XactionRep::visitEachMetaHeader ( libecap::NamedValueVisitor &  visitor) const
protected

◆ visitEachOption()

void Adaptation::Ecap::XactionRep::visitEachOption ( libecap::NamedValueVisitor &  visitor) const
virtual

Member Data Documentation

◆ abProductionAtEnd

bool Adaptation::Ecap::XactionRep::abProductionAtEnd
private

Definition at line 125 of file XactionRep.h.

Referenced by moveAbContent(), and noteAbContentDone().

◆ abProductionFinished

bool Adaptation::Ecap::XactionRep::abProductionFinished
private

Definition at line 124 of file XactionRep.h.

Referenced by moveAbContent(), noteAbContentAvailable(), and noteAbContentDone().

◆ adaptHistoryId

int Adaptation::Ecap::XactionRep::adaptHistoryId
private

Definition at line 122 of file XactionRep.h.

Referenced by start(), and swanSong().

◆ al

AccessLogEntry::Pointer Adaptation::Ecap::XactionRep::al
private

Definition at line 126 of file XactionRep.h.

Referenced by metaValue(), start(), and visitEachMetaHeader().

◆ id

const InstanceId<AsyncJob> AsyncJob::id
protectedinherited

Definition at line 72 of file AsyncJob.h.

◆ inCall

◆ makingVb

◆ proxyingAb

◆ stopReason

const char* AsyncJob::stopReason
protectedinherited

◆ theAnswerRep

MessagePtr Adaptation::Ecap::XactionRep::theAnswerRep
private

Definition at line 117 of file XactionRep.h.

Referenced by adapted(), answer(), status(), swanSong(), useAdapted(), and ~XactionRep().

◆ theCauseRep

MessageRep* Adaptation::Ecap::XactionRep::theCauseRep
private

◆ theInitiator

◆ theMaster

◆ theService

Adaptation::ServicePointer Adaptation::Ecap::XactionRep::theService
private

Definition at line 111 of file XactionRep.h.

Referenced by service().

◆ theVirginRep

◆ typeName

◆ vbProductionFinished

bool Adaptation::Ecap::XactionRep::vbProductionFinished
private

Definition at line 123 of file XactionRep.h.

Referenced by noteBodyProducerAborted(), noteBodyProductionEnded(), and status().


The documentation for this class was generated from the following files:

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors