Back to index

nordugrid-arc-nox  1.1.0~rc6
Destinations.cpp
Go to the documentation of this file.
00001 #include "Destinations.h"
00002 #include "arc/Logger.h"
00003 
00004 namespace Arc
00005 {
00006 
00007   void Destinations::report(Arc::JobLogFile &joblog)
00008   {
00009     std::string dest_id=joblog["loggerurl"]; 
00010     //TODO same service URL with different reporting parameters?
00011 
00012     if (find(dest_id)==end()) //New destination
00013       {
00014         // Create the appropriate adapter
00015         Destination *dest = Destination::createDestination(joblog);
00016         if (dest)
00017           (*this)[dest_id] = dest;
00018         else
00019           {
00020             Arc::Logger logger(Arc::Logger::rootLogger, "JURA.Destinations");
00021             logger.msg(Arc::ERROR, 
00022                        "Unable to create adapter for the specific reporting destination type");
00023             return;
00024           }
00025       }
00026     
00027     (*this)[dest_id]->report(joblog);
00028   }
00029 
00030   Destinations::~Destinations()
00031   {
00032     for (Destinations::iterator it=begin();
00033         it!=end();
00034         ++it)
00035       {
00036        delete (*it).second;
00037       }
00038   }
00039 }