#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.

Member Function Documentation

◆ adaptationAborted()

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

Definition at line 622 of file XactionRep.cc.

◆ 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.

◆ answer()

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

Definition at line 326 of file XactionRep.cc.

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

◆ blockVirgin()

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

Definition at line 445 of file XactionRep.cc.

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

◆ 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.

◆ cause()

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

Definition at line 312 of file XactionRep.cc.

References Must, and NULL.

◆ CBDATA_CLASS()

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

◆ clearInitiator()

void Adaptation::Initiate::clearInitiator ( )
protectedinherited

Definition at line 74 of file Initiate.cc.

◆ clientIpValue()

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

◆ deleteThis()

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

◆ done()

bool AsyncJob::done ( ) const
protectedinherited

◆ doneAll()

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

Reimplemented from AsyncJob.

Definition at line 344 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 299 of file XactionRep.cc.

References Must.

Referenced by resume().

◆ forgetVb()

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

Definition at line 382 of file XactionRep.cc.

References debugs, HERE(), NULL, and BodyPipe::stillConsuming().

◆ initiator()

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

Definition at line 54 of file Initiate.cc.

References Must.

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

◆ master()

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

Definition at line 73 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 183 of file XactionRep.cc.

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

◆ moveAbContent()

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

Definition at line 679 of file XactionRep.cc.

References debugs, HERE(), and Must.

◆ mustStop()

◆ noteAbContentAvailable()

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

Definition at line 596 of file XactionRep.cc.

References Must.

◆ noteAbContentDone()

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

Definition at line 586 of file XactionRep.cc.

References debugs, HERE(), and Must.

◆ noteBodyConsumerAborted()

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

Implements BodyProducer.

Definition at line 636 of file XactionRep.cc.

References Must.

◆ noteBodyProducerAborted()

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

Implements BodyConsumer.

Definition at line 663 of file XactionRep.cc.

References Must.

◆ noteBodyProductionEnded()

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

Implements BodyConsumer.

Definition at line 654 of file XactionRep.cc.

References Must.

◆ noteInitiatorAborted()

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

Implements Adaptation::Initiate.

Definition at line 672 of file XactionRep.cc.

◆ noteMoreBodyDataAvailable()

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

Implements BodyConsumer.

Definition at line 646 of file XactionRep.cc.

References Must.

◆ noteMoreBodySpaceAvailable()

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

Implements BodyProducer.

Definition at line 629 of file XactionRep.cc.

References Must.

◆ option()

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

Definition at line 88 of file XactionRep.cc.

References Adaptation::Config::masterx_shared_name.

◆ preserveVb()

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

Definition at line 366 of file XactionRep.cc.

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

◆ 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()

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

References Must, and NULL.

◆ sinkVb()

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

Definition at line 352 of file XactionRep.cc.

References debugs, BodyPipe::enableAutoConsumption(), HERE(), and NULL.

◆ start()

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

◆ Start()

◆ status()

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

for debugging, starts with space

Reimplemented from Adaptation::Initiate.

Definition at line 695 of file XactionRep.cc.

References Adaptation::Message::body_pipe, buf, Must, Adaptation::Ecap::MessageRep::raw(), BodyPipe::stillConsuming(), and BodyPipe::stillProducing().

◆ stopConsumingFrom()

◆ stopProducingFor()

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

◆ swanSong()

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

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

References hoReply, Adaptation::Config::masterx_shared_name, Must, NULL, Adaptation::History::recordMeta(), request(), 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)
virtual

◆ usernameValue()

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

Definition at line 148 of file XactionRep.cc.

References Must, NULL, and request().

◆ useVirgin()

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

◆ vbContent()

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

Definition at line 548 of file XactionRep.cc.

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

◆ vbContentShift()

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

Definition at line 572 of file XactionRep.cc.

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

◆ vbDiscard()

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

Definition at line 510 of file XactionRep.cc.

References Must.

◆ vbMake()

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

Definition at line 519 of file XactionRep.cc.

References Must, NULL, and BodyPipe::setConsumerIfNotLate().

◆ vbMakeMore()

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

◆ vbStopMaking()

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

Definition at line 529 of file XactionRep.cc.

References Must.

◆ virgin()

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

Definition at line 306 of file XactionRep.cc.

◆ visitEachMetaHeader()

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

Definition at line 207 of file XactionRep.cc.

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

◆ visitEachOption()

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

Definition at line 104 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
protectedinherited

Definition at line 72 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.

◆ stopReason

const char* AsyncJob::stopReason
protectedinherited

◆ 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