Back to index

nordugrid-arc-nox  1.1.0~rc6
get_factory_document.cpp
Go to the documentation of this file.
00001 #ifdef HAVE_CONFIG_H
00002 #include <config.h>
00003 #endif
00004 
00005 #include "grid_sched.h"
00006 
00007 namespace GridScheduler
00008 {
00009 
00010 Arc::MCC_Status 
00011 GridSchedulerService::GetFactoryAttributesDocument(Arc::XMLNode & /* in */,Arc::XMLNode & /* out */) 
00012 {
00013 #if 0
00014     /*
00015     GetFactoryAttributesDocument
00016 
00017     GetFactoryAttributesDocumentResponse
00018         FactoryResourceAttributesDocument
00019             BasicResourceAttributesDocument (optional)
00020             IsAcceptingNewActivities (boolean)
00021             CommonName (optional,string)
00022             LongDescription (optional,string)
00023             TotalNumberOfActivities (long)
00024             ActivityReference (wsa:EndpointReferenceType,unbounded)
00025             TotalNumberOfContainedResources (long)
00026             ContainedResource (anyType,unbounded)
00027             NamingProfile (anyURI,unbounded)
00028             BESExtension (anyURI,unbounded)
00029             LocalResourceManagerType (anyURI)
00030     */
00031     {
00032         std::string s;
00033         in.GetXML(s);
00034         logger.msg(Arc::VERBOSE, "GetFactoryAttributesDocument: request = \n%s", s);
00035     };
00036     Arc::XMLNode doc = out.NewChild("bes-factory:FactoryResourceAttributesDocument");
00037     doc.NewChild("bes-factory:IsAcceptingNewActivities") = (IsAcceptingNewActivities ? "true": "false");
00038     doc.NewChild("bes-factory:TotalNumberOfActivities") = Arc::tostring(jobq.size());
00039     std::map<const std::string, Job *> all_job = jobq.getAllJobs();
00040     std::map<const std::string, Job *>::iterator iter;
00041     for (iter = all_job.begin(); iter != all_job.end(); iter++) {
00042         Arc::WSAEndpointReference identifier(doc.NewChild("bes-factory:ActivityReference"));
00043         // Make job's ID
00044         identifier.Address(endpoint); // address of service
00045         identifier.ReferenceParameters().NewChild("sched:JobID") = iter->first;
00046     };
00047 
00048     doc.NewChild("bes-factory:TotalNumberOfContainedResources") = Arc::tostring(resources.size());
00049     doc.NewChild("bes-factory:NamingProfile") = "http://schemas.ggf.org/bes/2006/08/bes/naming/BasicWSAddressing";
00050     doc.NewChild("bes-factory:BESExtension") = "http://www.nordugrid.org/schemas/a-rex";
00051     doc.NewChild("bes-factory:LocalResourceManagerType") = "uri:unknown";
00052     {
00053         std::string s;
00054         out.GetXML(s);
00055         logger.msg(Arc::VERBOSE, "GetFactoryAttributesDocument: response = \n%s", s);
00056     };
00057 #endif
00058     return Arc::MCC_Status(Arc::STATUS_OK);
00059 }
00060 
00061 } // namespace