#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)
 
 ~XactionRep () override
 
void master (const AdapterXaction &aMaster)
 
const libecap::Area option (const libecap::Name &name) const override
 
void visitEachOption (libecap::NamedValueVisitor &visitor) const override
 
libecap::Message & virgin () override
 
const libecap::Message & cause () override
 
libecap::Message & adapted () override
 
void useVirgin () override
 
void useAdapted (const libecap::shared_ptr< libecap::Message > &msg) override
 
void blockVirgin () override
 
void adaptationDelayed (const libecap::Delay &) override
 
void adaptationAborted () override
 
void resume () override
 
void vbDiscard () override
 
void vbMake () override
 
void vbStopMaking () override
 
void vbMakeMore () override
 
libecap::Area vbContent (libecap::size_type offset, libecap::size_type size) override
 
void vbContentShift (libecap::size_type size) override
 
void noteAbContentDone (bool atEnd) override
 
void noteAbContentAvailable () override
 
void noteMoreBodySpaceAvailable (RefCount< BodyPipe > bp) override
 
void noteBodyConsumerAborted (RefCount< BodyPipe > bp) override
 
void noteMoreBodyDataAvailable (RefCount< BodyPipe > bp) override
 
void noteBodyProductionEnded (RefCount< BodyPipe > bp) override
 
void noteBodyProducerAborted (RefCount< BodyPipe > bp) override
 
void noteInitiatorAborted () override
 
void start () override
 called by AsyncStart; do not call directly More...
 
bool doneAll () const override
 whether positive goal has been reached More...
 
void swanSong () override
 
const char * status () const override
 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...
 
void handleStopRequest ()
 process external request to terminate now (i.e. during this async call) More...
 
virtual void * toCbdata ()=0
 

Static Public Member Functions

static void Start (const Pointer &job)
 
static void RegisterWithCacheManager ()
 

Public Attributes

const InstanceId< AsyncJobid
 job identifier 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)
 

Static Protected Member Functions

static void ReportAllJobs (StoreEntry *)
 writes a cache manager report about all jobs existing in this worker More...
 

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...
 
bool started_ = false
 Start() has finished successfully. More...
 
bool swanSang_ = false
 swanSong() was called More...
 

Private Types

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

Private Member Functions

 CBDATA_CHILD (XactionRep)
 
virtual void finalizedInCbdataChild ()=0
 hack: ensure CBDATA_CHILD() after a toCbdata()-defining CBDATA_INTERMEDIATE() More...
 

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 34 of file AsyncJob.h.

◆ Pointer [2/3]

Definition at line 25 of file BodyPipe.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 47 of file XactionRep.cc.

References theCauseRep.

◆ ~XactionRep()

Adaptation::Ecap::XactionRep::~XactionRep ( )
override

Definition at line 64 of file XactionRep.cc.

References assert.

Member Function Documentation

◆ adaptationAborted()

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

Definition at line 619 of file XactionRep.cc.

◆ adaptationDelayed()

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

Definition at line 611 of file XactionRep.cc.

References debugs.

◆ adapted()

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

Definition at line 317 of file XactionRep.cc.

References Must.

◆ answer()

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

Definition at line 324 of file XactionRep.cc.

References Must, and Adaptation::Ecap::MessageRep::raw().

◆ blockVirgin()

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

Definition at line 443 of file XactionRep.cc.

References Adaptation::Answer::Block(), debugs, and Must.

◆ callEnd()

void AsyncJob::callEnd ( )
virtualinherited

◆ callException()

◆ callStart()

void AsyncJob::callStart ( AsyncCall call)
inherited

◆ canBeCalled()

bool AsyncJob::canBeCalled ( AsyncCall call) const
inherited

Definition at line 117 of file AsyncJob.cc.

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

◆ cause()

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

Definition at line 310 of file XactionRep.cc.

References Must.

◆ CBDATA_CHILD()

Adaptation::Ecap::XactionRep::CBDATA_CHILD ( XactionRep  )
private

◆ clearInitiator()

void Adaptation::Initiate::clearInitiator ( )
protectedinherited

Definition at line 74 of file Initiate.cc.

◆ clientIpValue()

◆ deleteThis()

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

◆ done()

bool AsyncJob::done ( ) const
protectedinherited

◆ doneAll()

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

Reimplemented from AsyncJob.

Definition at line 342 of file XactionRep.cc.

