2 * Copyright (C) 1996-2021 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 "anyp/forward.h"
13 #include "comm/forward.h"
14 #include "log/forward.h"
15 #include "mgr/Action.h"
16 #include "mgr/ActionProfile.h"
17 #include "mgr/Command.h"
18 #include "mgr/forward.h"
25 * a CacheManager - the menu system for interacting with squid.
26 * This is currently just an adapter to the global cachemgr* routines to
27 * provide looser coupling between modules, but once fully transitioned,
28 * an instance of this class will represent a single independent manager.
29 * TODO: update documentation to reflect the new singleton model.
34 typedef std::vector
<Mgr::ActionProfilePointer
> Menu
;
36 void registerProfile(char const * action
, char const * desc
,
38 int pw_req_flag
, int atomic
);
39 void registerProfile(char const * action
, char const * desc
,
40 Mgr::ClassActionCreationHandler
*handler
,
41 int pw_req_flag
, int atomic
);
42 Mgr::ActionProfilePointer
findAction(char const * action
) const;
43 Mgr::Action::Pointer
createNamedAction(const char *actionName
);
44 Mgr::Action::Pointer
createRequestedAction(const Mgr::ActionParams
&);
45 const Menu
& menu() const { return menu_
; }
47 void start(const Comm::ConnectionPointer
&client
, HttpRequest
*request
, StoreEntry
*entry
, const AccessLogEntryPointer
&ale
);
49 static CacheManager
* GetInstance();
50 const char *ActionProtection(const Mgr::ActionProfilePointer
&profile
);
53 CacheManager() {} ///< use Instance() instead
55 Mgr::CommandPointer
ParseUrl(const AnyP::Uri
&);
56 void ParseHeaders(const HttpRequest
* request
, Mgr::ActionParams
¶ms
);
57 int CheckPassword(const Mgr::Command
&cmd
);
58 char *PasswdGet(Mgr::ActionPasswordList
*, const char *);
60 void registerProfile(const Mgr::ActionProfilePointer
&profile
);
65 #endif /* SQUID_CACHEMANAGER_H */