Back to index

nordugrid-arc-nox  1.1.0~rc6
Service.cpp
Go to the documentation of this file.
00001 #ifdef HAVE_CONFIG_H
00002 #include <config.h>
00003 #endif
00004 
00005 #include "Service.h"
00006 
00007 namespace Arc {
00008 
00009 Logger Service::logger(Logger::getRootLogger(), "Service");
00010 
00011 Service::Service(Config*) {
00012 }
00013 
00014 void Service::AddSecHandler(Config* cfg,ArcSec::SecHandler* sechandler,const std::string& label) {
00015     if(sechandler) {
00016         sechandlers_[label].push_back(sechandler); //need polishing to put the SecHandlerFactory->getinstance here
00017         XMLNode cn = (*cfg)["SecHandler"];
00018         Config cfg_(cn);
00019     }
00020 }
00021 
00022 bool Service::ProcessSecHandlers(Message& message,const std::string& label) const {
00023     std::map<std::string,std::list<ArcSec::SecHandler*> >::const_iterator q = sechandlers_.find(label);
00024     if(q == sechandlers_.end()) {
00025         logger.msg(DEBUG, "No security processing/check requested for '%s'", label);
00026         return true;
00027     }
00028 
00029     std::list<ArcSec::SecHandler*>::const_iterator h = q->second.begin();
00030     for(;h!=q->second.end();++h) {
00031         const ArcSec::SecHandler* handler = *h;
00032         if(handler) if(!(handler->Handle(&message))) {
00033             logger.msg(DEBUG, "Security processing/check for '%s' failed", label);
00034             return false;
00035         }
00036     }
00037     logger.msg(DEBUG, "Security processing/check for '%s' passed", label);
00038     return true;
00039 }
00040 
00041 bool Service::RegistrationCollector(XMLNode &doc)
00042 {
00043     logger.msg(WARNING, "Empty registration collector");
00044 }
00045 
00046 } // namespace Arc