Back to index

nordugrid-arc-nox  1.1.0~rc6
Public Member Functions | Static Public Member Functions | Protected Attributes | Private Attributes | Friends
ArcSec::ArcRequest Class Reference

#include <ArcRequest.h>

Inheritance diagram for ArcSec::ArcRequest:
Inheritance graph
[legend]
Collaboration diagram for ArcSec::ArcRequest:
Collaboration graph
[legend]

List of all members.

Public Member Functions

virtual ReqItemList getRequestItems () const
 Get all the RequestItem inside RequestItem container.
virtual void setRequestItems (ReqItemList sl)
 Set the content of the container.
virtual void addRequestItem (Attrs &sub, Attrs &res, Attrs &act, Attrs &ctx)
 Add request tuple from non-XMLNode.
virtual void setAttributeFactory (AttributeFactory *attributefactory)
 Set the attribute factory for the usage of Request.
 ArcRequest ()
 ArcRequest (const Source &source)
virtual ~ArcRequest ()
virtual void make_request ()
 Create the objects included in Request according to the node attached to the Request object.
virtual const char * getEvalName () const
 Get the name of corresponding evaulator.
virtual const char * getName () const
 Get the name of this request.
virtual Arc::XMLNodegetReqNode ()

Static Public Member Functions

static Arc::Pluginget_request (Arc::PluginArgument *arg)
 get_request (in charge of class-loading of ArcRequest) can only accept two types of argument: NULL, XMLNode

Protected Attributes

ReqItemList rlist

Private Attributes

AttributeFactoryattrfactory
Arc::XMLNode reqnode

Friends

class ArcEvaluator

Detailed Description

Definition at line 16 of file ArcRequest.h.


Constructor & Destructor Documentation

Definition at line 161 of file ArcRequest.cpp.

                        {
  NS ns;
  ns["ra"]="http://www.nordugrid.org/schemas/request-arc";
  XMLNode request(ns,"ra:Request");
  request.New(reqnode);
}

Here is the call graph for this function:

Here is the caller graph for this function:

ArcRequest::ArcRequest ( const Source source)

Definition at line 154 of file ArcRequest.cpp.

                                         : Request(req) {
  req.Get().New(reqnode);
  NS ns;
  ns["ra"]="http://www.nordugrid.org/schemas/request-arc";
  reqnode.Namespaces(ns);
}

Here is the call graph for this function:

ArcRequest::~ArcRequest ( ) [virtual]

Definition at line 168 of file ArcRequest.cpp.

                       {
  while(!(rlist.empty())){
    delete rlist.back();
    rlist.pop_back();
  }
}

Member Function Documentation

void ArcRequest::addRequestItem ( Attrs sub,
Attrs res,
Attrs act,
Attrs ctx 
) [virtual]

Add request tuple from non-XMLNode.

Reimplemented from ArcSec::Request.

Definition at line 52 of file ArcRequest.cpp.

                                                                             {
  //Add a new RequestItem into reqnode 
  XMLNode request = reqnode;
  XMLNode requestitem = request.NewChild("ra:RequestItem");

  XMLNode subject = requestitem.NewChild("ra:Subject");
  int i;
  int size = sub.size();
  if(size>1) {
    for(i = 0; i < size; i++ )
    {
      XMLNode subjectattr = subject.NewChild("ra:Attribute");
      subjectattr = sub[i].value;
      XMLNode subjectattr_attr = subjectattr.NewAttribute("ra:Type");
      subjectattr_attr = sub[i].type;
    }
  }
  else{
    XMLNode subject_attr = subject.NewAttribute("ra:Type");
    subject = sub[0].value;
    subject_attr = sub[0].type;
  }

  XMLNode resource = requestitem.NewChild("ra:Resource");
  size = res.size();
  if(size>1) {
    for(i = 0; i< size; i++)
    {
      XMLNode resourceattr = resource.NewChild("ra:Attribute");
      resourceattr = res[i].value;
      XMLNode resourceattr_attr = resourceattr.NewAttribute("ra:Type");
      resourceattr_attr = res[i].type;
    }
  }
  else{
    XMLNode resource_attr = resource.NewAttribute("ra:Type");
    resource = res[0].value;
    resource_attr = res[0].type;
  }

  XMLNode action = requestitem.NewChild("ra:Action");
  size = act.size();
  if(size>1) {
    for(i = 0; i < size; i++)
    {
      XMLNode actionattr = action.NewChild("ra:Attribute");
      actionattr = act[i].value;
      XMLNode actionattr_attr = actionattr.NewAttribute("ra:Type");
      actionattr_attr = act[i].type;
    }
  }
  else{
    XMLNode action_attr = action.NewAttribute("ra:Type");
    action = act[0].value;
    action_attr = act[0].type;
  }

  XMLNode context = requestitem.NewChild("ra:Context");
  size = ctx.size();
  if(size>1) {
    for(i = 0; i < size; i++)
    {
      XMLNode contextattr = context.NewChild("ra:Attribute");
      contextattr = ctx[i].value;
      XMLNode contextattr_attr = contextattr.NewAttribute("ra:Type");
      contextattr_attr = ctx[i].type;
    }
  }
  else{
    XMLNode context_attr = context.NewAttribute("ra:Type");
    context = ctx[0].value;
    context_attr = ctx[0].type;
  }

  std::string xml;
  reqnode.GetDoc(xml);
  std::cout<<xml<<std::endl; 

}

