Back to index

nordugrid-arc-nox  1.1.0~rc6
Public Member Functions | Public Attributes | Protected Attributes
ArcSec::ArcRequestTuple Class Reference

RequestTuple, container which includes the. More...

#include <ArcEvaluationCtx.h>

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

List of all members.

Public Member Functions

RequestTupleduplicate (const RequestTuple *)
 ArcRequestTuple ()
virtual ~ArcRequestTuple ()
virtual void erase ()
virtual Arc::XMLNodegetNode ()

Public Attributes

Subject sub
Resource res
Action act
Context ctx

Protected Attributes

Arc::XMLNode tuple

Detailed Description

RequestTuple, container which includes the.

Definition at line 15 of file ArcEvaluationCtx.h.


Constructor & Destructor Documentation

Definition at line 14 of file ArcEvaluationCtx.cpp.

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

Here is the call graph for this function:

Definition at line 140 of file ArcEvaluationCtx.cpp.

                                  {
  while(!(sub.empty())){
    sub.pop_back();
  }

  while(!(res.empty())){
    res.pop_back();
  }

  while(!(act.empty())){
    act.pop_back();
  }

  while(!(ctx.empty())){
    ctx.pop_back();
  }
}

Member Function Documentation

RequestTuple * ArcRequestTuple::duplicate ( const RequestTuple req_tpl) [virtual]

Reimplemented from ArcSec::RequestTuple.

Definition at line 21 of file ArcEvaluationCtx.cpp.

                                                                    {  
  XMLNode root = tuple;
  int n;
  //ArcRequestTuple* tpl = dynamic_cast<ArcRequestTuple*>(req_tpl);

  //Reconstruct the XMLNode by using the information inside req_tpl

  //Reconstruct subject 
  Subject::iterator sit;
  Subject req_sub = req_tpl->sub;
  XMLNode subject;
  if(!req_sub.empty())
    subject = root.NewChild("ra:Subject");
  n = req_sub.size();
  for(sit = req_sub.begin(); sit != req_sub.end(); sit++){
    //Record the object of the Attribute
    RequestAttribute* attr = new RequestAttribute;
    attr->duplicate(*(*sit));
    sub.push_back(attr); 
     
    //Record the xml node of the Attribute
    XMLNode subjectattr = subject.NewChild("ra:Attribute");
    subjectattr = ((*sit)->getAttributeValue())->encode();
    XMLNode subjectattr_attr = subjectattr.NewAttribute("ra:Type");
    subjectattr_attr = ((*sit)->getAttributeValue())->getType();
    subjectattr_attr = subjectattr.NewAttribute("ra:AttributeId");
    subjectattr_attr = ((*sit)->getAttributeValue())->getId();

/*  AttributeValue *attrval;
    attrval = (*sit)->getAttributeValue();
    if(attrval) std::cout<< "Attribute Value:"<< (attrval->encode()).c_str() << std::endl;
*/           
  }
  
  //Reconstruct resource
  Resource::iterator rit;
  Resource req_res = req_tpl->res;
  XMLNode resource;
  if(!req_res.empty())
    resource = root.NewChild("ra:Resource");
  n = req_res.size();
  for(rit = req_res.begin(); rit != req_res.end(); rit++){
    RequestAttribute* attr = new RequestAttribute;
    attr->duplicate(*(*rit));
    res.push_back(attr);

    XMLNode resourceattr = resource.NewChild("ra:Attribute");
    resourceattr = ((*rit)->getAttributeValue())->encode();
    XMLNode resourceattr_attr = resourceattr.NewAttribute("ra:Type");
    resourceattr_attr = ((*rit)->getAttributeValue())->getType();
    resourceattr_attr = resourceattr.NewAttribute("ra:AttributeId");
    resourceattr_attr = ((*rit)->getAttributeValue())->getId();
  }

  //Reconstruct action
  Action::iterator ait;
  Action req_act = req_tpl->act;
  XMLNode action;
  if(!req_act.empty())
    action = root.NewChild("ra:Action");
  n = req_act.size();
  for(ait = req_act.begin(); ait != req_act.end(); ait++){
    RequestAttribute* attr = new RequestAttribute;
    attr->duplicate(*(*ait));
    act.push_back(attr);

    XMLNode actionattr = action.NewChild("ra:Attribute");
    actionattr = ((*ait)->getAttributeValue())->encode();
    XMLNode actionattr_attr = actionattr.NewAttribute("ra:Type");
    actionattr_attr = ((*ait)->getAttributeValue())->getType();
    actionattr_attr = actionattr.NewAttribute("ra:AttributeId");
    actionattr_attr = ((*ait)->getAttributeValue())->getId();
  }

  //Reconstruct context
  Context::iterator cit;
  Context req_ctx = req_tpl->ctx;
  XMLNode context;
  if(!req_ctx.empty())
    context = root.NewChild("ra:Context");
  n = req_ctx.size();
  for(cit = req_ctx.begin(); cit != req_ctx.end(); cit++){
    RequestAttribute* attr = new RequestAttribute;
    attr->duplicate(*(*cit));
    ctx.push_back(attr);

    XMLNode contextattr = context.NewChild("ra:Attribute");
    contextattr = ((*cit)->getAttributeValue())->encode();
    XMLNode contextattr_attr = contextattr.NewAttribute("ra:Type");
    contextattr_attr = ((*cit)->getAttributeValue())->getType();
    contextattr_attr = contextattr.NewAttribute("ra:AttributeId");
    contextattr_attr = ((*cit)->getAttributeValue())->getId();
  }

  return this;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void ArcRequestTuple::erase ( ) [virtual]

Reimplemented from ArcSec::RequestTuple.

Definition at line 118 of file ArcEvaluationCtx.cpp.

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

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

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

  while(!(ctx.empty())){
    delete ctx.back();
    ctx.pop_back();
  }
}
virtual Arc::XMLNode& ArcSec::RequestTuple::getNode ( ) [inline, virtual, inherited]

Definition at line 17 of file EvaluationCtx.h.

{ return tuple; };

Here is the caller graph for this function:


Member Data Documentation

Definition at line 24 of file EvaluationCtx.h.

Definition at line 25 of file EvaluationCtx.h.

Definition at line 23 of file EvaluationCtx.h.

Definition at line 20 of file EvaluationCtx.h.

Arc::XMLNode ArcSec::RequestTuple::tuple [protected, inherited]

Definition at line 27 of file EvaluationCtx.h.


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