References AsyncJob::doneAll().

◆ 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 297 of file XactionRep.cc.

References Must.

Referenced by resume().

◆ finalizedInCbdataChild()

virtual void CbdataParent::finalizedInCbdataChild ( )
privatepure virtualinherited

◆ forgetVb()

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

Definition at line 380 of file XactionRep.cc.

References debugs, and BodyPipe::stillConsuming().

◆ handleStopRequest()

void AsyncJob::handleStopRequest ( )
inlineinherited

Definition at line 73 of file AsyncJob.h.

References AsyncJob::mustStop().

◆ initiator()

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

Definition at line 54 of file Initiate.cc.

References Must, and CbcPointer< Cbc >::valid().

Referenced by Adaptation::Initiator::initiateAdaptation().

◆ master()

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

Definition at line 72 of file XactionRep.cc.

References Must.

Referenced by Adaptation::Ecap::ServiceRep::makeXactLauncher().

◆ 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

Definition at line 182 of file XactionRep.cc.

References Adaptation::Config::metaHeaders, Must, and SBuf::toStdString().

◆ moveAbContent()

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

Definition at line 676 of file XactionRep.cc.

References debugs, and Must.

◆ mustStop()

◆ noteAbContentAvailable()

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

Definition at line 593 of file XactionRep.cc.

References Must.

◆ noteAbContentDone()

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

Definition at line 583 of file XactionRep.cc.

References debugs, and Must.

◆ noteBodyConsumerAborted()

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

Implements BodyProducer.

Definition at line 633 of file XactionRep.cc.

References Must.

◆ noteBodyProducerAborted()

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

Implements BodyConsumer.

Definition at line 660 of file XactionRep.cc.

References Must.

◆ noteBodyProductionEnded()

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

Implements BodyConsumer.

Definition at line 651 of file XactionRep.cc.

References Must.

◆ noteInitiatorAborted()

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

Implements Adaptation::Initiate.

Definition at line 669 of file XactionRep.cc.

◆ noteMoreBodyDataAvailable()

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

Implements BodyConsumer.

Definition at line 643 of file XactionRep.cc.

References Must.

◆ noteMoreBodySpaceAvailable()

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

Implements BodyProducer.

Definition at line 626 of file XactionRep.cc.

References Must.

◆ option()

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

Definition at line 87 of file XactionRep.cc.

References Adaptation::Config::masterx_shared_name.

◆ preserveVb()

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

Definition at line 364 of file XactionRep.cc.

References BodyPipe::consumedSize(), debugs, and Must.

◆ RegisterWithCacheManager()

void AsyncJob::RegisterWithCacheManager ( )
staticinherited

Definition at line 215 of file AsyncJob.cc.

References Mgr::RegisterAction(), and AsyncJob::ReportAllJobs().

Referenced by mainInitialize().

◆ ReportAllJobs()

void AsyncJob::ReportAllJobs ( StoreEntry e)
staticprotectedinherited

Definition at line 198 of file AsyncJob.cc.

References AllJobs().

Referenced by AsyncJob::RegisterWithCacheManager().

◆ resume()

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

Definition at line 285 of file XactionRep.cc.

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

◆ scheduleStop()

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

◆ sendAnswer()

void Adaptation::Initiate::sendAnswer ( const Answer answer)
protectedinherited

Definition at line 79 of file Initiate.cc.

References Adaptation::Initiator::noteAdaptationAnswer(), and ScheduleCallHere.

◆ service()

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

Definition at line 80 of file XactionRep.cc.

References Must.

◆ sinkVb()

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

Definition at line 350 of file XactionRep.cc.

References debugs, and BodyPipe::enableAutoConsumption().

◆ start()

void Adaptation::Ecap::XactionRep::start ( )
overridevirtual

◆ Start()

◆ status()

const char * Adaptation::Ecap::XactionRep::status ( ) const
overridevirtual

◆ stopConsumingFrom()

◆ stopProducingFor()

void BodyProducer::stopProducingFor ( RefCount< BodyPipe > &  p,
bool  atEof 
)
protectedinherited

◆ swanSong()

void Adaptation::Ecap::XactionRep::swanSong ( )
overridevirtual

◆ tellQueryAborted()

void Adaptation::Initiate::tellQueryAborted ( bool  final)
protectedinherited

Definition at line 87 of file Initiate.cc.

References Adaptation::Answer::Error().

◆ terminateMaster()

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

