Back to index

nordugrid-arc-nox  1.1.0~rc6
MCC.h
Go to the documentation of this file.
00001 #ifndef __ARC_MCC_H__
00002 #define __ARC_MCC_H__
00003 
00004 #include <list>
00005 #include <map>
00006 #include <arc/ArcConfig.h>
00007 #include <arc/Logger.h>
00008 #include <arc/message/SecHandler.h>
00009 #include <arc/loader/Plugin.h>
00010 #include <arc/message/Message.h>
00011 #include <arc/message/MCC_Status.h>
00012 
00013 namespace Arc {
00014 
00016 
00019   class MCCInterface: public Plugin {
00020   public:
00035     virtual MCC_Status process(Message& request,
00036             Message& response) = 0;
00037     virtual ~MCCInterface() {}
00038   };
00039 
00041 
00044   class MCC
00045     : public MCCInterface {
00046   protected:
00050     std::map<std::string, MCCInterface *> next_;
00051     MCCInterface *Next(const std::string& label = "");
00052 
00057     std::map<std::string, std::list<ArcSec::SecHandler *> > sechandlers_;
00058 
00065     bool ProcessSecHandlers(Message& message,
00066                             const std::string& label = "") const;
00067 
00069 
00071     static Logger logger;
00072 
00073   public:
00075     MCC(Config *) {}
00076 
00077     virtual ~MCC() {}
00078 
00083     virtual void Next(MCCInterface *next, const std::string& label = "");
00084 
00095     virtual void AddSecHandler(Config *cfg,
00096              ArcSec::SecHandler *sechandler,
00097              const std::string& label = "");
00098 
00100     virtual void Unlink();
00101 
00103     virtual MCC_Status process(Message& /* request */,
00104             Message& /* response */) {
00105       return MCC_Status();
00106     }
00107   };
00108 
00109   class MCCConfig
00110     : public BaseConfig {
00111   public:
00112     MCCConfig()
00113       : BaseConfig() {}
00114     virtual ~MCCConfig() {}
00115     virtual XMLNode MakeConfig(XMLNode cfg) const;
00116   };
00117 
00118 /*
00119   class SecHandlerConfig {
00120   private:
00121     XMLNode cfg_;
00122   public:
00123     SecHandlerConfig(XMLNode cfg);
00124     virtual ~SecHandlerConfig() {}
00125     virtual XMLNode MakeConfig(XMLNode cfg) const;
00126   };
00127 */
00128 
00129   #define MCCPluginKind ("HED:MCC")
00130 
00131   class ChainContext;
00132 
00133   class MCCPluginArgument: public PluginArgument {
00134    private:
00135     Config* config_;
00136     ChainContext* context_;
00137    public:
00138     MCCPluginArgument(Config* config,ChainContext* context):config_(config),context_(context) { };
00139     virtual ~MCCPluginArgument(void) { };
00140     operator Config* (void) { return config_; };
00141     operator ChainContext* (void) { return context_; };
00142   };
00143 
00144 } // namespace Arc
00145 
00146 #endif /* __ARC_MCC_H__ */