4 * SQUID Web Proxy Cache http://www.squid-cache.org/
5 * ----------------------------------------------------------
7 * Squid is the result of efforts by numerous individuals from
8 * the Internet community; see the CONTRIBUTORS file for full
9 * details. Many organizations have provided support for Squid's
10 * development; see the SPONSORS file for full details. Squid is
11 * Copyrighted (C) 2001 by the Regents of the University of
12 * California; see the COPYRIGHT file for full details. Squid
13 * incorporates software developed and/or copyrighted by other
14 * sources; see the CREDITS file for full details.
16 * This program is free software; you can redistribute it and/or modify
17 * it under the terms of the GNU General Public License as published by
18 * the Free Software Foundation; either version 2 of the License, or
19 * (at your option) any later version.
21 * This program is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 * GNU General Public License for more details.
26 * You should have received a copy of the GNU General Public License
27 * along with this program; if not, write to the Free Software
28 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
32 #ifndef SQUID_CACHEMANAGER_H
33 #define SQUID_CACHEMANAGER_H
35 #include "comm/forward.h"
36 #include "mgr/Action.h"
37 #include "mgr/ActionProfile.h"
38 #include "mgr/Command.h"
39 #include "mgr/forward.h"
45 \defgroup CacheManagerAPI Cache Manager API
48 \defgroup CacheManagerInternal Cache Manager intenal API (not for public use)
49 \ingroup CacheManagerAPI
55 class ActionPasswordList
;
58 \ingroup CacheManagerAPI
59 * a CacheManager - the menu system for interacting with squid.
60 * This is currently just an adapter to the global cachemgr* routines to
61 * provide looser coupling between modules, but once fully transitioned,
62 * an instance of this class will represent a single independent manager.
63 * TODO: update documentation to reflect the new singleton model.
68 typedef std::vector
<Mgr::ActionProfilePointer
> Menu
;
70 void registerProfile(char const * action
, char const * desc
,
72 int pw_req_flag
, int atomic
);
73 void registerProfile(char const * action
, char const * desc
,
74 Mgr::ClassActionCreationHandler
*handler
,
75 int pw_req_flag
, int atomic
);
76 Mgr::ActionProfilePointer
findAction(char const * action
) const;
77 Mgr::Action::Pointer
createNamedAction(const char *actionName
);
78 Mgr::Action::Pointer
createRequestedAction(const Mgr::ActionParams
&);
79 const Menu
& menu() const { return menu_
; }
81 void Start(const Comm::ConnectionPointer
&client
, HttpRequest
* request
, StoreEntry
* entry
);
83 static CacheManager
* GetInstance();
84 const char *ActionProtection(const Mgr::ActionProfilePointer
&profile
);
87 CacheManager() {} ///< use Instance() instead
89 Mgr::CommandPointer
ParseUrl(const char *url
);
90 void ParseHeaders(const HttpRequest
* request
, Mgr::ActionParams
¶ms
);
91 int CheckPassword(const Mgr::Command
&cmd
);
92 char *PasswdGet(Mgr::ActionPasswordList
*, const char *);
94 void registerProfile(const Mgr::ActionProfilePointer
&profile
);
99 static CacheManager
* instance
;
102 #endif /* SQUID_CACHEMANAGER_H */