Definition at line 332 of file XactionRep.cc.

◆ toCbdata()

virtual void * CbdataParent::toCbdata ( )
pure virtualinherited

◆ updateHistory()

void Adaptation::Ecap::XactionRep::updateHistory ( Http::Message adapted)
protected

Called just before sendAnswer() to record adapter meta-information which may affect answer processing and may be needed for logging.

Definition at line 459 of file XactionRep.cc.

References HttpRequest::adaptHistory(), HttpRequest::adaptLogHistory(), hoReply, Adaptation::Config::masterx_shared_name, Must, Adaptation::History::recordMeta(), Adaptation::History::updateNextServices(), and Adaptation::History::updateXxRecord().

◆ updateSources()

void Adaptation::Ecap::XactionRep::updateSources ( Http::Message adapted)
protected

◆ useAdapted()

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

◆ usernameValue()

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

◆ useVirgin()

void Adaptation::Ecap::XactionRep::useVirgin ( )
override

◆ vbContent()

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

Definition at line 545 of file XactionRep.cc.

References BodyPipe::buf(), MemBuf::content(), MemBuf::contentSize(), min(), Must, and size.

◆ vbContentShift()

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

Definition at line 569 of file XactionRep.cc.

References BodyPipe::buf(), BodyPipe::consume(), MemBuf::contentSize(), min(), Must, and size.

◆ vbDiscard()

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

Definition at line 507 of file XactionRep.cc.

References Must.

◆ vbMake()

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

Definition at line 516 of file XactionRep.cc.

References Must, and BodyPipe::setConsumerIfNotLate().

◆ vbMakeMore()

void Adaptation::Ecap::XactionRep::vbMakeMore ( )
override

◆ vbStopMaking()

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

Definition at line 526 of file XactionRep.cc.

References Must.

◆ virgin()

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

Definition at line 304 of file XactionRep.cc.

◆ visitEachMetaHeader()

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

Definition at line 205 of file XactionRep.cc.

References Adaptation::Config::metaHeaders, Must, and SBuf::toStdString().

◆ visitEachOption()

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

Definition at line 103 of file XactionRep.cc.

References Adaptation::Config::masterx_shared_name.

Member Data Documentation

◆ abProductionAtEnd

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

Definition at line 125 of file XactionRep.h.

◆ abProductionFinished

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

Definition at line 124 of file XactionRep.h.

◆ adaptHistoryId

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

Definition at line 122 of file XactionRep.h.

◆ al

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

Definition at line 126 of file XactionRep.h.

◆ id

const InstanceId<AsyncJob> AsyncJob::id
inherited

Definition at line 75 of file AsyncJob.h.

◆ inCall

AsyncCall::Pointer AsyncJob::inCall
protectedinherited

◆ makingVb

OperationState Adaptation::Ecap::XactionRep::makingVb
private

Definition at line 120 of file XactionRep.h.

◆ proxyingAb

OperationState Adaptation::Ecap::XactionRep::proxyingAb
private

Definition at line 121 of file XactionRep.h.

◆ started_

bool AsyncJob::started_ = false
protectedinherited

Definition at line 88 of file AsyncJob.h.

Referenced by AsyncJob::~AsyncJob(), AsyncJob::callEnd(), and AsyncJob::Start().

◆ stopReason

const char* AsyncJob::stopReason
protectedinherited

◆ swanSang_

bool AsyncJob::swanSang_ = false
protectedinherited

Definition at line 89 of file AsyncJob.h.

Referenced by AsyncJob::~AsyncJob(), and AsyncJob::callEnd().

◆ theAnswerRep

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

Definition at line 117 of file XactionRep.h.

◆ theCauseRep

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

Definition at line 114 of file XactionRep.h.

Referenced by XactionRep().

◆ theInitiator

CbcPointer<Initiator> Adaptation::Initiate::theInitiator
protectedinherited

Definition at line 51 of file Initiate.h.

◆ theMaster

AdapterXaction Adaptation::Ecap::XactionRep::theMaster
private

Definition at line 110 of file XactionRep.h.

◆ theService

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

Definition at line 111 of file XactionRep.h.

◆ theVirginRep

MessageRep Adaptation::Ecap::XactionRep::theVirginRep
private

Definition at line 113 of file XactionRep.h.

◆ typeName

◆ vbProductionFinished

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

Definition at line 123 of file XactionRep.h.


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

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors