Back to index

nordugrid-arc-nox  1.1.0~rc6
Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | Private Member Functions | Private Attributes
GridScheduler::GridSchedulerService Class Reference

#include <grid_sched.h>

Inheritance diagram for GridScheduler::GridSchedulerService:
Inheritance graph
[legend]
Collaboration diagram for GridScheduler::GridSchedulerService:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 GridSchedulerService (Arc::Config *cfg)
virtual ~GridSchedulerService (void)
virtual Arc::MCC_Status process (Arc::Message &inmsg, Arc::Message &outmsg)
 Method for processing of requests and responses.
void doSched (void)
void doReschedule (void)
int getPeriod (void)
int getReschedulePeriod (void)
void InformationCollector (void)
virtual bool RegistrationCollector (Arc::XMLNode &doc)
 Service specific registartion collector, used for generate service registartions.
virtual void AddSecHandler (Config *cfg, ArcSec::SecHandler *sechandler, const std::string &label="")
 Add security components/handlers to this MCC.
virtual std::string getID ()
 Service may implement own service identitifer gathering method.

Protected Member Functions

bool ProcessSecHandlers (Message &message, const std::string &label="") const
 Executes security handlers of specified queue.

Protected Attributes

std::map< std::string,
std::list< ArcSec::SecHandler * > > 
sechandlers_
 Set of labeled authentication and authorization handlers.

Static Protected Attributes

static Logger logger
 Logger object used to print messages generated by this class.

Private Member Functions

Arc::MCC_Status CreateActivity (Arc::XMLNode &in, Arc::XMLNode &out)
Arc::MCC_Status GetActivityStatuses (Arc::XMLNode &in, Arc::XMLNode &out)
Arc::MCC_Status TerminateActivities (Arc::XMLNode &in, Arc::XMLNode &out)
Arc::MCC_Status GetFactoryAttributesDocument (Arc::XMLNode &in, Arc::XMLNode &out)
Arc::MCC_Status StopAcceptingNewActivities (Arc::XMLNode &in, Arc::XMLNode &out)
Arc::MCC_Status StartAcceptingNewActivities (Arc::XMLNode &in, Arc::XMLNode &out)
Arc::MCC_Status ChangeActivityStatus (Arc::XMLNode &in, Arc::XMLNode &out)
Arc::MCC_Status GetActivities (Arc::XMLNode &in, Arc::XMLNode &out, const std::string &resource_id)
Arc::MCC_Status ReportActivitiesStatus (Arc::XMLNode &in, Arc::XMLNode &out, const std::string &resource_id)
Arc::MCC_Status GetActivitiesStatusChanges (Arc::XMLNode &in, Arc::XMLNode &out, const std::string &resource_id)
Arc::MCC_Status GetActivityDocuments (Arc::XMLNode &in, Arc::XMLNode &out)
Arc::MCC_Status make_soap_fault (Arc::Message &outmsg)
bool match (Arc::XMLNode &in, Arc::Job *j)

Private Attributes

bool IsAcceptingNewActivities
Arc::JobQueue jobq
ResourcesHandling resources
std::string db_path
std::string endpoint
std::map< std::string,
std::string > 
cli_config
int lifetime_after_done
int reschedule_period
int reschedule_wait
int period
int timeout
Arc::NS ns_
Arc::Logger logger_
Arc::DelegationContainerSOAP delegations_
Arc::InformationContainer infodoc_

Detailed Description

Definition at line 16 of file grid_sched.h.


Constructor & Destructor Documentation

Definition at line 357 of file grid_sched.cpp.

                                                        :RegisteredService(cfg),logger_(Arc::Logger::rootLogger, "GridScheduler") 
{
    // Define supported namespaces
    // XXX use defs from ARC1 LIBS
    ns_["a-rex"]="http://www.nordugrid.org/schemas/a-rex";
    ns_["bes-factory"]="http://schemas.ggf.org/bes/2006/08/bes-factory";
    ns_["deleg"]="http://www.nordugrid.org/schemas/delegation";
    ns_["wsa"]="http://www.w3.org/2005/08/addressing";
    ns_["jsdl"]="http://schemas.ggf.org/jsdl/2005/11/jsdl";
    ns_["wsrf-bf"]="http://docs.oasis-open.org/wsrf/bf-2";
    ns_["wsrf-r"]="http://docs.oasis-open.org/wsrf/r-2";
    ns_["wsrf-rw"]="http://docs.oasis-open.org/wsrf/rw-2";
    ns_["ibes"]="http://www.nordugrid.org/schemas/ibes";
    ns_["sched"]="http://www.nordugrid.org/schemas/sched";
    ns_["bes-mgmt"]="http://schemas.ggf.org/bes/2006/08/bes-management";
    
    // Read configs 
    endpoint = (std::string)((*cfg)["Endpoint"]);
    period = Arc::stringtoi((std::string)((*cfg)["SchedulingPeriod"]));
    db_path = (std::string)((*cfg)["DataDirectoryPath"]);
    if (!Glib::file_test(db_path, Glib::FILE_TEST_IS_DIR)) {
        if (mkdir(db_path.c_str(), 0700) != 0) {
            logger.msg(Arc::ERROR, "cannot create directory: %s", db_path);
            return;
        }
    }
    try {
        jobq.init(db_path, "jobq");
    } catch (std::exception &e) {
        logger_.msg(Arc::ERROR, "Error during database open: %s", e.what());
        return;
    }
    timeout = Arc::stringtoi((std::string)((*cfg)["Timeout"]));
    reschedule_period = Arc::stringtoi((std::string)((*cfg)["ReschedulePeriod"]));
    lifetime_after_done = Arc::stringtoi((std::string)((*cfg)["LifetimeAfterDone"]));  
    reschedule_wait = Arc::stringtoi((std::string)((*cfg)["RescheduleWaitTime"]));  
    cli_config["CertificatePath"] = (std::string)((*cfg)["arccli:CertificatePath"]);
    cli_config["PrivateKey"] = (std::string)((*cfg)["arccli:PrivateKey"]);  
    cli_config["CACertificatePath"] = (std::string)((*cfg)["arccli:CACertificatePath"]);  
    IsAcceptingNewActivities = true;

    CreateThreadFunction(&thread_starter,this);
  
    if (period > 0) { 
        // start scheduler thread
        Arc::CreateThreadFunction(&sched, this);
    }
    if (reschedule_period > 0) {
        // Rescheduler thread
        Arc::CreateThreadFunction(&reschedule, this);
    }

}

Here is the call graph for this function:

Definition at line 412 of file grid_sched.cpp.

{
    // NOP
}

Member Function Documentation

