Back to index

nordugrid-arc-nox  1.1.0~rc6
grid_sched.h
Go to the documentation of this file.
00001 #ifndef __ARC_SCHED_H__
00002 #define __ARC_SCHED_H__
00003 
00004 #include <arc/infosys/RegisteredService.h>
00005 #include <arc/message/Service.h>
00006 #include <arc/delegation/DelegationInterface.h>
00007 #include <arc/infosys/InformationInterface.h>
00008 
00009 #include "job_queue.h"
00010 #include "resources_handling.h"
00011 
00012 namespace GridScheduler {
00013 
00014 // Sched job queue initializator
00015 
00016 class GridSchedulerService: public Arc::RegisteredService {
00017     private:
00018         bool IsAcceptingNewActivities;
00019         Arc::JobQueue jobq;
00020         ResourcesHandling resources;
00021         std::string db_path;
00022         std::string endpoint;
00023         std::map<std::string, std::string> cli_config;
00024         int lifetime_after_done;
00025         int reschedule_period;
00026         int reschedule_wait;
00027         int period;
00028         int timeout;
00029         Arc::NS ns_;
00030         Arc::Logger logger_;
00031         Arc::DelegationContainerSOAP delegations_;
00032         Arc::InformationContainer infodoc_;
00033         // BES Interface
00034         Arc::MCC_Status CreateActivity(Arc::XMLNode &in, Arc::XMLNode &out);
00035         Arc::MCC_Status GetActivityStatuses(Arc::XMLNode &in, 
00036                                             Arc::XMLNode &out);
00037         Arc::MCC_Status TerminateActivities(Arc::XMLNode &in, 
00038                                             Arc::XMLNode &out);
00039         Arc::MCC_Status GetFactoryAttributesDocument(Arc::XMLNode &in, 
00040                                                      Arc::XMLNode &out);
00041         Arc::MCC_Status StopAcceptingNewActivities(Arc::XMLNode &in, 
00042                                                    Arc::XMLNode &out);
00043         Arc::MCC_Status StartAcceptingNewActivities(Arc::XMLNode &in, 
00044                                                     Arc::XMLNode &out);
00045         Arc::MCC_Status ChangeActivityStatus(Arc::XMLNode &in, 
00046                                              Arc::XMLNode &out);
00047         // iBES Interface
00048         Arc::MCC_Status GetActivities(Arc::XMLNode &in, 
00049                                       Arc::XMLNode &out, 
00050                                       const std::string &resource_id);
00051         Arc::MCC_Status ReportActivitiesStatus(Arc::XMLNode &in, 
00052                                                Arc::XMLNode &out, 
00053                                             const std::string &resource_id);
00054         Arc::MCC_Status GetActivitiesStatusChanges(Arc::XMLNode &in, 
00055                                                    Arc::XMLNode &out, 
00056                                             const std::string &resource_id);
00057 
00058         // WS-Propoerty Interface
00059         Arc::MCC_Status GetActivityDocuments(Arc::XMLNode &in, 
00060                                              Arc::XMLNode &out);
00061         // Fault handlers
00062         Arc::MCC_Status make_soap_fault(Arc::Message& outmsg);
00063         bool match(Arc::XMLNode &in, Arc::Job *j);
00064     public:
00065         GridSchedulerService(Arc::Config *cfg);
00066         virtual ~GridSchedulerService(void);
00067         virtual Arc::MCC_Status process(Arc::Message& inmsg,
00068                                         Arc::Message& outmsg);
00069         void doSched(void);
00070         void doReschedule(void);
00071         int getPeriod(void) { return period; };
00072         int getReschedulePeriod(void) { return reschedule_period; };
00073         void InformationCollector(void);
00074         virtual bool RegistrationCollector(Arc::XMLNode &doc);
00075 }; // class GridSchedulerService
00076 
00077 } // namespace GridScheduler
00078 
00079 #endif
00080