eu.emi.dsr.security
Class SubjectAttributesHolder

java.lang.Object
  extended by eu.emi.dsr.security.SubjectAttributesHolder
All Implemented Interfaces:
Serializable

public class SubjectAttributesHolder
extends Object
implements Serializable

Holds subject's attributes as collected by one or more attribute sources. There are two principal sets of attributes here: incarnation attributes and extra XACML attributes which are used for authorisation only. For incarnation attributes two structures are stored: the actual attributes that shall be used, and all permitted values. The latter are used when user specify the attribute by herself.

Author:
golbi
See Also:
Serialized Form

Constructor Summary
SubjectAttributesHolder()
          All structures are initialized to be empty.
SubjectAttributesHolder(List<XACMLAttribute> xacmlAttributes, Map<String,String[]> defaultIncarnationAttributes, Map<String,String[]> validIncarnationAttributes)
           
SubjectAttributesHolder(Map<String,String[]> incarnationAttributes)
          No XACML attributes, valid == default
SubjectAttributesHolder(Map<String,String[]> defaultIncarnationAttributes, Map<String,String[]> validIncarnationAttributes)
           
 
Method Summary
 void addAllMerging(SubjectAttributesHolder from)
          Adds all attributes from the argument object.
 void addAllOverwritting(SubjectAttributesHolder from)
          Adds all attributes from the argument object.
 Map<String,String[]> getDefaultIncarnationAttributes()
           
 Map<String,String[]> getValidIncarnationAttributes()
           
 List<XACMLAttribute> getXacmlAttributes()
           
 boolean isPresent()
           
 void setAllIncarnationAttributes(Map<String,String[]> defaultIncarnationAttributes, Map<String,String[]> validIncarnationAttributes)
          Sets incarnation attributes.
 void setXacmlAttributes(List<XACMLAttribute> xacmlAttributes)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SubjectAttributesHolder

public SubjectAttributesHolder()
All structures are initialized to be empty.


SubjectAttributesHolder

public SubjectAttributesHolder(Map<String,String[]> incarnationAttributes)
No XACML attributes, valid == default

Parameters:
incarnationAttributes -

SubjectAttributesHolder

public SubjectAttributesHolder(Map<String,String[]> defaultIncarnationAttributes,
                               Map<String,String[]> validIncarnationAttributes)

SubjectAttributesHolder

public SubjectAttributesHolder(List<XACMLAttribute> xacmlAttributes,
                               Map<String,String[]> defaultIncarnationAttributes,
                               Map<String,String[]> validIncarnationAttributes)
Method Detail

addAllOverwritting

public void addAllOverwritting(SubjectAttributesHolder from)
Adds all attributes from the argument object. Existing attributes are overwritten: incarnation attributes with same names are simply replaced. In case of XACML attributes all existing with the names contained in the argument list are removed first.

Parameters:
from -

addAllMerging

public void addAllMerging(SubjectAttributesHolder from)
Adds all attributes from the argument object. Existing attributes are merged whenever this makes sense: valid values and XACML attributes are merged, defaults for incarnation are overriden.

Parameters:
from -

getXacmlAttributes

public List<XACMLAttribute> getXacmlAttributes()

setXacmlAttributes

public void setXacmlAttributes(List<XACMLAttribute> xacmlAttributes)

getDefaultIncarnationAttributes

public Map<String,String[]> getDefaultIncarnationAttributes()

getValidIncarnationAttributes

public Map<String,String[]> getValidIncarnationAttributes()

setAllIncarnationAttributes

public void setAllIncarnationAttributes(Map<String,String[]> defaultIncarnationAttributes,
                                        Map<String,String[]> validIncarnationAttributes)
Sets incarnation attributes. Valid incarnation attributes must be a superset of default incarnation attributes.

Parameters:
defaultIncarnationAttributes -
validIncarnationAttributes -

isPresent

public boolean isPresent()

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2012. All Rights Reserved.