void Arc::Service::AddSecHandler ( Config cfg,
ArcSec::SecHandler sechandler,
const std::string &  label = "" 
) [virtual, inherited]

Add security components/handlers to this MCC.

For more information please see description of MCC::AddSecHandler

Definition at line 14 of file Service.cpp.

                                                                                           {
    if(sechandler) {
        sechandlers_[label].push_back(sechandler); //need polishing to put the SecHandlerFactory->getinstance here
        XMLNode cn = (*cfg)["SecHandler"];
        Config cfg_(cn);
    }
}

Here is the caller graph for this function:

Definition at line 208 of file bes.cpp.

{
    Arc::XMLNode id;
    for (int n = 0; (id = in["ActivityIdentifier"][n]) != false; n++) {
        std::string jobid = Arc::WSAEndpointReference(id).ReferenceParameters()["sched:JobID"];
        if (jobid.empty()) {
            // EPR is wrongly formated
            continue;
        }
        std::string old_state = (std::string)in["NewStatus"][n];
        std::string new_state = (std::string)in["OldStatus"][n];
        if (old_state.empty() || new_state.empty()) {
            // Not defined status
            continue;
        }
        try {
            Arc::Job *j = jobq[jobid];
            Arc::SchedJobStatus state = Arc::sched_status_from_string(new_state);
            j->setStatus(state);
            jobq.refresh(*j);
            // Create place for response
            Arc::XMLNode resp = out.NewChild("bes-factory:Response");
            resp.NewChild(id);
            Arc::XMLNode n_status = resp.NewChild("bes-factory:NewStatus");
            n_status = new_state;
            delete j;
        } catch (Arc::JobNotFoundException &e) {
            logger_.msg(Arc::ERROR, "ChangeActivityStatuses: job %s not found", jobid);
            Arc::SOAPEnvelope fault(ns_, true);
            if (fault) {
                fault.Fault()->Code(Arc::SOAPFault::Sender);
                fault.Fault()->Reason("Unknown activity");
                Arc::XMLNode f = fault.Fault()->Detail(true).NewChild("bes-factory:UnknownActivityIdentifierFault");
                out.Replace(fault.Child());
            } else {
                logger_.msg(Arc::ERROR, "Cannot create SOAP fault");
            }
            return Arc::MCC_Status();
        } catch (std::exception &e) {
            logger_.msg(Arc::ERROR, "Fatal error: %s", e.what());
            return Arc::MCC_Status();
        }
    }
    return Arc::MCC_Status(Arc::STATUS_OK);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 11 of file bes.cpp.

{
    if (IsAcceptingNewActivities == false) {
        // send fault if we not accepting activity
        Arc::SOAPEnvelope fault(ns_, true);
        if (fault) {
            fault.Fault()->Code(Arc::SOAPFault::Sender);
            fault.Fault()->Reason("The BES is not currently accepting new activities.");
            Arc::XMLNode f = fault.Fault()->Detail(true).NewChild("bes-factory:NotAcceptingNewActivities");
            out.Replace(fault.Child());
        } else {
            logger_.msg(Arc::ERROR, "Cannot create SOAP fault");
        }
        return Arc::MCC_Status();
    }
    
    std::string delegation;
    Arc::XMLNode delegated_token = in["deleg:DelegatedToken"];
    if (delegated_token) {
        // Client wants to delegate credentials
        if (!delegations_.DelegatedToken(delegation, delegated_token)) {
            logger_.msg(Arc::ERROR, "Failed to accept delegation");
            Arc::SOAPEnvelope fault(ns_, true);
            if (fault) {
                fault.Fault()->Code(Arc::SOAPFault::Receiver);
                fault.Fault()->Reason("Failed to accept delegation");
                out.Replace(fault.Child());
            } else {
                logger_.msg(Arc::ERROR, "Cannot create SOAP fault");
            }
            return Arc::MCC_Status();
        }
    }  
    
    Arc::XMLNode jsdl;
    for (int i = 0; (jsdl = in["ActivityDocument"][i]["JobDefinition"]) != false; i++) {
    /* 
    if (!jsdl) {
        logger_.msg(Arc::ERROR, "CreateActivity: no job description found");
        Arc::SOAPEnvelope fault(ns_, true);
        if (fault) {
            fault.Fault()->Code(Arc::SOAPFault::Sender);
            fault.Fault()->Reason("Can't find JobDefinition element in request");
            Arc::XMLNode f = fault.Fault()->Detail(true).NewChild("bes-factory:InvalidRequestMessageFault");
            f.NewChild("bes-factory:InvalidElement") = "jsdl:JobDefinition";
            f.NewChild("bes-factory:Message") = "Element is missing";
            out.Replace(fault.Child());
        } else {
            logger_.msg(Arc::ERROR, "Cannot create SOAP fault");
        }
        return Arc::MCC_Status();
    } */
    
        // Create job
        Arc::JobRequest job_request(jsdl);
        Arc::JobSchedMetaData sched_meta;
        Arc::Job job(job_request, sched_meta);

        if (!job) {
            std::string failure = job.getFailure();
            logger_.msg(Arc::ERROR, "CreateActivity: Failed to create new job: %s", failure);
            Arc::SOAPEnvelope fault(ns_,true);
            if(fault) {
                fault.Fault()->Code(Arc::SOAPFault::Receiver);
                fault.Fault()->Reason("Can't create new activity: " + failure);
                out.Replace(fault.Child());
            } else {
                logger_.msg(Arc::ERROR, "Cannot create SOAP fault");
            }
            return Arc::MCC_Status();
        }
        
        // save job
        job.setStatus(Arc::JOB_STATUS_SCHED_NEW);
        jobq.refresh(job);
    
        // Make SOAP response
        Arc::WSAEndpointReference identifier(out.NewChild("bes-factory:ActivityIdentifier"));
        // Make job's ERP
        identifier.Address(endpoint); // address of service
        identifier.ReferenceParameters().NewChild("sched:JobID") = job.getID();
        identifier.ReferenceParameters().NewChild("a-rex:JobSessionDir")=endpoint+"/"+job.getID();
        identifier.ReferenceParameters().NewChild("a-rex:JobID") = job.getID();
        out.NewChild(in["ActivityDocument"]);
    }
    logger_.msg(Arc::VERBOSE, "CreateActivity finished successfully");
    return Arc::MCC_Status(Arc::STATUS_OK);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 314 of file grid_sched.cpp.

{
    logger_.msg(Arc::VERBOSE, "doReschedule");
    for (Arc::JobQueueIterator jobs = jobq.getAll(); jobs.hasMore(); jobs++){
        Arc::Job *j = *jobs;
        Arc::JobSchedMetaData *m = j->getJobSchedMetaData();
        Arc::Time now;
        Arc::Period p(reschedule_wait);
        m->setLastChecked(now);
        Arc::SchedJobStatus status = j->getStatus();
        if (status == Arc::JOB_STATUS_SCHED_FAILED ||
            status == Arc::JOB_STATUS_SCHED_NEW ||
            status == Arc::JOB_STATUS_SCHED_KILLING ||
            status == Arc::JOB_STATUS_SCHED_KILLED ||
            status == Arc::JOB_STATUS_SCHED_FINISHED) {
            // ignore this states
            jobs.refresh();
            continue;
        }
        logger_.msg(Arc::VERBOSE, "check: %s (%s - %s > %s (%s))", j->getID(), (std::string)now, (std::string)m->getLastChecked(), (std::string)(m->getLastUpdated() + p), (std::string)m->getLastUpdated());
        if (m->getLastChecked() > (m->getLastUpdated() + p)) {
            logger_.msg(Arc::VERBOSE, "Rescheduled job: %s", j->getID());
            j->setStatus(Arc::JOB_STATUS_SCHED_RESCHEDULED);
            m->setResourceID("");
        }
        jobs.refresh();
    }
}

Here is the call graph for this function:

Definition at line 179 of file grid_sched.cpp.

{   
    logger_.msg(Arc::VERBOSE, "doSched");
    jobq.checkpoint();
    logger_.msg(Arc::VERBOSE, "jobq checkpoint done");
#if 0
    // log status
    logger_.msg(Arc::VERBOSE, "Count of jobs: %i"
                " Count of resources: %i"
                " Scheduler period: %i"
                " Endpoint: %s"
                " DBPath: %s",
                sched_queue.size(), sched_resources.size(),
                getPeriod(), endpoint, db_path);

    // searching for new sched jobs:
    std::map<const std::string, Job *> new_jobs = sched_queue.getJobsWithState(NEW);
    // submit new jobs
    // XXX make it two step: collect job and mark them to going to submit, lock the queue until this, and do the submit after it
    std::map<const std::string, Job *>::iterator iter;
    for (iter = new_jobs.begin(); iter != new_jobs.end(); iter++) {
        const std::string &job_id = iter->first;
        logger_.msg(Arc::VERBOSE, "NEW job: %s", job_id);
        Resource &arex = sched_resources.random();
        Job *j = iter->second;
        Arc::XMLNode &jsdl = j->getJSDL();
        // XXX better error handling
        std::string arex_job_id = arex.CreateActivity(jsdl);
        logger_.msg(Arc::VERBOSE, "A-REX ID: %s", arex.getURL());
        if (arex_job_id != "") {
            j->setResourceJobID(arex_job_id);
            j->setResourceID(arex.getURL());
            j->setStatus(STARTING);
        } else {
            logger_.msg(Arc::VERBOSE, "Sched job ID: %s NOT SUBMITTED", job_id);
            sched_resources.refresh(arex.getURL());
        }
        j->save();
    }
#endif
    // search for job which are killed by user
    StatusJobSelector sel(Arc::JOB_STATUS_SCHED_KILLING);
    for (Arc::JobQueueIterator jobs = jobq.getAll((Arc::JobSelector *)&sel); jobs.hasMore(); jobs++){
        Arc::Job *j = *jobs;
        Arc::JobSchedMetaData *m = j->getJobSchedMetaData();
        if (m->getResourceID().empty()) {
            logger_.msg(Arc::VERBOSE, "%s set killed", j->getID());
            j->setStatus(Arc::JOB_STATUS_SCHED_KILLED);
            m->setEndTime(Arc::Time());
        } 
        /*
        else {
            Resource &arex = sched_resources.get(j->getResourceID());
            if (arex.TerminateActivity(arex_job_id)) {
                logger_.msg(Arc::VERBOSE, "JobID: %s KILLED", job_id);
                j->setStatus(KILLED);
                sched_queue.removeJob(job_id);
            }
        } */
        jobs.refresh();
    }

    // cleanup jobq
    for (Arc::JobQueueIterator jobs = jobq.getAll(); jobs.hasMore(); jobs++)
    {
        Arc::Job *j = *jobs;
        Arc::JobSchedMetaData *m = j->getJobSchedMetaData();
        Arc::SchedJobStatus status = j->getStatus();
        if (status == Arc::JOB_STATUS_SCHED_FINISHED
            || status == Arc::JOB_STATUS_SCHED_KILLED
            || status == Arc::JOB_STATUS_SCHED_FAILED
            || status == Arc::JOB_STATUS_SCHED_UNKNOWN)
        {
            Arc::Period p(lifetime_after_done);
            Arc::Time now;
            if (now > (m->getEndTime() + p)) {
                logger_.msg(Arc::VERBOSE, "%s remove from queue", j->getID());
                jobs.remove();
            }
        }
    }

#if 0
    // query a-rexes for the job statuses:
    std::map<const std::string, Job *> all_job = sched_queue.getAllJobs();
    for (iter = all_job.begin(); iter != all_job.end(); iter++) {
        const std::string &job_id = iter->first;
        Job *j = iter->second;
        SchedStatusLevel job_stat = j->getStatus();
        // skip jobs with FINISHED state
        if (job_stat == FINISHED) {
            continue;
        }
        const std::string &arex_job_id = j->getResourceJobID();
        // skip unscheduled jobs
        if (arex_job_id.empty()) {
            logger_.msg(Arc::VERBOSE, "Sched job ID: %s (A-REX job ID is empty)", job_id);
            continue; 
        }
        // get state of the job at the resource
        Resource &arex = sched_resources.get(j->getResourceID());
        std::string state = arex.GetActivityStatus(arex_job_id);
        if (state == "UNKOWN") {
            if (!j->CheckTimeout()) {  // job timeout check
                j->setStatus(NEW);
                j->setResourceJobID("");
                j->setResourceID("");
                j->save();
                sched_resources.refresh(arex.getURL());
                // std::string url = arex.getURL();
                // sched_resources.removeResource(url);
                logger_.msg(Arc::VERBOSE, "Job RESCHEDULE: %s", job_id);
            }
        } else {
            // refresh status from A-REX state
            job_stat = sched_status_from_arex_status(state); 
            j->setStatus(job_stat);
            j->save();
            logger_.msg(Arc::VERBOSE, "JobID: %s state: %s", job_id, state);
        }
    }
#endif
}

Here is the call graph for this function:

Arc::MCC_Status GridScheduler::GridSchedulerService::GetActivities ( Arc::XMLNode in,
Arc::XMLNode out,
const std::string &  resource_id 
) [private]

Definition at line 74 of file ibes.cpp.

{
    {
        std::string s;
        in.GetXML(s);
        logger_.msg(Arc::VERBOSE, s);
    }
    Arc::XMLNode activities = out.NewChild("ibes:Activities");
    // create resource
    if (resource_id.empty()) {
        logger_.msg(Arc::WARNING, "Cannot get resource ID");
        return Arc::MCC_Status(Arc::STATUS_OK);
    }
    
    // XXX error handling
    Arc::Job *job = NULL;
    Arc::XMLNode domain = in.Child(0);
    MatchSelector *selector = new MatchSelector(domain);
    for (Arc::JobQueueIterator jobs = jobq.getAll((Arc::JobSelector *)selector); 
         jobs.hasMore(); jobs++){
        Arc::Job *j = *jobs;
        Arc::XMLNode a = activities.NewChild("ibes:Activity");
    
        // Make job's ID
        Arc::WSAEndpointReference identifier(a.NewChild("ibes:ActivityIdentifier"));
        identifier.Address(endpoint); // address of this service
        identifier.ReferenceParameters().NewChild("sched:JobID") = j->getID();
        Arc::XMLNode activity_doc = a.NewChild("ibes:ActivityDocument");
        activity_doc.NewChild(j->getJSDL());
        j->setStatus(Arc::JOB_STATUS_SCHED_STARTING);
        // set job scheduling meta data
        Arc::JobSchedMetaData *m = j->getJobSchedMetaData();
        m->setResourceID(resource_id);
        Arc::Time now;
        m->setLastUpdated(now);
        m->setLastChecked(now);
        // save job state
        if (jobs.refresh() == true) {
            // XXX only one job 
            return Arc::MCC_Status(Arc::STATUS_OK);
        } else {
            return Arc::MCC_Status();
        }
    }
    logger_.msg(Arc::VERBOSE, "NO job");
    return Arc::MCC_Status(Arc::STATUS_OK);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Arc::MCC_Status GridScheduler::GridSchedulerService::GetActivitiesStatusChanges ( Arc::XMLNode in,
Arc::XMLNode out,
const std::string &  resource_id 
) [private]

Definition at line 123 of file ibes.cpp.

{
    Arc::XMLNode id_node;
    Arc::XMLNode activities = out.NewChild("ibes:Activities");
    for (int i = 0; (id_node = in["ibes:ActivityIdentifier"][i]) != false; i++) {
        Arc::WSAEndpointReference id(id_node);
        std::string job_id = id.ReferenceParameters()["sched:JobID"];
        if (job_id.empty()) {
            logger_.msg(Arc::VERBOSE, "invalid job id");
            continue;
        }
        Arc::XMLNode activity = activities.NewChild("ibes:Activity");
        activity.NewChild(id_node); // copy identifier from inut
        Arc::XMLNode new_state = activity.NewChild("ibes:NewState");
        try {
            Arc::Job *j = jobq[job_id];
            Arc::SchedJobStatus status = j->getStatus();
            if (status == Arc::JOB_STATUS_SCHED_RESCHEDULED) {
                new_state = Arc::sched_status_to_string(Arc::JOB_STATUS_SCHED_KILLING);
            } else {
                new_state = Arc::sched_status_to_string(j->getStatus());
            }
            delete j;
        } catch (Arc::JobNotFoundException &e) {
            logger_.msg(Arc::ERROR, "Cannot find job id: %s", job_id);
            // said kill job ?
        }
    }
    return Arc::MCC_Status(Arc::STATUS_OK);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 255 of file bes.cpp.

{
    Arc::XMLNode id;
    for (int n = 0; (id = in["ActivityIdentifier"][n]) != false; n++) {
        // Create place for response
        Arc::XMLNode resp = out.NewChild("bes-factory:Response");
        resp.NewChild(id);
        std::string jobid = Arc::WSAEndpointReference(id).ReferenceParameters()["sched:JobID"];
        if (jobid.empty()) {
            // wrong ERP
            continue;
        }
        try {
            // Read JSDL of job
            Arc::XMLNode jsdl = resp.NewChild("bes-factory:JobDefinition");
            Arc::Job *j = jobq[jobid];
            jsdl = j->getJSDL();
            jsdl.Name("bes-factory:JobDefinition"); // Recovering namespace of element
            delete j;
        } catch (Arc::JobNotFoundException &e) {
            logger_.msg(Arc::ERROR, "GetActivityDocuments: job %s not found", jobid);
            Arc::SOAPEnvelope fault(ns_, true);
            if (fault) {
                fault.Fault()->Code(Arc::SOAPFault::Sender);
                fault.Fault()->Reason("Unknown activity");
                Arc::XMLNode f = fault.Fault()->Detail(true).NewChild("bes-factory:UnknownActivityIdentifierFault");
                out.Replace(fault.Child());
            } else {
                logger_.msg(Arc::ERROR, "Cannot create SOAP fault");
            }
            return Arc::MCC_Status();
        } catch (std::exception &e) {
            logger_.msg(Arc::ERROR, "Fatal error: %s", e.what());
            return Arc::MCC_Status();
        }
    }
    return Arc::MCC_Status(Arc::STATUS_OK);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 155 of file bes.cpp.

{
    Arc::XMLNode id;
    for (int n = 0; (id = in["ActivityIdentifier"][n]) != false; n++) {
        // Create place for response
        Arc::XMLNode resp = out.NewChild("bes-factory:Response");
        resp.NewChild(id);
        std::string jobid = Arc::WSAEndpointReference(id).ReferenceParameters()["sched:JobID"];
        if(jobid.empty()) {
            // EPR is wrongly formated
            continue;
        }
        try {
            Arc::Job *j = jobq[jobid];
            // Make response
            Arc::SchedJobStatus s = j->getStatus();
            Arc::XMLNode state = resp.NewChild("bes-factory:ActivityStatus");
            state.NewAttribute("bes-factory:state") = sched_status_to_string(s);
            Arc::JobSchedMetaData *m = j->getJobSchedMetaData();
            state.NewChild("sched:ResourceID") = m->getResourceID();
            Arc::Time &t1 = m->getCreatedTime();
            Arc::Time &t2 = m->getStartTime();
            Arc::Time &t3 = m->getEndTime();
            state.NewChild("sched:CreatedTime") = (std::string)t1;
            if (t1 != t2) {
                state.NewChild("sched:StartTime") = (std::string)t2;
            }
            if (t3 > t2) {
                state.NewChild("sched:EndTime") = (std::string)t3;
            }
            delete j;
        } catch (Arc::JobNotFoundException &e) {
            logger_.msg(Arc::ERROR, "GetActivityStatuses: job %s not found", jobid);
            Arc::SOAPEnvelope fault(ns_, true);
            if (fault) {
                fault.Fault()->Code(Arc::SOAPFault::Sender);
                fault.Fault()->Reason("Unknown activity");
                Arc::XMLNode f = fault.Fault()->Detail(true).NewChild("bes-factory:UnknownActivityIdentifierFault");
                out.Replace(fault.Child());
            } else {
                logger_.msg(Arc::ERROR, "Cannot create SOAP fault");
            }
            return Arc::MCC_Status();
        } catch (std::exception &e) {
            logger_.msg(Arc::ERROR, "Fatal error: %s", e.what());
            return Arc::MCC_Status();
        }
    }
    
    return Arc::MCC_Status(Arc::STATUS_OK);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 11 of file get_factory_document.cpp.

{
#if 0
    /*
    GetFactoryAttributesDocument

    GetFactoryAttributesDocumentResponse
        FactoryResourceAttributesDocument
            BasicResourceAttributesDocument (optional)
            IsAcceptingNewActivities (boolean)
            CommonName (optional,string)
            LongDescription (optional,string)
            TotalNumberOfActivities (long)
            ActivityReference (wsa:EndpointReferenceType,unbounded)
            TotalNumberOfContainedResources (long)
            ContainedResource (anyType,unbounded)
            NamingProfile (anyURI,unbounded)
            BESExtension (anyURI,unbounded)
            LocalResourceManagerType (anyURI)
    */
    {
        std::string s;
        in.GetXML(s);
        logger.msg(Arc::VERBOSE, "GetFactoryAttributesDocument: request = \n%s", s);
    };
    Arc::XMLNode doc = out.NewChild("bes-factory:FactoryResourceAttributesDocument");
    doc.NewChild("bes-factory:IsAcceptingNewActivities") = (IsAcceptingNewActivities ? "true": "false");
    doc.NewChild("bes-factory:TotalNumberOfActivities") = Arc::tostring(jobq.size());
    std::map<const std::string, Job *> all_job = jobq.getAllJobs();
    std::map<const std::string, Job *>::iterator iter;
    for (iter = all_job.begin(); iter != all_job.end(); iter++) {
        Arc::WSAEndpointReference identifier(doc.NewChild("bes-factory:ActivityReference"));
        // Make job's ID
        identifier.Address(endpoint); // address of service
        identifier.ReferenceParameters().NewChild("sched:JobID") = iter->first;
    };

    doc.NewChild("bes-factory:TotalNumberOfContainedResources") = Arc::tostring(resources.size());
    doc.NewChild("bes-factory:NamingProfile") = "http://schemas.ggf.org/bes/2006/08/bes/naming/BasicWSAddressing";
    doc.NewChild("bes-factory:BESExtension") = "http://www.nordugrid.org/schemas/a-rex";
    doc.NewChild("bes-factory:LocalResourceManagerType") = "uri:unknown";
    {
        std::string s;
        out.GetXML(s);
        logger.msg(Arc::VERBOSE, "GetFactoryAttributesDocument: response = \n%s", s);
    };
#endif
    return Arc::MCC_Status(Arc::STATUS_OK);
}

Here is the call graph for this function:

Here is the caller graph for this function:

virtual std::string Arc::Service::getID ( ) [inline, virtual, inherited]

Service may implement own service identitifer gathering method.

This method return identifier of service which is used for registering it Information Services.

Reimplemented in ARex::ARexService.

Definition at line 69 of file Service.h.

{ return ""; };

Definition at line 71 of file grid_sched.h.

{ return period; };

Here is the caller graph for this function:

Definition at line 72 of file grid_sched.h.

{ return reschedule_period; };

Definition at line 13 of file information_collector.cpp.

                                                    {
   for(;;) {

    std::string xml_str = "\
<arc:InfoRoot xmlns:glue=\"http://schemas.ogf.org/glue/2008/05/spec_2.0_d41_r01\" xmlns:arc=\"urn:knowarc\">\
  <Domains xmlns=\"http://schemas.ogf.org/glue/2008/05/spec_2.0_d41_r01\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://schemas.ogf.org/glue/2008/05/spec_2.0_d41_r01 pathto/GLUE2.xsd\">\
    <AdminDomain xmlns=\"http://schemas.ogf.org/glue/2008/05/spec_2.0_d41_r01\">\
      <Services xmlns=\"http://schemas.ogf.org/glue/2008/05/spec_2.0_d41_r01\">\
        <ComputingService BaseType=\"Service\" CreationTime=\"2009-07-16T07:55:47Z\" Validity=\"600\">\
          <Associations></Associations>\
          <Capability>executionmanagement.jobexecution</Capability>\
          <Complexity>endpoint=1,share=1,resource=1</Complexity>\
          <ComputingEndpoint BaseType=\"Endpoint\" CreationTime=\"2009-07-16T07:55:47Z\" Validity=\"600\">\
            <Associations>\
              <ComputingShareID>urn:ogsa:ComputingShare:knowarc1:2811:knowarc</ComputingShareID>\
            </Associations>\
            <HealthState>ok</HealthState>\
            <ID>urn:ogsa:ComputingEndpoint:knowarc1:2811</ID>\
            <ImplementationName>ARC1</ImplementationName>\
            <ImplementationVersion>0.9</ImplementationVersion>\
            <Implementor>NorduGrid</Implementor>\
            <Interface>OGSA-BES</Interface>\
            <JobDescription>ogf:jsdl:1.0</JobDescription>\
            <PreLRMSWaitingJobs>0</PreLRMSWaitingJobs>\
            <QualityLevel>development</QualityLevel>\
            <RunningJobs>0</RunningJobs>\
            <Semantics>http://svn.nordugrid.org/trac/nordugrid/browser/arc1/trunk/src/services/sched/README</Semantics>\
            <ServingState>production</ServingState>\
            <Staging>staginginout</Staging>\
            <StagingJobs>0</StagingJobs>\
            <SupportedProfile>WS-I 1.0</SupportedProfile>\
            <SupportedProfile>HPC-BP</SupportedProfile>\
            <SuspendedJobs>0</SuspendedJobs>\
            <Technology>webservice</Technology>\
            <TotalJobs>0</TotalJobs>\
            <ComputingActivities>\
            </ComputingActivities>\
          </ComputingEndpoint>\
          <ComputingShares>\
            <ComputingShare BaseType=\"Share\" CreationTime=\"2009-07-16T08:46:43Z\" Validity=\"600\">\
              <Associations>\
                <ComputingEndpointID>urn:ogsa:ComputingEndpoint:knowarc1:2811</ComputingEndpointID>\
              </Associations>\
              <Description>Job scheduler service. It speaks BES and iBES as well. It implements a job queue and schedules job to other BES services like A-REX or iBES clients like Paul.</Description>\
              <FreeSlots>2000</FreeSlots>\
              <FreeSlotsWithDuration>1:6483600</FreeSlotsWithDuration>\
              <ID>urn:ogsa:ComputingShare:knowarc1:2811:knowarc</ID>\
              <LocalRunningJobs>0</LocalRunningJobs>\
              <LocalSuspendedJobs>0</LocalSuspendedJobs>\
              <LocalWaitingJobs>0</LocalWaitingJobs>\
              <MappingQueue>knowarc</MappingQueue>\
              <MaxCPUTime>100860</MaxCPUTime>\
              <MaxMultiSlotWallTime>108060</MaxMultiSlotWallTime>\
              <MaxRunningJobs>4</MaxRunningJobs>\
              <MaxSlotsPerJob>1</MaxSlotsPerJob>\
              <MaxWallTime>108060</MaxWallTime>\
              <MinCPUTime>0</MinCPUTime>\
              <MinWallTime>0</MinWallTime>\
              <Name>knowarc</Name>\
              <PreLRMSWaitingJobs>0</PreLRMSWaitingJobs>\
              <RequestedSlots>0</RequestedSlots>\
              <RunningJobs>0</RunningJobs>\
              <ServingState>draining</ServingState>\
              <StagingJobs>0</StagingJobs>\
              <SuspendedJobs>0</SuspendedJobs>\
              <TotalJobs>0</TotalJobs>\
              <UsedSlots>0</UsedSlots>\
              <WaitingJobs>0</WaitingJobs>\
            </ComputingShare>\
          </ComputingShares>\
          <ID>urn:ogsa:ComputingService:knowarc1:2811</ID>\
          <Name>ARC1, Sched service</Name>\
          <PreLRMSWaitingJobs>0</PreLRMSWaitingJobs>\
          <QualityLevel>development</QualityLevel>\
          <RunningJobs>0</RunningJobs>\
          <StagingJobs>0</StagingJobs>\
          <SuspendedJobs>0</SuspendedJobs>\
          <TotalJobs>0</TotalJobs>\
          <Type>org.nordugrid.execution.sched</Type>\
          <WaitingJobs>0</WaitingJobs>\
        </ComputingService>\
      </Services>\
    </AdminDomain>\
  </Domains>\
  <n:nordugrid xmlns:M0=\"urn:Mds\" xmlns:n=\"urn:nordugrid\" xmlns:nc0=\"urn:nordugrid-cluster\">\
    <M0:validfrom>20090716075547Z</M0:validfrom>\
    <M0:validto>20090716080547Z</M0:validto>\
    <nc0:aliasname>ARC1, Sched service</nc0:aliasname>\
    <nc0:architecture>i686</nc0:architecture>\
  </n:nordugrid>\
</arc:InfoRoot>";
    

    Arc::XMLNode root(xml_str);

    for (Arc::JobQueueIterator jobs = jobq.getAll(); jobs.hasMore(); jobs++) {
       Arc::Job *j = *jobs;
       Arc::XMLNode jobs = root["Domains"]["AdminDomain"]["Services"]["ComputingService"]["ComputingEndpoint"]["ComputingActivities"];
       Arc::XMLNode job = jobs.NewChild("glue:ComputingActivity");
       job.NewChild("glue:ID") =  "urn:ogsa:ComputingActivity:sched:" + j->getID();
       switch (j->getStatus()) {
         case Arc::JOB_STATUS_SCHED_NEW:
             job.NewChild("glue:State") = "bes:Pending";
             job.NewChild("glue:State") = "nordugrid:ACCEPTED";
             break; 
         case Arc::JOB_STATUS_SCHED_RESCHEDULED:
             job.NewChild("glue:State") = "bes:Pending";
             job.NewChild("glue:State") = "nordugrid:ACCEPTED";
             break; 
         case Arc::JOB_STATUS_SCHED_STARTING:
             job.NewChild("glue:State") = "bes:Pending";
             job.NewChild("glue:State") = "nordugrid:PREPARING";
             break; 
         case Arc::JOB_STATUS_SCHED_RUNNING:
             job.NewChild("glue:State") = "bes:Running";
             job.NewChild("glue:State") = "nordugrid:INLRMS:R";
             break; 
         case Arc::JOB_STATUS_SCHED_CANCELLED:
             job.NewChild("glue:State") = "bes:Cancelled";
             job.NewChild("glue:State") = "nordugrid:KILLED";
             break; 
         case Arc::JOB_STATUS_SCHED_FAILED:
             job.NewChild("glue:State") = "bes:Failed";
             job.NewChild("glue:State") = "nordugrid:FAILED";
             break; 
         case Arc::JOB_STATUS_SCHED_FINISHED:
             job.NewChild("glue:State") = "bes:Finished";
             job.NewChild("glue:State") = "nordugrid:FINISHED";
             break; 
         case Arc::JOB_STATUS_SCHED_KILLED:
             job.NewChild("glue:State") = "bes:Cancelled";
             job.NewChild("glue:State") = "nordugrid:KILLED";
             break; 
         case Arc::JOB_STATUS_SCHED_KILLING:
             job.NewChild("glue:State") = "bes:Cancelled";
             job.NewChild("glue:State") = "nordugrid:KILLED";
             break; 
         case Arc::JOB_STATUS_SCHED_UNKNOWN:
             job.NewChild("glue:State") = "bes:Unknown";
             job.NewChild("glue:State") = "nordugrid:UNKNOWN";
             break; 
       }
    }

    if(root) {
      // Put result into container
      infodoc_.Assign(root,true);

      std::string s;

      root.GetDoc(s, true);

      logger_.msg(Arc::VERBOSE,"Assigned new informational document");
    } else {
      logger_.msg(Arc::ERROR,"Failed to create informational document");
    };
  
    sleep(5); 

   } // end of the for loop
  
}

Here is the call graph for this function:

Definition at line 63 of file grid_sched.cpp.

{
    Arc::PayloadSOAP* outpayload = new Arc::PayloadSOAP(ns_,true);
    Arc::SOAPFault* fault = outpayload?outpayload->Fault():NULL;
    if(fault) {
        fault->Code(Arc::SOAPFault::Sender);
        fault->Reason("Failed processing request");
    }

    outmsg.Payload(outpayload);
    return Arc::MCC_Status(Arc::STATUS_OK);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Method for processing of requests and responses.

This method is called by preceeding MCC in chain when a request needs to be processed. This method must call similar method of next MCC in chain unless any failure happens. Result returned by call to next MCC should be processed and passed back to previous MCC. In case of failure this method is expected to generate valid error response and return it back to previous MCC without calling the next one.

Parameters:
requestThe request that needs to be processed.
responseA Message object that will contain the response of the request when the method returns.
Returns:
An object representing the status of the call.

Implements Arc::MCCInterface.

Definition at line 78 of file grid_sched.cpp.

{
    // Both input and output are supposed to be SOAP
    // Extracting payload
    Arc::PayloadSOAP* inpayload = NULL;
    try {
        inpayload = dynamic_cast<Arc::PayloadSOAP*>(inmsg.Payload());
    } catch(std::exception& e) { };
    if(!inpayload) {
        logger_.msg(Arc::ERROR, "input is not SOAP");
        return make_soap_fault(outmsg);
    }

    inpayload->Namespaces(ns_);
    {   
        std::string str;
        inpayload->GetDoc(str, true);
        logger_.msg(Arc::VERBOSE, "process: request=%s",str);
    }; 

    // Get operation
    Arc::XMLNode op = inpayload->Child(0);
    if(!op) {
        logger_.msg(Arc::ERROR, "input does not define operation");
        return make_soap_fault(outmsg);
    }
    logger_.msg(Arc::VERBOSE, "process: operation: %s", op.Name());
    // BES Factory operations
    Arc::PayloadSOAP* outpayload = new Arc::PayloadSOAP(ns_);
    Arc::PayloadSOAP& res = *outpayload;
    Arc::MCC_Status ret;
    if(MatchXMLName(op, "CreateActivity")) {
        Arc::XMLNode r = res.NewChild("bes-factory:CreateActivityResponse");
        ret = CreateActivity(op, r);
    } else if(MatchXMLName(op, "GetActivityStatuses")) {
        Arc::XMLNode r = res.NewChild("bes-factory:GetActivityStatusesResponse");
        ret = GetActivityStatuses(op, r);
    } else if(MatchXMLName(op, "TerminateActivities")) {
        Arc::XMLNode r = res.NewChild("bes-factory:TerminateActivitiesResponse");
        ret = TerminateActivities(op, r);
    } else if(MatchXMLName(op, "GetActivityDocuments")) {
        Arc::XMLNode r = res.NewChild("bes-factory:GetActivityDocumentsResponse");
        ret = GetActivityDocuments(op, r);
    } else if(MatchXMLName(op, "GetFactoryAttributesDocument")) {
        Arc::XMLNode r = res.NewChild("bes-factory:GetFactoryAttributesDocumentResponse");
        ret = GetFactoryAttributesDocument(op, r);
    } else if(MatchXMLName(op, "StopAcceptingNewActivities")) {
        Arc::XMLNode r = res.NewChild("bes-mgmt:StopAcceptingNewActivitiesResponse");
        ret = StopAcceptingNewActivities(op, r);
    } else if(MatchXMLName(op, "StartAcceptingNewActivities")) {
        Arc::XMLNode r = res.NewChild("bes-mgmt:StartAcceptingNewActivitiesResponse");
        ret = StartAcceptingNewActivities(op, r);
    } else if(MatchXMLName(op, "ChangeActivityStatus")) {
        Arc::XMLNode r = res.NewChild("bes-factory:ChangeActivityStatusResponse");
        ret = ChangeActivityStatus(op, r);
    // iBES
    } else if(MatchXMLName(op, "GetActivities")) {
        Arc::XMLNode r = res.NewChild("ibes:GetActivitiesResponse");
        std::string resource_id = inmsg.Attributes()->get("TCP:REMOTEHOST");
        ret = GetActivities(op, r, resource_id);
    } else if(MatchXMLName(op, "ReportActivitiesStatus")) {
        Arc::XMLNode r = res.NewChild("ibes:ReportActivitiesStatusResponse");
        std::string resource_id = inmsg.Attributes()->get("TCP:REMOTEHOST");
        ret = ReportActivitiesStatus(op, r, resource_id);
    } else if(MatchXMLName(op, "GetActivitiesStatusChanges")) {
        Arc::XMLNode r = res.NewChild("ibes:GetActivitiesStatusChangesResponse");
        std::string resource_id = inmsg.Attributes()->get("TCP:REMOTEHOST");
        ret = GetActivitiesStatusChanges(op, r, resource_id);
    // Delegation
    } else if(MatchXMLName(op, "DelegateCredentialsInit")) {
        if(!delegations_.DelegateCredentialsInit(*inpayload,*outpayload)) {
          delete inpayload;
          return make_soap_fault(outmsg);
        };
    // WS-Property
    } else if(MatchXMLNamespace(op,"http://docs.oasis-open.org/wsrf/rp-2")) {
        Arc::SOAPEnvelope* out_ = infodoc_.Process(*inpayload);
        if(out_) {
          *outpayload=*out_;
          delete out_;
        } else {
          delete inpayload; delete outpayload;
          return make_soap_fault(outmsg);
        };
    // Undefined operation
    } else {
        logger_.msg(Arc::ERROR, "SOAP operation is not supported: %s", op.Name());
        return make_soap_fault(outmsg);
    
    }
    {
        // VERBOSE
        std::string str;
        outpayload->GetXML(str);
        logger_.msg(Arc::VERBOSE, "process: response=%s", str);
    }
    // Set output
    outmsg.Payload(outpayload);
    return Arc::MCC_Status(Arc::STATUS_OK);
}

Here is the call graph for this function:

bool Arc::Service::ProcessSecHandlers ( Message message,
const std::string &  label = "" 
) const [protected, inherited]

Executes security handlers of specified queue.

For more information please see description of MCC::ProcessSecHandlers

Definition at line 22 of file Service.cpp.

                                                                              {
    std::map<std::string,std::list<ArcSec::SecHandler*> >::const_iterator q = sechandlers_.find(label);
    if(q == sechandlers_.end()) {
        logger.msg(DEBUG, "No security processing/check requested for '%s'", label);
        return true;
    }

    std::list<ArcSec::SecHandler*>::const_iterator h = q->second.begin();
    for(;h!=q->second.end();++h) {
        const ArcSec::SecHandler* handler = *h;
        if(handler) if(!(handler->Handle(&message))) {
            logger.msg(DEBUG, "Security processing/check for '%s' failed", label);
            return false;
        }
    }
    logger.msg(DEBUG, "Security processing/check for '%s' passed", label);
    return true;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Service specific registartion collector, used for generate service registartions.

In implemented service this method should generate GLUE2 document with part of service description which service wishes to advertise to Information Services.

Reimplemented from Arc::Service.

Definition at line 176 of file information_collector.cpp.

                                                                {
  logger_.msg(Arc::DEBUG,"Passing service's information from collector to registrator");
  Arc::XMLNode empty(ns_, "RegEntry");
  empty.New(doc);

  doc.NewChild("SrcAdv");
  doc.NewChild("MetaSrcAdv");
  doc["SrcAdv"].NewChild("Type") = "org.nordugrid.execution.sched";
  doc["SrcAdv"].NewChild("EPR").NewChild("Address") = endpoint;
  return true;
}

Here is the call graph for this function:

Arc::MCC_Status GridScheduler::GridSchedulerService::ReportActivitiesStatus ( Arc::XMLNode in,
Arc::XMLNode out,
const std::string &  resource_id 
) [private]

Definition at line 155 of file ibes.cpp.

{
    Arc::XMLNode activity;
    for (int i = 0; (activity = in["Activity"][i]) != false; i++) {
        Arc::XMLNode id = activity["ActivityIdentifier"];
        Arc::WSAEndpointReference epr(id);
        std::string job_id = epr.ReferenceParameters()["sched:JobID"];
        if (job_id.empty()) {
            logger_.msg(Arc::ERROR, "Cannot find job id");
            continue;
        }
        Arc::XMLNode status = activity["ActivityStatus"];
        Arc::XMLNode state = status.Attribute("state");
        if (!state) {
            logger_.msg(Arc::ERROR, "Invalid status report");
            continue;
        }
        try {
            Arc::Job *j = jobq[job_id];
            Arc::JobSchedMetaData *m = j->getJobSchedMetaData();
            if (m->getResourceID() != resource_id) {
                logger_.msg(Arc::WARNING, "%s reports job status of %s but it is running on %s", resource_id, j->getID(), m->getResourceID());
                delete j;
                continue;
            }
            Arc::SchedJobStatus old_status = j->getStatus();
            Arc::SchedJobStatus new_status = Arc::sched_status_from_string((std::string)state);
            logger_.msg(Arc::VERBOSE, "%s try to status change: %s->%s", 
                        j->getID(),
                        Arc::sched_status_to_string(j->getStatus()), 
                        (std::string)state);
            if (j->getStatus() != Arc::JOB_STATUS_SCHED_KILLING
                || j->getStatus() != Arc::JOB_STATUS_SCHED_RESCHEDULED
                || new_status == Arc::JOB_STATUS_SCHED_KILLED) {
                // do not update job which was requested to kill or rescheduled
                j->setStatus(new_status);
            }
            // update times
            Arc::Time now;
            m->setLastUpdated(now);
            if (new_status == Arc::JOB_STATUS_SCHED_RUNNING 
                && (old_status == Arc::JOB_STATUS_SCHED_NEW 
                    || old_status == Arc::JOB_STATUS_SCHED_STARTING)) {
                m->setStartTime(now);
            }
            if (new_status == Arc::JOB_STATUS_SCHED_FINISHED 
                || new_status == Arc::JOB_STATUS_SCHED_KILLED
                || new_status == Arc::JOB_STATUS_SCHED_FAILED) {
                m->setEndTime(now);
            }
            jobq.refresh(*j);
            delete j;
        } catch (Arc::JobNotFoundException &e) {
            logger_.msg(Arc::ERROR, "Cannot find job id: %s", job_id);
        }
    }
    return Arc::MCC_Status(Arc::STATUS_OK);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 102 of file bes.cpp.

Here is the caller graph for this function:

Definition at line 109 of file bes.cpp.

Here is the caller graph for this function:

Definition at line 116 of file bes.cpp.

{
    Arc::XMLNode id;
    for (int n = 0; (id = in["ActivityIdentifier"][n]) != false; n++) {
        Arc::XMLNode resp = out.NewChild("bes-factory:Response");
        resp.NewChild(id);
        std::string jobid = Arc::WSAEndpointReference(id).ReferenceParameters()["sched:JobID"];
        if (jobid.empty()) {
            // EPR is wrongly formated
            continue;
        }
        
        try {
            Arc::Job *j = jobq[jobid];
            j->setStatus(Arc::JOB_STATUS_SCHED_KILLING);
            jobq.refresh(*j); // save job
            delete j;
            resp.NewChild("bes-factory:Terminated") = "true";
        } catch(Arc::JobNotFoundException &e) {
            logger_.msg(Arc::ERROR, "GetActivityStatuses: job %s not found", jobid);
            Arc::SOAPEnvelope fault(ns_, true);
            if (fault) {
                fault.Fault()->Code(Arc::SOAPFault::Sender);
                fault.Fault()->Reason("Unknown activity");
                Arc::XMLNode f = fault.Fault()->Detail(true).NewChild("bes-factory:UnknownActivityIdentifierFault");
                out.Replace(fault.Child());
            } else {
                logger_.msg(Arc::ERROR, "Cannot create SOAP fault");
            }
            return Arc::MCC_Status();
        } catch (std::exception &e) {
            logger_.msg(Arc::ERROR, "Fatal error: %s", e.what());
            return Arc::MCC_Status();
        }
    }
    return Arc::MCC_Status(Arc::STATUS_OK);
}

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

std::map<std::string, std::string> GridScheduler::GridSchedulerService::cli_config [private]

Definition at line 23 of file grid_sched.h.

Definition at line 21 of file grid_sched.h.

Definition at line 31 of file grid_sched.h.

Definition at line 22 of file grid_sched.h.

Definition at line 32 of file grid_sched.h.

Definition at line 18 of file grid_sched.h.

Definition at line 19 of file grid_sched.h.

Definition at line 24 of file grid_sched.h.

Logger Arc::Service::logger [static, protected, inherited]

Logger object used to print messages generated by this class.

Reimplemented in Echo::Service_Echo, Arc::Service_JavaWrapper, SPService::Service_SP, Compiler::Service_Compiler, Hopi::Hopi, and Arc::Service_PythonWrapper.

Definition at line 43 of file Service.h.

Definition at line 30 of file grid_sched.h.

Definition at line 29 of file grid_sched.h.

Definition at line 27 of file grid_sched.h.

Definition at line 25 of file grid_sched.h.

Definition at line 26 of file grid_sched.h.

Definition at line 20 of file grid_sched.h.

std::map<std::string,std::list<ArcSec::SecHandler*> > Arc::Service::sechandlers_ [protected, inherited]

Set of labeled authentication and authorization handlers.

MCC calls sequence of handlers at specific point depending on associated identifier. in most aces those are "in" and "out" for incoming and outgoing messages correspondingly.

Definition at line 40 of file Service.h.

Definition at line 28 of file grid_sched.h.


The documentation for this class was generated from the following files: