#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

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

Definition at line 41 of file XactionRep.h.

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

Definition at line 116 of file XactionRep.h.

Definition at line 25 of file BodyPipe.h.

Definition at line 34 of file AsyncJob.h.

Definition at line 45 of file BodyPipe.h.

Member Enumeration Documentation

Enumerator
opUndecided 
opOn 
opComplete 
opNever 

Definition at line 119 of file XactionRep.h.

Constructor & Destructor Documentation

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.

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

Definition at line 65 of file XactionRep.cc.

References assert.

Member Function Documentation

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

Definition at line 622 of file XactionRep.cc.

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

Definition at line 614 of file XactionRep.cc.

References debugs, and HERE().

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

Definition at line 319 of file XactionRep.cc.

References Must.

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

Definition at line 326 of file XactionRep.cc.

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

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

Definition at line 445 of file XactionRep.cc.

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

void AsyncJob::callEnd ( )
virtualinherited
void AsyncJob::callStart ( AsyncCall call)
inherited
bool AsyncJob::canBeCalled ( AsyncCall call) const
inherited

Definition at line 101 of file AsyncJob.cc.

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

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

Definition at line 312 of file XactionRep.cc.

References Must, and NULL.

Adaptation::Ecap::XactionRep::CBDATA_CLASS ( XactionRep  )
private
void Adaptation::Initiate::clearInitiator ( )
protectedinherited

Definition at line 74 of file Initiate.cc.

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

Definition at line 90 of file AsyncJob.cc.

References AsyncJob::doneAll(), NULL, and AsyncJob::stopReason.

Referenced by AsyncJob::callEnd(), and Downloader::downloadFinished().

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

Reimplemented from AsyncJob.

Definition at line 344 of file XactionRep.cc.

References AsyncJob::doneAll().

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

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

Definition at line 382 of file XactionRep.cc.

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

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

Definition at line 54 of file Initiate.cc.

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

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

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

Definition at line 73 of file XactionRep.cc.

References Must.

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

const libecap::Area Adaptation::Ecap::XactionRep::masterxSharedValue ( const libecap::Name &  name) const
protected
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().

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

Definition at line 679 of file XactionRep.cc.

References debugs, HERE(), and Must.

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

Definition at line 596 of file XactionRep.cc.

References Must.

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

Definition at line 586 of file XactionRep.cc.

References debugs, HERE(), and Must.

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

Implements BodyProducer.

Definition at line 636 of file XactionRep.cc.

References Must.

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

Implements BodyConsumer.

Definition at line 663 of file XactionRep.cc.

References Must.

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

Implements BodyConsumer.

Definition at line 654 of file XactionRep.cc.

References Must.

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

Implements Adaptation::Initiate.

Definition at line 672 of file XactionRep.cc.

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

Implements BodyConsumer.

Definition at line 646 of file XactionRep.cc.

References Must.

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

Implements BodyProducer.

Definition at line 629 of file XactionRep.cc.

References Must.

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.

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.

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

Definition at line 287 of file XactionRep.cc.

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

void Adaptation::Ecap::XactionRep::scheduleStop ( const char *  reason)
protected
void Adaptation::Initiate::sendAnswer ( const Answer answer)
protectedinherited

Definition at line 79 of file Initiate.cc.

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

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

Definition at line 81 of file XactionRep.cc.

References Must, and NULL.

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

Definition at line 352 of file XactionRep.cc.

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

const char * Adaptation::Ecap::XactionRep::status ( ) const
virtual
void BodyProducer::stopProducingFor ( RefCount< BodyPipe > &  p,
bool  atEof 
)
protectedinherited
void Adaptation::Ecap::XactionRep::swanSong ( )
virtual
void Adaptation::Initiate::tellQueryAborted ( bool  final)
protectedinherited

Definition at line 87 of file Initiate.cc.

References Adaptation::Answer::Error().

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

Definition at line 334 of file XactionRep.cc.

virtual void* CbdataParent::toCbdata ( )
pure virtualinherited
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 HttpRequest::adaptHistory(), HttpRequest::adaptLogHistory(), hoReply, Adaptation::Config::masterx_shared_name, Must, NULL, Adaptation::History::recordMeta(), request(), Adaptation::History::updateNextServices(), and Adaptation::History::updateXxRecord().

void Adaptation::Ecap::XactionRep::updateSources ( Http::Message adapted)
protected
void Adaptation::Ecap::XactionRep::useAdapted ( const libecap::shared_ptr< libecap::Message > &  msg)
virtual
const libecap::Area Adaptation::Ecap::XactionRep::usernameValue ( ) const
protected
void Adaptation::Ecap::XactionRep::useVirgin ( )
virtual
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, p, and size.

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, p, and size.

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

Definition at line 510 of file XactionRep.cc.

References Must.

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

Definition at line 519 of file XactionRep.cc.

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

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

Definition at line 529 of file XactionRep.cc.

References Must.

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

Definition at line 306 of file XactionRep.cc.

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

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

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

Definition at line 125 of file XactionRep.h.

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

Definition at line 124 of file XactionRep.h.

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

Definition at line 122 of file XactionRep.h.

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

Definition at line 126 of file XactionRep.h.

const InstanceId<AsyncJob> AsyncJob::id
protectedinherited

Definition at line 70 of file AsyncJob.h.

AsyncCall::Pointer AsyncJob::inCall
protectedinherited
OperationState Adaptation::Ecap::XactionRep::makingVb
private

Definition at line 120 of file XactionRep.h.

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

Definition at line 121 of file XactionRep.h.

const char* AsyncJob::stopReason
protectedinherited
MessagePtr Adaptation::Ecap::XactionRep::theAnswerRep
private

Definition at line 117 of file XactionRep.h.

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

Definition at line 114 of file XactionRep.h.

Referenced by XactionRep().

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

Definition at line 51 of file Initiate.h.

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

Definition at line 110 of file XactionRep.h.

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

Definition at line 111 of file XactionRep.h.

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

Definition at line 113 of file XactionRep.h.

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