Back to index

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

Wrapper which includes AttributeValue object which is generated according to date type of one spefic node in Request.xml. More...

#include <RequestAttribute.h>

Collaboration diagram for ArcSec::RequestAttribute:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 RequestAttribute (Arc::XMLNode &node, AttributeFactory *attrfactory)
 Constructor - create attribute value object according to the "Type" in the node <Attribute attributeid="urn:arc:subject:voms-attribute" type="string">urn:mace:shibboleth:examples</Attribute>
 RequestAttribute ()
virtual ~RequestAttribute ()
Arc::XMLNode getNode ()
std::string getAttributeId () const
void setAttributeId (const std::string attributeId)
std::string getDataType () const
void setDataType (const std::string dataType)
std::string getIssuer () const
void setIssuer (const std::string issuer)
virtual AttributeValuegetAttributeValue () const
virtual AttributeFactorygetAttributeFactory () const
RequestAttributeduplicate (RequestAttribute &)
 Duplicate the parameter into "this".

Private Attributes

Arc::XMLNode node_
 the <Attribute> node
std::string id
 id of this <Attribute>, it could be useful if the policy specify <AttributeDesignator> to get value from request
std::string type
 data type of <Attribute> node, it a important factor for generating the different AttributeValue objects
std::string issuer
 issuer of the value of <Attribute>; it could be useful if the policy
AttributeValueattrval
 the AttributeValue object
AttributeFactoryattrfactory
 the AttributeFactory which is used to generate the AttributeValue object

Static Private Attributes

static Arc::Logger logger

Detailed Description

Wrapper which includes AttributeValue object which is generated according to date type of one spefic node in Request.xml.

Definition at line 16 of file RequestAttribute.h.


Constructor & Destructor Documentation

Constructor - create attribute value object according to the "Type" in the node <Attribute attributeid="urn:arc:subject:voms-attribute" type="string">urn:mace:shibboleth:examples</Attribute>

Definition at line 12 of file RequestAttribute.cpp.

                                                                               : attrval(NULL), attrfactory(attrfactory) {
  Arc::XMLNode nd;

  //Get the attribute of the node  
  id = (std::string)(node.Attribute("AttributeId")); 
  if(id.empty())
    id = (std::string)(node.Attribute("Id"));

  std::string tp = (std::string)(node.Attribute("Type"));
  if(tp.empty())
    tp = (std::string)(node.Attribute("DataType")); 
  std::size_t found = tp.find_last_of("#"); //http://www.w3.org/2001/XMLSchema#string
  if(found!=std::string::npos) {
    type = tp.substr(found+1);
  }
  else {
    found=tp.find_last_of(":"); //urn:oasis:names:tc:xacml:1.0:data-type:rfc822Name
    type = tp.substr(found+1);
  }

  issuer = (std::string)(node.Attribute("Issuer"));

  //Create the attribute value object according to the data type
  attrval = attrfactory->createValue(node, type);

  logger.msg(VERBOSE, "Id= %s,Type= %s,Issuer= %s,Value= %s",id, type, issuer, attrval?attrval->encode():"");

  if(attrval == NULL)
    logger.msg(ERROR,"No Attribute exists, which can deal with type: %s", type);

  //Copy the node parameter into this->node_, for the usage in duplicate method 
  node.New(node_);

/*
  if(!(node.Size())){
    avlist.push_back(attrfactory->createValue(node, type));
  }
  else{
    for(int i=0; i<node.Size(); i++)
      avlist.push_back(attrfactory->createValue(node.Child(i), type));
  }
*/
}

Here is the call graph for this function:

Definition at line 56 of file RequestAttribute.cpp.

                                   {

}

Definition at line 112 of file RequestAttribute.cpp.

                                   {
  if(attrval)
    delete attrval;
  /*while(!avlist.empty()){
    delete (*(avlist.back()));
    avlist.pop_back();
  }
  */
}

Member Function Documentation

Duplicate the parameter into "this".

Definition at line 102 of file RequestAttribute.cpp.

                                                                        {
  id = req_attr.getAttributeId();
  type = req_attr.getDataType();
  issuer = req_attr.getIssuer();
  node_ = req_attr.getNode();
  attrval = (req_attr.getAttributeFactory())->createValue(node_, type);
  return *this;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 98 of file RequestAttribute.cpp.

                                                              {
  return attrfactory;
}

Here is the caller graph for this function:

std::string RequestAttribute::getAttributeId ( ) const

Definition at line 64 of file RequestAttribute.cpp.

                                                 {
  return id;
}

Here is the caller graph for this function:

Definition at line 94 of file RequestAttribute.cpp.

                                                         {
  return attrval;
}

Here is the caller graph for this function:

std::string RequestAttribute::getDataType ( ) const

Definition at line 72 of file RequestAttribute.cpp.

                                              {
  return type;
}

Here is the caller graph for this function:

std::string RequestAttribute::getIssuer ( ) const

Definition at line 80 of file RequestAttribute.cpp.

                                            {
  return issuer;
}

Here is the caller graph for this function:

Definition at line 60 of file RequestAttribute.cpp.

                                  {
  return node_;
}

Here is the caller graph for this function:

void RequestAttribute::setAttributeId ( const std::string  attributeId)

Definition at line 68 of file RequestAttribute.cpp.

                                                                 {
  id = attributeId;
}
void RequestAttribute::setDataType ( const std::string  dataType)

Definition at line 76 of file RequestAttribute.cpp.

                                                           {
  type = dataType;
}
void RequestAttribute::setIssuer ( const std::string  issuer)

Definition at line 84 of file RequestAttribute.cpp.

                                                   {
  issuer = is;
}

Member Data Documentation

the AttributeFactory which is used to generate the AttributeValue object

Definition at line 69 of file RequestAttribute.h.

the AttributeValue object

Definition at line 66 of file RequestAttribute.h.

std::string ArcSec::RequestAttribute::id [private]

id of this <Attribute>, it could be useful if the policy specify <AttributeDesignator> to get value from request

Definition at line 55 of file RequestAttribute.h.

std::string ArcSec::RequestAttribute::issuer [private]

issuer of the value of <Attribute>; it could be useful if the policy

Definition at line 61 of file RequestAttribute.h.

Logger RequestAttribute::logger [static, private]

Definition at line 49 of file RequestAttribute.h.

the <Attribute> node

Definition at line 52 of file RequestAttribute.h.

std::string ArcSec::RequestAttribute::type [private]

data type of <Attribute> node, it a important factor for generating the different AttributeValue objects

Definition at line 58 of file RequestAttribute.h.


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