2 * Copyright (C) 1996-2020 The Squid Software Foundation and contributors
4 * Squid software is distributed under GPLv2+ license and includes
5 * contributions from numerous individuals and organizations.
6 * Please see the COPYING and CONTRIBUTORS files for details.
9 #ifndef SQUID_CACHEMANAGER_H
10 #define SQUID_CACHEMANAGER_H
12 #include "comm/forward.h"
13 #include "log/forward.h"
14 #include "mgr/Action.h"
15 #include "mgr/ActionProfile.h"
16 #include "mgr/Command.h"
17 #include "mgr/forward.h"
24 * a CacheManager - the menu system for interacting with squid.
25 * This is currently just an adapter to the global cachemgr* routines to
26 * provide looser coupling between modules, but once fully transitioned,
27 * an instance of this class will represent a single independent manager.
28 * TODO: update documentation to reflect the new singleton model.
33 typedef std::vector
<Mgr::ActionProfilePointer
> Menu
;
35 void registerProfile(char const * action
, char const * desc
,
37 int pw_req_flag
, int atomic
);
38 void registerProfile(char const * action
, char const * desc
,
39 Mgr::ClassActionCreationHandler
*handler
,
40 int pw_req_flag
, int atomic
);
41 Mgr::ActionProfilePointer
findAction(char const * action
) const;
42 Mgr::Action::Pointer
createNamedAction(const char *actionName
);
43 Mgr::Action::Pointer
createRequestedAction(const Mgr::ActionParams
&);
44 const Menu
& menu() const { return menu_
; }
46 void start(const Comm::ConnectionPointer
&client
, HttpRequest
*request
, StoreEntry
*entry
, const AccessLogEntryPointer
&ale
);
48 static CacheManager
* GetInstance();
49 const char *ActionProtection(const Mgr::ActionProfilePointer
&profile
);
52 CacheManager() {} ///< use Instance() instead
54 Mgr::CommandPointer
ParseUrl(const char *url
);
55 void ParseHeaders(const HttpRequest
* request
, Mgr::ActionParams
¶ms
);
56 int CheckPassword(const Mgr::Command
&cmd
);
57 char *PasswdGet(Mgr::ActionPasswordList
*, const char *);
59 void registerProfile(const Mgr::ActionProfilePointer
&profile
);
64 #endif /* SQUID_CACHEMANAGER_H */