Back to index

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

Container of multiple SecAttr attributes. More...

#include <SecAttr.h>

Inheritance diagram for Arc::MultiSecAttr:
Inheritance graph
[legend]
Collaboration diagram for Arc::MultiSecAttr:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 MultiSecAttr ()
virtual ~MultiSecAttr ()
virtual operator bool () const
 This function should return false if the value is to be considered null, e.g.
virtual bool Export (SecAttrFormat format, XMLNode &val) const
 Convert internal structure into specified format.
virtual bool Import (SecAttrFormat format, XMLNode val)
bool operator== (const SecAttr &b) const
 This function should (in inheriting classes) return true if this and b are considered to represent same content.
bool operator!= (const SecAttr &b) const
 This is a convenience function to allow the usage of "not equal" conditions and need not be overridden.
virtual bool Export (SecAttrFormat format, std::string &val) const
 Convert internal structure into specified format.
virtual bool Import (SecAttrFormat format, const std::string &val)
 Fills internal structure from external object of specified format.

Static Public Attributes

static SecAttrFormat UNDEFINED
static SecAttrFormat ARCAuth
 own serialization/deserialization format
static SecAttrFormat XACML
 representation for ARC authorization policy
static SecAttrFormat SAML
 represenation for XACML policy
static SecAttrFormat GACL
 suitable for inclusion into SAML structures

Protected Member Functions

virtual bool equal (const SecAttr &b) const
virtual bool Add (SecAttrFormat format, XMLNode &val)

Protected Attributes

std::list< SecAttr * > attrs_

Detailed Description

Container of multiple SecAttr attributes.

This class combines multiple attributes. It's export/import methods catenate results of underlying objects. Primary meaning of this class is to serve as base for classes implementing multi level hierarchical tree-like descriptions of user identity. It may also be used for collecting information of same source or kind. Like all information extracted from X509 certificate.

Definition at line 90 of file SecAttr.h.


Constructor & Destructor Documentation

Definition at line 92 of file SecAttr.h.

{};
virtual Arc::MultiSecAttr::~MultiSecAttr ( ) [inline, virtual]

Definition at line 93 of file SecAttr.h.

{};

Member Function Documentation

bool Arc::MultiSecAttr::Add ( SecAttrFormat  format,
XMLNode val 
) [protected, virtual]

Definition at line 74 of file SecAttr.cpp.

                                              {
  return false;
}

Here is the caller graph for this function:

bool Arc::MultiSecAttr::equal ( const SecAttr b) const [protected, virtual]

Reimplemented from Arc::SecAttr.

Definition at line 79 of file SecAttr.cpp.

                                               {
  try {
    const MultiSecAttr& b_ = dynamic_cast<const MultiSecAttr&>(b);
    std::list<SecAttr*>::const_iterator i_a = attrs_.begin();
    std::list<SecAttr*>::const_iterator i_b = b_.attrs_.begin();
    for(;;) {
      if((i_a == attrs_.end()) && (i_b == b_.attrs_.end())) break;
      if(i_a == attrs_.end()) return false;
      if(i_b == b_.attrs_.end()) return false;
      if((**i_a) != (**i_b)) return false;
    }
    return true;
  } catch(std::exception&) { };
  return false;
}
bool Arc::SecAttr::Export ( SecAttrFormat  format,
std::string &  val 
) const [virtual, inherited]

Convert internal structure into specified format.

Returns false if format is not supported/suitable for this attribute.

Definition at line 20 of file SecAttr.cpp.

                                                              {
  NS ns;
  XMLNode x(ns, "");
  if(!Export(format,x)) return false;
  x.GetXML(val);
  return true;
}

Here is the call graph for this function:

Here is the caller graph for this function:

bool Arc::MultiSecAttr::Export ( SecAttrFormat  format,
XMLNode val 
) const [virtual]

Convert internal structure into specified format.

Returns false if format is not supported/suitable for this attribute. XML node referenced by is turned into top level element of specified format.

Reimplemented from Arc::SecAttr.

Reimplemented in ArcSec::DelegationMultiSecAttr.

Definition at line 46 of file SecAttr.cpp.

                                                                 {
  // Name of created node to be replaced by inheriting class
  if(!val) {
    NS ns;
    XMLNode(ns,"MultiSecAttr").New(val);
  } else {
    val.Name("MultiSecAttr");
  };
  for(std::list<SecAttr*>::const_iterator a = attrs_.begin();
               a!=attrs_.end();++a) {
    NS ns; XMLNode x(ns,"");
    if(!((*a)->Export(format,x))) return false;
    val.NewChild(x);
  }
  return true;
}

Here is the call graph for this function:

Here is the caller graph for this function:

bool Arc::SecAttr::Import ( SecAttrFormat  format,
const std::string &  val 
) [virtual, inherited]

Fills internal structure from external object of specified format.

Returns false if failed to do. The usage pattern for this method is not defined and it is provided only to make class symmetric. Hence it's implementation is not required yet.

Definition at line 32 of file SecAttr.cpp.

                                                              {
  XMLNode x(val);
  if(!x) return false;
  return Import(format,x);
}
bool Arc::MultiSecAttr::Import ( SecAttrFormat  format,
XMLNode  val 
) [virtual]

Reimplemented from Arc::SecAttr.

Definition at line 63 of file SecAttr.cpp.

                                                          {
  XMLNode x = val.Child(0);
  for(;(bool)x;x=x[1]) {
    if(!Add(format,x)) return false;
  }
  return true;
}

Here is the call graph for this function:

Arc::MultiSecAttr::operator bool ( void  ) const [virtual]

This function should return false if the value is to be considered null, e.g.

if it hasn't been set or initialized. In other cases it should return true.

Reimplemented from Arc::SecAttr.

Definition at line 42 of file SecAttr.cpp.

                                  {
  return !attrs_.empty();
}
bool Arc::SecAttr::operator!= ( const SecAttr b) const [inline, inherited]

This is a convenience function to allow the usage of "not equal" conditions and need not be overridden.

Definition at line 54 of file SecAttr.h.

{ return !equal(b); };

Here is the call graph for this function:

bool Arc::SecAttr::operator== ( const SecAttr b) const [inline, inherited]

This function should (in inheriting classes) return true if this and b are considered to represent same content.

Identifying and restricting the type of b should be done using dynamic_cast operations. Currently it is not defined how comparison methods to be used. Hence their implementation is not required.

Definition at line 51 of file SecAttr.h.

{ return equal(b); };

Here is the call graph for this function:


Member Data Documentation

SecAttrFormat Arc::SecAttr::ARCAuth [static, inherited]

own serialization/deserialization format

Definition at line 40 of file SecAttr.h.

std::list<SecAttr*> Arc::MultiSecAttr::attrs_ [protected]

Definition at line 98 of file SecAttr.h.

SecAttrFormat Arc::SecAttr::GACL [static, inherited]

suitable for inclusion into SAML structures

Definition at line 43 of file SecAttr.h.

SecAttrFormat Arc::SecAttr::SAML [static, inherited]

represenation for XACML policy

Definition at line 42 of file SecAttr.h.

Definition at line 39 of file SecAttr.h.

SecAttrFormat Arc::SecAttr::XACML [static, inherited]

representation for ARC authorization policy

Definition at line 41 of file SecAttr.h.


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