Here is the call graph for this function:

get_request (in charge of class-loading of ArcRequest) can only accept two types of argument: NULL, XMLNode

Definition at line 14 of file ArcRequest.cpp.

                                                               {
  //std::cout<<"Argument type of ArcRequest:"<<typeid(arg).name()<<std::endl;
  if(arg==NULL) return NULL;
  else {
    /*
    {
      std::string xml;
      ((Arc::XMLNode*)arg)->GetXML(xml);
      std::cout<<"node inside ArcRequest:"<<xml<<std::endl;
    };
    */
    Arc::ClassLoaderPluginArgument* clarg =
            arg?dynamic_cast<Arc::ClassLoaderPluginArgument*>(arg):NULL;
    if(!clarg) return NULL;
    Arc::XMLNode* xarg = (Arc::XMLNode*)(*clarg);
    if(xarg==NULL) { return new ArcSec::ArcRequest(); } // ???
    ArcSec::Source source(*xarg);
    return new ArcSec::ArcRequest(source);
  }
}

Here is the call graph for this function:

const char * ArcRequest::getEvalName ( ) const [virtual]

Get the name of corresponding evaulator.

Implements ArcSec::Request.

Definition at line 146 of file ArcRequest.cpp.

                                         {
  return "arc.evaluator";
}
const char * ArcRequest::getName ( ) const [virtual]

Get the name of this request.

Implements ArcSec::Request.

Definition at line 150 of file ArcRequest.cpp.

                                     {
  return "arc.request";
}
virtual Arc::XMLNode& ArcSec::ArcRequest::getReqNode ( ) [inline, virtual]

Implements ArcSec::Request.

Definition at line 47 of file ArcRequest.h.

{ return reqnode; };

Get all the RequestItem inside RequestItem container.

Reimplemented from ArcSec::Request.

Definition at line 44 of file ArcRequest.cpp.

                                               {
  return rlist;
}
void ArcRequest::make_request ( ) [virtual]

Create the objects included in Request according to the node attached to the Request object.

Implements ArcSec::Request.

Definition at line 132 of file ArcRequest.cpp.

                             {
  Arc::NS nsList;

  nsList.insert(std::pair<std::string, std::string>("request","http://www.nordugrid.org/schemas/request-arc"));

  std::list<XMLNode>::iterator itemit;
    std::list<XMLNode> itemlist = reqnode.XPathLookup("//request:RequestItem", nsList);
    for ( itemit=itemlist.begin() ; itemit != itemlist.end(); itemit++ ){
      XMLNode itemnd=*itemit;
      //Generate a new ArcRequestItem, which will generate RequestAttribute object 
      rlist.push_back(new ArcRequestItem(itemnd, attrfactory));
    }
}
virtual void ArcSec::ArcRequest::setAttributeFactory ( AttributeFactory attributefactory) [inline, virtual]

Set the attribute factory for the usage of Request.

Implements ArcSec::Request.

Definition at line 30 of file ArcRequest.h.

{ attrfactory = attributefactory; };
void ArcRequest::setRequestItems ( ReqItemList  sl) [virtual]

Set the content of the container.

Reimplemented from ArcSec::Request.

Definition at line 48 of file ArcRequest.cpp.

                                               {
  rlist = sl;
}

Friends And Related Function Documentation

friend class ArcEvaluator [friend]

Definition at line 17 of file ArcRequest.h.


Member Data Documentation

Definition at line 53 of file ArcRequest.h.

Definition at line 56 of file ArcRequest.h.

ReqItemList ArcSec::Request::rlist [protected, inherited]

Definition at line 57 of file Request.h.


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