Back to index

nordugrid-arc-nox  1.1.0~rc6
TargetRetrieverARC0.cpp
Go to the documentation of this file.
00001 // -*- indent-tabs-mode: nil -*-
00002 
00003 #ifdef HAVE_CONFIG_H
00004 #include <config.h>
00005 #endif
00006 
00007 #include <arc/ArcConfig.h>
00008 #include <arc/Logger.h>
00009 #include <arc/StringConv.h>
00010 #include <arc/Thread.h>
00011 #include <arc/URL.h>
00012 #include <arc/client/ExecutionTarget.h>
00013 #include <arc/client/TargetGenerator.h>
00014 #include <arc/credential/Credential.h>
00015 #include <arc/data/DataBuffer.h>
00016 #include <arc/data/DataHandle.h>
00017 
00018 #include "TargetRetrieverARC0.h"
00019 
00020 namespace Arc {
00021 
00022   struct ThreadArg {
00023     TargetGenerator *mom;
00024     const UserConfig *usercfg;
00025     URL url;
00026     int targetType;
00027     int detailLevel;
00028   };
00029 
00030   ThreadArg* TargetRetrieverARC0::CreateThreadArg(TargetGenerator& mom,
00031                                                   int targetType,
00032                                                   int detailLevel) {
00033     ThreadArg *arg = new ThreadArg;
00034     arg->mom = &mom;
00035     arg->usercfg = &usercfg;
00036     arg->url = url;
00037     arg->targetType = targetType;
00038     arg->detailLevel = detailLevel;
00039     return arg;
00040   }
00041 
00042   Logger TargetRetrieverARC0::logger(TargetRetriever::logger, "ARC0");
00043 
00044   TargetRetrieverARC0::TargetRetrieverARC0(const UserConfig& usercfg,
00045                                            const URL& url, ServiceType st)
00046     : TargetRetriever(usercfg, url, st, "ARC0") {}
00047 
00048   TargetRetrieverARC0::~TargetRetrieverARC0() {}
00049 
00050   Plugin* TargetRetrieverARC0::Instance(PluginArgument *arg) {
00051     TargetRetrieverPluginArgument *trarg =
00052       dynamic_cast<TargetRetrieverPluginArgument*>(arg);
00053     if (!trarg)
00054       return NULL;
00055     return new TargetRetrieverARC0(*trarg, *trarg, *trarg);
00056   }
00057 
00058   void TargetRetrieverARC0::GetTargets(TargetGenerator& mom, int targetType,
00059                                        int detailLevel) {
00060 
00061     logger.msg(VERBOSE, "TargetRetriverARC0 initialized with %s service url: %s",
00062                tostring(serviceType), url.str());
00063 
00064     switch (serviceType) {
00065     case COMPUTING:
00066       if (mom.AddService(url)) {
00067         ThreadArg *arg = CreateThreadArg(mom, targetType, detailLevel);
00068         if (!CreateThreadFunction(&InterrogateTarget, arg)) {
00069           delete arg;
00070           mom.RetrieverDone();
00071         }
00072       }
00073       break;
00074     case INDEX:
00075       if (mom.AddIndexServer(url)) {
00076         ThreadArg *arg = CreateThreadArg(mom, targetType, detailLevel);
00077         if (!CreateThreadFunction(&QueryIndex, arg)) {
00078           delete arg;
00079           mom.RetrieverDone();
00080         }
00081       }
00082       break;
00083     }
00084   }
00085 
00086   void TargetRetrieverARC0::QueryIndex(void *arg) {
00087     ThreadArg *thrarg = (ThreadArg*)arg;
00088     TargetGenerator& mom = *thrarg->mom;
00089     const UserConfig& usercfg = *thrarg->usercfg;
00090 
00091     URL url = thrarg->url;
00092     url.ChangeLDAPScope(URL::base);
00093     url.AddLDAPAttribute("giisregistrationstatus");
00094     DataHandle handler(url, usercfg);
00095     DataBuffer buffer;
00096 
00097     if (!handler) {
00098       logger.msg(INFO, "Can't create information handle - "
00099                  "is the ARC ldap DMC plugin available?");
00100       delete thrarg;
00101       mom.RetrieverDone();
00102       return;
00103     }
00104 
00105     if (!handler->StartReading(buffer)) {
00106       delete thrarg;
00107       mom.RetrieverDone();
00108       return;
00109     }
00110 
00111     int handle;
00112     unsigned int length;
00113     unsigned long long int offset;
00114     std::string result;
00115 
00116     while (buffer.for_write() || !buffer.eof_read())
00117       if (buffer.for_write(handle, length, offset, true)) {
00118         result.append(buffer[handle], length);
00119         buffer.is_written(handle);
00120       }
00121 
00122     if (!handler->StopReading()) {
00123       delete thrarg;
00124       mom.RetrieverDone();
00125       return;
00126     }
00127 
00128     XMLNode xmlresult(result);
00129 
00130     // GIISes
00131     XMLNodeList GIISes =
00132       xmlresult.XPathLookup("//Mds-Vo-name[Mds-Service-type]", NS());
00133 
00134     for (XMLNodeList::iterator it = GIISes.begin(); it != GIISes.end(); it++) {
00135 
00136       if ((std::string)(*it)["Mds-Reg-status"] == "PURGED")
00137         continue;
00138 
00139       TargetRetrieverARC0 retriever(usercfg,
00140                                     URL((std::string)(*it)["Mds-Service-type"] + "://" +
00141                                         (std::string)(*it)["Mds-Service-hn"] + ":" +
00142                                         (std::string)(*it)["Mds-Service-port"] + "/" +
00143                                         (std::string)(*it)["Mds-Service-Ldap-suffix"]),
00144                                     INDEX);
00145       retriever.GetTargets(mom, thrarg->targetType, thrarg->detailLevel);
00146     }
00147 
00148     // GRISes
00149     XMLNodeList GRISes =
00150       xmlresult.XPathLookup("//nordugrid-cluster-name"
00151                             "[objectClass='MdsService']", NS());
00152 
00153     for (XMLNodeList::iterator it = GRISes.begin(); it != GRISes.end(); it++) {
00154 
00155       if ((std::string)(*it)["Mds-Reg-status"] == "PURGED")
00156         continue;
00157 
00158       TargetRetrieverARC0 retriever(usercfg,
00159                                     URL((std::string)(*it)["Mds-Service-type"] + "://" +
00160                                         (std::string)(*it)["Mds-Service-hn"] + ":" +
00161                                         (std::string)(*it)["Mds-Service-port"] + "/" +
00162                                         (std::string)(*it)["Mds-Service-Ldap-suffix"]),
00163                                     COMPUTING);
00164       retriever.GetTargets(mom, thrarg->targetType, thrarg->detailLevel);
00165     }
00166 
00167     delete thrarg;
00168     mom.RetrieverDone();
00169   }
00170 
00171   void TargetRetrieverARC0::InterrogateTarget(void *arg) {
00172     ThreadArg *thrarg = (ThreadArg*)arg;
00173     TargetGenerator& mom = *thrarg->mom;
00174     const UserConfig& usercfg = *thrarg->usercfg;
00175     int targetType = thrarg->targetType;
00176 
00177     //Create credential object in order to get the user DN
00178     Credential credential(!usercfg.ProxyPath().empty() ? usercfg.ProxyPath() :
00179                                                          usercfg.CertificatePath(),
00180                           !usercfg.ProxyPath().empty() ? usercfg.ProxyPath() :
00181                                                          usercfg.KeyPath(),
00182                           usercfg.CACertificatesDirectory(), "");
00183 
00184     //Query GRIS for all relevant information
00185     URL url = thrarg->url;
00186     url.ChangeLDAPScope(URL::subtree);
00187 
00188     if (targetType == 0)
00189       url.ChangeLDAPFilter("(|(objectclass=nordugrid-cluster)"
00190                            "(objectclass=nordugrid-queue)"
00191                            "(nordugrid-authuser-sn=" +
00192                            credential.GetIdentityName() + "))");
00193     else if (targetType == 1)
00194       url.ChangeLDAPFilter("(|(nordugrid-job-globalowner=" +
00195                            credential.GetIdentityName() + "))");
00196 
00197     DataHandle handler(url, usercfg);
00198     DataBuffer buffer;
00199 
00200     if (!handler) {
00201       logger.msg(INFO, "Can't create information handle - "
00202                  "is the ARC ldap DMC plugin available?");
00203       delete thrarg;
00204       mom.RetrieverDone();
00205       return;
00206     }
00207 
00208     if (!handler->StartReading(buffer)) {
00209       delete thrarg;
00210       mom.RetrieverDone();
00211       return;
00212     }
00213 
00214     int handle;
00215     unsigned int length;
00216     unsigned long long int offset;
00217     std::string result;
00218 
00219     while (buffer.for_write() || !buffer.eof_read())
00220       if (buffer.for_write(handle, length, offset, true)) {
00221         result.append(buffer[handle], length);
00222         buffer.is_written(handle);
00223       }
00224 
00225     if (!handler->StopReading()) {
00226       delete thrarg;
00227       mom.RetrieverDone();
00228       return;
00229     }
00230 
00231     XMLNode xmlresult(result);
00232 
00233     if (targetType == 0) {
00234 
00235       XMLNodeList queues =
00236         xmlresult.XPathLookup("//nordugrid-queue-name"
00237                               "[objectClass='nordugrid-queue']", NS());
00238 
00239       for (XMLNodeList::iterator it = queues.begin();
00240            it != queues.end(); it++) {
00241 
00242         XMLNode queue = *it;
00243         XMLNode cluster = queue.Parent();
00244         XMLNode authuser =
00245           (*it)["nordugrid-info-group-name"]["nordugrid-authuser-name"];
00246 
00247         ExecutionTarget target;
00248 
00249         target.GridFlavour = "ARC0";
00250         target.Cluster = thrarg->url;
00251 
00252         // Location attributes
00253         if (cluster["nordugrid-cluster-location"])
00254           target.PostCode = (std::string)cluster["nordugrid-cluster-location"];
00255 
00256         // Admin Domain attributes
00257         if (cluster["nordugrid-cluster-aliasname"])
00258           target.DomainName =
00259             (std::string)cluster["nordugrid-cluster-aliasname"];
00260         if (cluster["nordugrid-cluster-owner"])
00261           target.Owner = (std::string)cluster["nordugrid-cluster-owner"];
00262 
00263         // Computing Service attributes
00264         if (cluster["nordugrid-cluster-name"])
00265           target.ServiceName = (std::string)cluster["nordugrid-cluster-name"];
00266         target.ServiceType = "org.nordugrid.arc-classic";
00267 
00268         // Computing Endpoint attributes
00269         if (cluster["nordugrid-cluster-contactstring"])
00270           target.url = (std::string)cluster["nordugrid-cluster-contactstring"];
00271         target.Capability.push_back("executionmanagement.jobexecution");
00272         target.Capability.push_back("executionmanagement.jobmanager");
00273         target.Technology = "gridftp";
00274         if (cluster["nordugrid-cluster-middleware"]) {
00275           std::string mw =
00276             (std::string)cluster["nordugrid-cluster-middleware"];
00277           std::string::size_type pos1 = mw.find('-');
00278           if (pos1 == std::string::npos)
00279             target.Implementor = mw;
00280           else {
00281             target.Implementor = mw.substr(0, pos1);
00282             target.Implementation = mw.substr(pos1 + 1);
00283           }
00284         }
00285         if (queue["nordugrid-queue-status"]) {
00286           target.HealthStateInfo =
00287             (std::string)queue["nordugrid-queue-status"];
00288           if (target.HealthStateInfo.substr(0, 6) == "active")
00289             target.HealthState = "ok";
00290           else if (target.HealthStateInfo.substr(0, 8) == "inactive")
00291             target.HealthState = "critical";
00292           else
00293             target.HealthState = "other";
00294         }
00295         if (cluster["nordugrid-cluster-issuerca"])
00296           target.IssuerCA = (std::string)cluster["nordugrid-cluster-issuerca"];
00297         if (cluster["nordugrid-cluster-trustedca"])
00298           for (XMLNode n = cluster["nordugrid-cluster-trustedca"]; n; ++n)
00299             target.TrustedCA.push_back((std::string)n);
00300         target.Staging = "staginginout";
00301         target.JobDescriptions.push_back("nordugrid:xrsl");
00302         target.JobDescriptions.push_back("ogf:jsdl");
00303 
00304         // Computing Share attributes
00305         if (queue["nordugrid-queue-name"])
00306           target.ComputingShareName = (std::string)queue["nordugrid-queue-name"];
00307         if (queue["nordugrid-queue-maxwalltime"])
00308           target.MaxWallTime =
00309             (std::string)queue["nordugrid-queue-maxwalltime"];
00310         if (queue["nordugrid-queue-minwalltime"])
00311           target.MinWallTime =
00312             (std::string)queue["nordugrid-queue-minwalltime"];
00313         if (queue["nordugrid-queue-defaultwalltime"])
00314           target.DefaultWallTime =
00315             (std::string)queue["nordugrid-queue-defaultwalltime"];
00316         if (queue["nordugrid-queue-maxcputime"])
00317           target.MaxCPUTime =
00318             (std::string)queue["nordugrid-queue-maxcputime"];
00319         if (queue["nordugrid-queue-mincputime"])
00320           target.MinCPUTime =
00321             (std::string)queue["nordugrid-queue-mincputime"];
00322         if (queue["nordugrid-queue-defaultcputime"])
00323           target.DefaultCPUTime =
00324             (std::string)queue["nordugrid-queue-defaultcputime"];
00325         if (queue["nordugrid-queue-maxrunning"])
00326           target.MaxRunningJobs =
00327             stringtoi((std::string)queue["nordugrid-queue-maxrunning"]);
00328         if (queue["nordugrid-queue-maxqueable"])
00329           target.MaxWaitingJobs =
00330             stringtoi((std::string)queue["nordugrid-queue-maxqueable"]);
00331         if (queue["nordugrid-queue-maxuserrun"])
00332           target.MaxUserRunningJobs =
00333             stringtoi((std::string)queue["nordugrid-queue-maxuserrun"]);
00334         if (queue["nordugrid-queue-schedulingpolicy"])
00335           target.SchedulingPolicy =
00336             (std::string)queue["nordugrid-queue-schedulingpolicy"];
00337         if (queue["nordugrid-queue-nodememory"])
00338           target.MaxMainMemory = target.MaxVirtualMemory =
00339             stringtoi((std::string)queue["nordugrid-queue-nodememory"]);
00340         else if (cluster["nordugrid-cluster-nodememory"])
00341           target.MaxMainMemory = target.MaxVirtualMemory =
00342             stringtoi((std::string)cluster["nordugrid-cluster-nodememory"]);
00343         if (authuser["nordugrid-authuser-diskspace"])
00344           target.MaxDiskSpace =
00345             stringtoi((std::string)authuser["nordugrid-authuser-diskspace"]) / 1000;
00346         if (cluster["nordugrid-cluster-localse"])
00347           target.DefaultStorageService =
00348             (std::string)cluster["nordugrid-cluster-localse"];
00349         if (queue["nordugrid-queue-running"])
00350           target.RunningJobs =
00351             stringtoi((std::string)queue["nordugrid-queue-running"]);
00352         if (queue["nordugrid-queue-running"] &&
00353             queue["nordugrid-queue-gridrunning"])
00354           target.LocalRunningJobs =
00355             stringtoi((std::string)queue["nordugrid-queue-running"]) -
00356             stringtoi((std::string)queue["nordugrid-queue-gridrunning"]);
00357         if (queue["nordugrid-queue-gridqueued"] &&
00358             queue["nordugrid-queue-localqueued"])
00359           target.WaitingJobs =
00360             stringtoi((std::string)queue["nordugrid-queue-gridqueued"]) +
00361             stringtoi((std::string)queue["nordugrid-queue-localqueued"]);
00362         if (queue["nordugrid-queue-localqueued"])
00363           target.LocalWaitingJobs =
00364             stringtoi((std::string)queue["nordugrid-queue-localqueued"]);
00365         if (queue["nordugrid-queue-prelrmsqueued"])
00366           target.PreLRMSWaitingJobs =
00367             stringtoi((std::string)queue["nordugrid-queue-prelrmsqueued"]);
00368         target.TotalJobs =
00369           (target.RunningJobs > 0) ? target.RunningJobs : 0 +
00370           (target.WaitingJobs > 0) ? target.WaitingJobs : 0 +
00371           (target.PreLRMSWaitingJobs > 0) ? target.PreLRMSWaitingJobs : 0;
00372         if (authuser["nordugrid-authuser-freecpus"]) {
00373           std::string value =
00374             (std::string)authuser["nordugrid-authuser-freecpus"];
00375           std::string::size_type pos = 0;
00376           do {
00377             std::string::size_type spacepos = value.find(' ', pos);
00378             std::string entry;
00379             if (spacepos == std::string::npos)
00380               entry = value.substr(pos);
00381             else
00382               entry = value.substr(pos, spacepos - pos);
00383             int num_cpus;
00384             Period time;
00385             std::string::size_type colonpos = entry.find(':');
00386             if (colonpos == std::string::npos) {
00387               num_cpus = stringtoi(entry);
00388               time = LONG_MAX;
00389             }
00390             else {
00391               num_cpus = stringtoi(entry.substr(0, colonpos));
00392               time = stringtoi(entry.substr(colonpos + 1)) * 60;
00393             }
00394             target.FreeSlotsWithDuration[time] = num_cpus;
00395             pos = spacepos;
00396             if (pos != std::string::npos)
00397               pos++;
00398           } while (pos != std::string::npos);
00399           target.FreeSlots = target.FreeSlotsWithDuration.begin()->second;
00400         }
00401         if (cluster["nordugrid-queue-usedcpus"])
00402           target.UsedSlots =
00403             stringtoi((std::string)cluster["nordugrid-queue-usedcpus"]);
00404         if (cluster["nordugrid-queue-schedulingpolicy"])
00405           target.ReservationPolicy =
00406             (std::string)cluster["nordugrid-queue-schedulingpolicy"];
00407 
00408         // Computing Manager attributes
00409         if (cluster["nordugrid-cluster-lrms-type"])
00410           target.ManagerProductName =
00411             (std::string)cluster["nordugrid-cluster-lrms-type"];
00412         if (cluster["nordugrid-cluster-lrms-version"])
00413           target.ManagerProductVersion =
00414             (std::string)cluster["nordugrid-cluster-lrms-version"];
00415         if (queue["nordugrid-queue-totalcpus"])
00416           target.TotalPhysicalCPUs =
00417           target.TotalLogicalCPUs =
00418           target.TotalSlots =
00419             stringtoi((std::string)queue["nordugrid-queue-totalcpus"]);
00420         else if (cluster["nordugrid-cluster-totalcpus"])
00421           target.TotalPhysicalCPUs =
00422           target.TotalLogicalCPUs =
00423           target.TotalSlots =
00424             stringtoi((std::string)cluster["nordugrid-cluster-totalcpus"]);
00425         if (queue["nordugrid-queue-homogeneity"]) {
00426           if ((std::string)queue["nordugrid-queue-homogeneity"] == "false")
00427             target.Homogeneous = false;
00428         }
00429         else if (cluster["nordugrid-cluster-homogeneity"])
00430           if ((std::string)cluster["nordugrid-cluster-homogeneity"] == "false")
00431             target.Homogeneous = false;
00432         if (cluster["nordugrid-cluster-sessiondir-total"])
00433           target.WorkingAreaTotal =
00434             stringtoi((std::string)
00435                       cluster["nordugrid-cluster-sessiondir-total"]) / 1000;
00436         if (cluster["nordugrid-cluster-sessiondir-free"])
00437           target.WorkingAreaFree =
00438             stringtoi((std::string)
00439                       cluster["nordugrid-cluster-sessiondir-free"]) / 1000;
00440         if (cluster["nordugrid-cluster-sessiondir-lifetime"])
00441           target.WorkingAreaLifeTime =
00442             (std::string)cluster["nordugrid-cluster-sessiondir-lifetime"];
00443         if (cluster["nordugrid-cluster-cache-total"])
00444           target.CacheTotal =
00445             stringtoi((std::string)cluster["nordugrid-cluster-cache-total"]) / 1000;
00446         if (cluster["nordugrid-cluster-cache-free"])
00447           target.CacheFree =
00448             stringtoi((std::string)cluster["nordugrid-cluster-cache-free"]) / 1000;
00449 
00450         // Benchmarks
00451         if (queue["nordugrid-queue-benchmark"])
00452           for (XMLNode n = queue["nordugrid-queue-benchmark"]; n; ++n) {
00453             std::string benchmark = (std::string)n;
00454             std::string::size_type alpha = benchmark.find_first_of("@");
00455             std::string benchmarkname = benchmark.substr(0, alpha);
00456             double performance = stringtod(benchmark.substr(alpha + 1));
00457             target.Benchmarks[benchmarkname] = performance;
00458           }
00459         else if (cluster["nordugrid-cluster-benchmark"])
00460           for (XMLNode n = cluster["nordugrid-cluster-benchmark"]; n; ++n) {
00461             std::string benchmark = (std::string)n;
00462             std::string::size_type alpha = benchmark.find_first_of("@");
00463             std::string benchmarkname = benchmark.substr(0, alpha);
00464             double performance = stringtod(benchmark.substr(alpha + 1));
00465             target.Benchmarks[benchmarkname] = performance;
00466           }
00467 
00468         // Execution Environment attributes
00469         if (queue["nordugrid-queue-architecture"])
00470           target.Platform =
00471             (std::string)queue["nordugrid-queue-architecture"];
00472         else if (cluster["nordugrid-cluster-architecture"])
00473           target.Platform =
00474             (std::string)cluster["nordugrid-cluster-architecture"];
00475         if (queue["nordugrid-queue-nodecpu"]) {
00476           target.CPUVendor =
00477             (std::string)queue["nordugrid-queue-nodecpu"];
00478           target.CPUModel =
00479             (std::string)queue["nordugrid-queue-nodecpu"];
00480           target.CPUVersion =
00481             (std::string)queue["nordugrid-queue-nodecpu"];
00482           // target.CPUClockSpeed =
00483           //   (std::string)queue["nordugrid-queue-nodecpu"];
00484         }
00485         else if (cluster["nordugrid-cluster-nodecpu"]) {
00486           target.CPUVendor =
00487             (std::string)cluster["nordugrid-cluster-nodecpu"];
00488           target.CPUModel =
00489             (std::string)cluster["nordugrid-cluster-nodecpu"];
00490           target.CPUVersion =
00491             (std::string)cluster["nordugrid-cluster-nodecpu"];
00492           // target.CPUClockSpeed =
00493           //   (std::string)queue["nordugrid-cluster-nodecpu"];
00494         }
00495         if (queue["nordugrid-queue-nodememory"])
00496           target.MainMemorySize =
00497             stringtoi((std::string)queue["nordugrid-queue-nodememory"]);
00498         else if (cluster["nordugrid-cluster-nodememory"])
00499           target.MainMemorySize =
00500             stringtoi((std::string)cluster["nordugrid-cluster-nodememory"]);
00501         if (queue["nordugrid-queue-opsys"])
00502           target.OperatingSystem = Software((std::string)queue["nordugrid-queue-opsys"][0],
00503                                             (std::string)queue["nordugrid-queue-opsys"][1]);
00504         else if (cluster["nordugrid-cluster-opsys"])
00505           target.OperatingSystem = Software((std::string)cluster["nordugrid-cluster-opsys"][0],
00506                                             (std::string)cluster["nordugrid-cluster-opsys"][1]);
00507         if (cluster["nordugrid-cluster-nodeaccess"])
00508           for (XMLNode n = cluster["nordugrid-cluster-nodeaccess"]; n; ++n)
00509             if ((std::string)n == "inbound")
00510               target.ConnectivityIn = true;
00511             else if ((std::string)n == "outbound")
00512               target.ConnectivityOut = true;
00513 
00514         // Application Environments
00515         for (XMLNode n = cluster["nordugrid-cluster-runtimeenvironment"];
00516              n; ++n) {
00517           ApplicationEnvironment rte((std::string)n);
00518           rte.State = "UNDEFINEDVALUE";
00519           rte.FreeSlots = -1;
00520           rte.FreeUserSeats = -1;
00521           rte.FreeJobs = -1;
00522           target.ApplicationEnvironments.push_back(rte);
00523         }
00524 
00525         // Register target in TargetGenerator list
00526         mom.AddTarget(target);
00527       }
00528     }
00529     else if (targetType == 1) {
00530 
00531       XMLNodeList jobs =
00532         xmlresult.XPathLookup("//nordugrid-job-globalid"
00533                               "[objectClass='nordugrid-job']", NS());
00534 
00535       for (XMLNodeList::iterator it = jobs.begin(); it != jobs.end(); it++) {
00536 
00537         NS ns;
00538         XMLNode info(ns, "Job");
00539 
00540         if ((*it)["nordugrid-job-globalid"])
00541           info.NewChild("JobID") =
00542             (std::string)(*it)["nordugrid-job-globalid"];
00543         if ((*it)["nordugrid-job-jobname"])
00544           info.NewChild("Name") = (std::string)(*it)["nordugrid-job-jobname"];
00545         if ((*it)["nordugrid-job-submissiontime"])
00546           info.NewChild("LocalSubmissionTime") =
00547             (std::string)(*it)["nordugrid-job-submissiontime"];
00548 
00549         info.NewChild("Flavour") = "ARC0";
00550         info.NewChild("Cluster") = url.str();
00551 
00552         URL infoEndpoint(url);
00553         infoEndpoint.ChangeLDAPFilter("(nordugrid-job-globalid=" +
00554                                       (std::string)
00555                                       (*it)["nordugrid-job-globalid"] + ")");
00556         infoEndpoint.ChangeLDAPScope(URL::subtree);
00557 
00558         info.NewChild("InfoEndpoint") = infoEndpoint.str();
00559 
00560         mom.AddJob(info);
00561       }
00562     }
00563 
00564     delete thrarg;
00565     mom.RetrieverDone();
00566   }
00567 
00568 } // namespace Arc