Project Aristotle - ArisID Attribute Services

org.openliberty.arisid
Class DigitalSubject

java.lang.Object
  extended by org.openliberty.arisid.DigitalSubject
All Implemented Interfaces:
IDigitalSubject

public class DigitalSubject
extends java.lang.Object
implements IDigitalSubject

A DigitalSubject is the basic holder of attributes, predicates, and roles representing an Identity. A DigitalSubject is provided as retrieved Subject entity from an Attribute Authority. A DigitalSubject may be ANY addressable entity in an network. Some examples are: persons, servers, applications.


Constructor Summary
DigitalSubject(IPrincipalIdentifier nameId, java.lang.String interName, java.lang.Exception error)
           
DigitalSubject(IPrincipalIdentifier nameId, java.lang.String interName, IAttributeValue[] attrs, PredicateValue[] predicates, java.lang.String[] roles)
           
DigitalSubject(IPrincipalIdentifier nameId, java.lang.String interName, java.util.Set<IAttributeValue> attrs, java.util.Set<PredicateValue> predicates, java.util.Set<java.lang.String> roles)
           
 
Method Summary
 boolean compare(IDigitalSubject subj)
          Compares the digital subjects to see if the contents are a match.
 IAttributeValue getAttributeValue(java.lang.String name)
          Returns the IAttributeValue containing the values for the request Attribute as identified by its name identifier.
 java.util.Map<java.lang.String,IAttributeValue> getAttrVals()
          A Map containing any requested IAttributeValue objects.
 java.lang.Exception getError()
          Returns an Exception or null depending on whether there was an error returning the subject.
 java.lang.String getInteractionName()
           
 IMultiContextIdentifier getMultiContextIdentifier()
          If the subject is made from multiple attribute authorities, it will have a IMultiContextIdentifier.
 java.util.Map<java.lang.String,PredicateValue> getPredicateValues()
           
 IPrincipalIdentifier getPrincipalIdentifier()
          Returns the IPrincipalIdentifier (a subclass of java.security.Principal) for the subject.
 java.util.Set<java.lang.String> getRoles()
           
 java.lang.String getSubjectName()
          Returns a String representation of the subject identifier.
 boolean hasRole(java.lang.String role)
           
 boolean isError()
          Returns whether there was an error returning this subject.
 boolean isMultiContext()
          Returns whether this IDigitalSubject is based on multiple contexts.
 java.lang.Boolean isPredicateTrue(java.lang.String name)
          Returns whether a particular predicate condition is true.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DigitalSubject

public DigitalSubject(IPrincipalIdentifier nameId,
                      java.lang.String interName,
                      IAttributeValue[] attrs,
                      PredicateValue[] predicates,
                      java.lang.String[] roles)

DigitalSubject

public DigitalSubject(IPrincipalIdentifier nameId,
                      java.lang.String interName,
                      java.util.Set<IAttributeValue> attrs,
                      java.util.Set<PredicateValue> predicates,
                      java.util.Set<java.lang.String> roles)

DigitalSubject

public DigitalSubject(IPrincipalIdentifier nameId,
                      java.lang.String interName,
                      java.lang.Exception error)
Method Detail

getAttrVals

public java.util.Map<java.lang.String,IAttributeValue> getAttrVals()
Description copied from interface: IDigitalSubject
A Map containing any requested IAttributeValue objects. Note an AttributeValue may contain a value or an error.

Specified by:
getAttrVals in interface IDigitalSubject
Returns:
A Map where each IAttributeValue is indexed by its name identifier.

getAttributeValue

public IAttributeValue getAttributeValue(java.lang.String name)
Description copied from interface: IDigitalSubject
Returns the IAttributeValue containing the values for the request Attribute as identified by its name identifier.

Specified by:
getAttributeValue in interface IDigitalSubject
Parameters:
name - The name identifier for the attribute request.
Returns:
An IAttributeValue containing the values for the requested attribute name identifier.

getSubjectName

public java.lang.String getSubjectName()
Description copied from interface: IDigitalSubject
Returns a String representation of the subject identifier. This method equivalent to IPrincipalIdentifier.getName().

Specified by:
getSubjectName in interface IDigitalSubject
Returns:
String subject key identifier.

getPrincipalIdentifier

public IPrincipalIdentifier getPrincipalIdentifier()
Description copied from interface: IDigitalSubject
Returns the IPrincipalIdentifier (a subclass of java.security.Principal) for the subject. This is the same identifier used for add, compare, delete, modify, read operations.

Specified by:
getPrincipalIdentifier in interface IDigitalSubject
Returns:
A IPrincipalIdentifier

getMultiContextIdentifier

public IMultiContextIdentifier getMultiContextIdentifier()
Description copied from interface: IDigitalSubject
If the subject is made from multiple attribute authorities, it will have a IMultiContextIdentifier. This identifier can be used to locate the subject keys and context identifiers for each contributing authority.

Specified by:
getMultiContextIdentifier in interface IDigitalSubject
Returns:
the IMulticontextIdentifier identifier if present or null

isMultiContext

public boolean isMultiContext()
Description copied from interface: IDigitalSubject
Returns whether this IDigitalSubject is based on multiple contexts.

Specified by:
isMultiContext in interface IDigitalSubject
Returns:
true if the Principal Identifier is an instance of IMultiContextIdentifier and multiple contexts are present.

getInteractionName

public java.lang.String getInteractionName()

isError

public boolean isError()
Description copied from interface: IDigitalSubject
Returns whether there was an error returning this subject.

Specified by:
isError in interface IDigitalSubject
Returns:
true if an error exists.

getError

public java.lang.Exception getError()
Description copied from interface: IDigitalSubject
Returns an Exception or null depending on whether there was an error returning the subject.

Specified by:
getError in interface IDigitalSubject
Returns:
an Exception that occurred returning this subject.

isPredicateTrue

public java.lang.Boolean isPredicateTrue(java.lang.String name)
Description copied from interface: IDigitalSubject
Returns whether a particular predicate condition is true.

Specified by:
isPredicateTrue in interface IDigitalSubject
Parameters:
name - The name id of a predicate.
Returns:
whether a particular predicate condition is present.

getPredicateValues

public java.util.Map<java.lang.String,PredicateValue> getPredicateValues()
Specified by:
getPredicateValues in interface IDigitalSubject
Returns:
A Map containing the results of all predicates requested.

hasRole

public boolean hasRole(java.lang.String role)
Specified by:
hasRole in interface IDigitalSubject
Parameters:
role - The name id of the role to be returned.
Returns:
true if the role is present for the subject.

getRoles

public java.util.Set<java.lang.String> getRoles()
Specified by:
getRoles in interface IDigitalSubject
Returns:
A set of String values representing the roles held by the Subject.

compare

public boolean compare(IDigitalSubject subj)
Description copied from interface: IDigitalSubject
Compares the digital subjects to see if the contents are a match. The name and principalintifier are not used in the compare.

Specified by:
compare in interface IDigitalSubject
Parameters:
subj - The DigitalSubject to be compared.
Returns:
True if all attributes, roles, and predicates are matched.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

OpenLiberty.org - Licensed under Apache APL 2.0