Back to index

nordugrid-arc-nox  1.1.0~rc6
Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes
ARex2::ARex2Service Class Reference

#include <arex2.h>

Inheritance diagram for ARex2::ARex2Service:
Inheritance graph
[legend]
Collaboration diagram for ARex2::ARex2Service:
Collaboration graph
[legend]

List of all members.

Public Member Functions

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

Protected 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 GetActivityDocuments (Arc::XMLNode in, Arc::XMLNode out)
Arc::MCC_Status make_response (Arc::Message &outmsg)
Arc::MCC_Status make_fault (Arc::Message &outmsg)
Arc::MCC_Status make_soap_fault (Arc::Message &outmsg)
bool ProcessSecHandlers (Message &message, const std::string &label="") const
 Executes security handlers of specified queue.

Protected Attributes

Arc::NS ns_
Arc::Logger logger_
Arc::DelegationContainerSOAP delegations_
Arc::InformationContainer infodoc_
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.

Detailed Description

Definition at line 10 of file arex2.h.


Constructor & Destructor Documentation

Definition at line 195 of file arex2.cpp.

                                        :Service(cfg),logger_(Arc::Logger::rootLogger, "A-REX2") 
{
  logger_.addDestination(logcerr);
  // Define supported namespaces
  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";
  // CreateThreadFunction(&thread_starter,this);
}

Here is the call graph for this function:

ARex2::ARex2Service::~ARex2Service ( void  ) [virtual]

Definition at line 211 of file arex2.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 73 of file arex2.cpp.

{
    return Arc::MCC_Status();
}

Here is the caller graph for this function:

Definition at line 30 of file arex2.cpp.

{
    return Arc::MCC_Status();
}

Here is the caller graph for this function:

Definition at line 48 of file arex2.cpp.

{
    return Arc::MCC_Status();
}

Here is the caller graph for this function:

Definition at line 36 of file arex2.cpp.

{
    return Arc::MCC_Status();
}

Here is the caller graph for this function:

Definition at line 54 of file arex2.cpp.

{
    return Arc::MCC_Status();
}

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 92 of file arex2.cpp.

{
  return Arc::MCC_Status();
}

Definition at line 97 of file arex2.cpp.

{
  Arc::PayloadRaw* outpayload = new Arc::PayloadRaw();
  outmsg.Payload(outpayload);
  return Arc::MCC_Status(Arc::STATUS_OK);
}

Here is the call graph for this function:

Definition at line 80 of file arex2.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:

Arc::MCC_Status ARex2::ARex2Service::process ( Arc::Message request,
Arc::Message response 
) [virtual]

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 105 of file arex2.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);
    };

    // 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")) {
        res.NewChild("bes-factory:CreateActivityResponse");
        ret = CreateActivity(op, res);
    } else if(MatchXMLName(op, "GetActivityStatuses")) {
        res.NewChild("bes-factory:GetActivityStatusesResponse");
        ret = GetActivityStatuses(op, res);
    } else if(MatchXMLName(op, "TerminateActivities")) {
        res.NewChild("bes-factory:TerminateActivitiesResponse");
        ret = TerminateActivities(op, res);
    } else if(MatchXMLName(op, "GetActivityDocuments")) {
        res.NewChild("bes-factory:GetActivityDocumentsResponse");
        ret = GetActivityDocuments(op, res);
    } else if(MatchXMLName(op, "GetFactoryAttributesDocument")) {
        res.NewChild("bes-factory:GetFactoryAttributesDocumentResponse");
        ret = GetFactoryAttributesDocument(op, res);
    } else if(MatchXMLName(op, "StopAcceptingNewActivities")) {
        res.NewChild("bes-factory:StopAcceptingNewActivitiesResponse");
        ret = StopAcceptingNewActivities(op, res);
    } else if(MatchXMLName(op, "StartAcceptingNewActivities")) {
        res.NewChild("bes-factory:StartAcceptingNewActivitiesResponse");
        ret = StartAcceptingNewActivities(op, res);
    } else if(MatchXMLName(op, "ChangeActivityStatus")) {
        res.NewChild("bes-factory:ChangeActivityStatusResponse");
        ret = ChangeActivityStatus(op, res);
      // Delegation
    } else if(MatchXMLName(op, "DelegateCredentialsInit")) {
        if(!delegations_.DelegateCredentialsInit(*inpayload,*outpayload)) {
          delete outpayload;
          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 outpayload;
          return make_soap_fault(outmsg);
        };
    } else {
        logger_.msg(Arc::ERROR, "SOAP operation is not supported: %s", op.Name());
        delete outpayload;
        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:

bool Arc::Service::RegistrationCollector ( XMLNode doc) [virtual, inherited]

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 in ARex::ARexService, ISIS::ISIService, GridScheduler::GridSchedulerService, Echo::Service_Echo, ArcSec::Charon, Paul::PaulService, ArcSec::Service_Delegation, SPService::Service_SP, ArcSec::Service_SLCS, Hopi::Hopi, and Arc::Service_PythonWrapper.

Definition at line 41 of file Service.cpp.

{
    logger.msg(WARNING, "Empty registration collector");
}

Here is the call graph for this function:

Definition at line 67 of file arex2.cpp.

{
    return Arc::MCC_Status();
}

Here is the caller graph for this function:

Definition at line 61 of file arex2.cpp.

{
    return Arc::MCC_Status();
}

Here is the caller graph for this function:

Definition at line 42 of file arex2.cpp.

{
    return Arc::MCC_Status();
}

Here is the caller graph for this function:


Member Data Documentation

Definition at line 14 of file arex2.h.

Definition at line 15 of file arex2.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 13 of file arex2.h.

Definition at line 12 of file arex2.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.


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