#include <CacheManager.h>

Collaboration diagram for CacheManager:

Public Types

typedef std::vector
< Mgr::ActionProfilePointer

Public Member Functions

void registerProfile (char const *action, char const *desc, OBJH *handler, int pw_req_flag, int atomic)
void registerProfile (char const *action, char const *desc, Mgr::ClassActionCreationHandler *handler, int pw_req_flag, int atomic)
Mgr::ActionProfilePointer findAction (char const *action) const
Mgr::Action::Pointer createNamedAction (const char *actionName)
Mgr::Action::Pointer createRequestedAction (const Mgr::ActionParams &)
const Menumenu () const
void Start (const Comm::ConnectionPointer &client, HttpRequest *request, StoreEntry *entry)
const char * ActionProtection (const Mgr::ActionProfilePointer &profile)

Static Public Member Functions

static CacheManagerGetInstance ()

Protected Member Functions

 CacheManager ()
 use Instance() instead More...
Mgr::CommandPointer ParseUrl (const char *url)
void ParseHeaders (const HttpRequest *request, Mgr::ActionParams &params)
int CheckPassword (const Mgr::Command &cmd)
char * PasswdGet (Mgr::ActionPasswordList *, const char *)
void registerProfile (const Mgr::ActionProfilePointer &profile)
 Registers new profiles, ignoring attempts to register a duplicate. More...

Protected Attributes

Menu menu_

Detailed Description

a CacheManager - the menu system for interacting with squid. This is currently just an adapter to the global cachemgr* routines to provide looser coupling between modules, but once fully transitioned, an instance of this class will represent a single independent manager. TODO: update documentation to reflect the new singleton model.

Definition at line 29 of file CacheManager.h.

Member Typedef Documentation

Constructor & Destructor Documentation

CacheManager::CacheManager ( )

Definition at line 51 of file CacheManager.h.

Referenced by GetInstance().

Member Function Documentation

const char * CacheManager::ActionProtection ( const Mgr::ActionProfilePointer profile)

Definition at line 423 of file cache_manager.cc.

References assert, Config, NULL, SquidConfig::passwd_list, and PasswdGet().

Referenced by Mgr::MenuAction::dump(), and ParseUrl().

int CacheManager::CheckPassword ( const Mgr::Command cmd)
Return values
0if mgr->password is good or "none"
1if mgr->password is "disable"
!0if mgr->password does not match configured password

Definition at line 275 of file cache_manager.cc.

References assert, Config, debugs, NULL, Mgr::Command::params, SquidConfig::passwd_list, PasswdGet(), Mgr::ActionParams::password, Mgr::Command::profile, and String::size().

Referenced by Start().

Mgr::Action::Pointer CacheManager::createNamedAction ( const char *  actionName)

Definition at line 127 of file cache_manager.cc.

References findAction(), Must, and NULL.

Referenced by Mgr::Response::Response(), and testCacheManager::testRegister().

Mgr::Action::Pointer CacheManager::createRequestedAction ( const Mgr::ActionParams params)
Mgr::ActionProfile::Pointer CacheManager::findAction ( char const *  action) const

Locates an action in the actions registry ActionsList.

Return values
NULLif Action not found
CacheManagerAction*if the action was found

Definition at line 109 of file cache_manager.cc.

References a, debugs, menu_, Must, and NULL.

Referenced by createNamedAction(), createRequestedAction(), ParseUrl(), and registerProfile().

const Menu& CacheManager::menu ( ) const

Definition at line 43 of file CacheManager.h.

References menu_.

Referenced by Mgr::MenuAction::dump().

Mgr::Command::Pointer CacheManager::ParseUrl ( const char *  url)

define whether the URL is a cache-manager URL and parse the action requested by the user. Checks via CacheManager::ActionProtection() that the item is accessible by the user.

Return values
CacheManager::cachemgrStateDatastate object for the following handling
NULLif the action can't be found or can't be accessed by the user

Definition at line 158 of file cache_manager.cc.

References ActionProtection(), DBG_IMPORTANT, debugs, findAction(), HERE(), len, LOCAL_ARRAY, MAX_URL, Must, NULL, Mgr::QueryParams::Parse(), request(), and xstrncpy().

Referenced by Start().

char * CacheManager::PasswdGet ( Mgr::ActionPasswordList a,
const char *  action 
void CacheManager::registerProfile ( char const *  action,
char const *  desc,
OBJH handler,
int  pw_req_flag,
int  atomic 

Registers a C-style action, which is implemented as a pointer to a function taking as argument a pointer to a StoreEntry and returning void. Implemented via CacheManagerActionLegacy.

Definition at line 78 of file cache_manager.cc.

References debugs, and HERE().

Referenced by Mgr::RegisterAction(), and testCacheManager::testRegister().

void CacheManager::registerProfile ( char const *  action,
char const *  desc,
Mgr::ClassActionCreationHandler handler,
int  pw_req_flag,
int  atomic 
void CacheManager::registerProfile ( const Mgr::ActionProfilePointer profile)

Definition at line 60 of file cache_manager.cc.

References debugs, findAction(), HERE(), menu_, Must, and NULL.

Member Data Documentation

Menu CacheManager::menu_

Definition at line 60 of file CacheManager.h.

Referenced by findAction(), menu(), and registerProfile().

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






Web Site Translations