#include <Action.h>

Inheritance diagram for Mgr::Action:
Collaboration diagram for Mgr::Action:

Public Types

typedef RefCount< ActionPointer
 

Public Member Functions

 Action (const CommandPointer &aCmd)
 
 ~Action () override
 
void run (StoreEntry *entry, bool writeHttpHeader)
 collect + fillEntry: collect local information and fill the store entry More...
 
void fillEntry (StoreEntry *entry, bool writeHttpHeader)
 prepare store entry, dump info, close store entry (if possible) More...
 
virtual void add (const Action &action)
 incrementally merge in remote information (of the same action type) More...
 
virtual void respond (const Request &request)
 respond to Coordinator request; default is to collect and sendResponse More...
 
virtual void pack (Ipc::TypedMsgHdr &) const
 pack collected action info into a message to be sent to Coordinator More...
 
virtual void unpack (const Ipc::TypedMsgHdr &)
 unpack action info from the message received by Coordinator More...
 
void sendResponse (Ipc::RequestId)
 notify Coordinator that this action is done with local processing More...
 
virtual bool aggregatable () const
 
virtual Format format () const
 action report syntax More...
 
bool atomic () const
 dump() call writes everything before returning More...
 
const char * name () const
 label as seen in the cache manager menu More...
 
const Commandcommand () const
 the cause of this action More...
 
StoreEntrycreateStoreEntry () const
 creates store entry from params More...
 
const char * contentType () const
 HTTP Content-Type header value for this Action report. More...
 

Protected Member Functions

virtual void collect ()
 calculate and keep local action-specific information More...
 
virtual void dump (StoreEntry *)
 

Private Member Functions

 Action (const Action &)
 
Actionoperator= (const Action &)
 

Private Attributes

const CommandPointer cmd
 the command that caused this action More...
 

Detailed Description

Base API for organizing the processing of a compiled cache manager command. Not a job because all methods are synchronous (but they may start jobs).

Definition at line 25 of file Action.h.

Member Typedef Documentation

◆ Pointer

Definition at line 28 of file Action.h.

Constructor & Destructor Documentation

◆ Action() [1/2]

Mgr::Action::Action ( const CommandPointer aCmd)

Definition at line 25 of file Action.cc.

References cmd, and Must.

◆ ~Action()

Mgr::Action::~Action ( )
override

Definition at line 31 of file Action.cc.

◆ Action() [2/2]

Mgr::Action::Action ( const Action )
private

Member Function Documentation

◆ add()

void Mgr::Action::add ( const Action action)
virtual

◆ aggregatable()

virtual bool Mgr::Action::aggregatable ( ) const
inlinevirtual

whether at least some local kid info can be combined and, hence, the combined data should be written at the end of the coordinated response

Reimplemented in Ssl::CertificateStorageAction, and Mgr::FunAction.

Definition at line 65 of file Action.h.

◆ atomic()

bool Mgr::Action::atomic ( ) const

Definition at line 43 of file Action.cc.

◆ collect()

virtual void Mgr::Action::collect ( )
inlineprotectedvirtual

◆ command()

const Mgr::Command & Mgr::Action::command ( ) const

Definition at line 36 of file Action.cc.

References Must.

◆ contentType()

const char * Mgr::Action::contentType ( ) const

Definition at line 61 of file Action.cc.

References assert, Mgr::informal, and Mgr::yaml.

◆ createStoreEntry()

StoreEntry * Mgr::Action::createStoreEntry ( ) const

◆ dump()

virtual void Mgr::Action::dump ( StoreEntry )
inlineprotectedvirtual

start writing action-specific info to Store entry; may collect info during dump, especially if collect() did nothing non-atomic() actions may continue writing asynchronously after returning

Reimplemented in Ssl::CertificateStorageAction, Mgr::IntervalAction, Mgr::InfoAction, Mgr::CountersAction, Mgr::OfflineToggleAction, Mgr::RotateAction, DiskdAction, Mgr::ReconfigureAction, Mgr::ServiceTimesAction, Mgr::ShutdownAction, Mgr::IoAction, Mgr::StoreIoAction, Mgr::MenuAction, Mgr::FunAction, Mgr::IndexAction, and SBufStatsAction.

Definition at line 87 of file Action.h.

◆ fillEntry()

◆ format()

Mgr::Format Mgr::Action::format ( ) const
virtual

Definition at line 49 of file Action.cc.

◆ name()

const char * Mgr::Action::name ( ) const

Definition at line 55 of file Action.cc.

◆ operator=()

Action& Mgr::Action::operator= ( const Action )
private

◆ pack()

virtual void Mgr::Action::pack ( Ipc::TypedMsgHdr ) const
inlinevirtual

◆ respond()

void Mgr::Action::respond ( const Request request)
virtual

Reimplemented in Mgr::InfoAction, and Mgr::FunAction.

Definition at line 87 of file Action.cc.

References Mgr::Request::conn, debugs, Comm::Connection::fd, MYNAME, and Ipc::Request::requestId.

◆ run()

void Mgr::Action::run ( StoreEntry entry,
bool  writeHttpHeader 
)

Definition at line 110 of file Action.cc.

References debugs, and MYNAME.

◆ sendResponse()

void Mgr::Action::sendResponse ( Ipc::RequestId  requestId)

◆ unpack()

virtual void Mgr::Action::unpack ( const Ipc::TypedMsgHdr )
inlinevirtual

Member Data Documentation

◆ cmd

const CommandPointer Mgr::Action::cmd
private

Definition at line 90 of file Action.h.

Referenced by Action(), SBufStatsAction::Create(), and Mgr::IndexAction::Create().


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

 

Introduction

Documentation

Support

Miscellaneous