Project Aristotle - ArisID Attribute Services

org.openliberty.arisidbeans
Class IGFObject

java.lang.Object
  extended by org.openliberty.arisidbeans.IGFObject

public abstract class IGFObject
extends java.lang.Object

IGFObject is an abstract class containing get/set and other methods generic to any CARML declaration and this class is inherited by the Bean class generated from a CARML file.


Constructor Summary
IGFObject(IGFObjectManager mgr, IDigitalSubject subj)
          IGFObject is initialized with IGFObjectManager and DigitalSubject
 
Method Summary
 java.util.Map<java.lang.String,IAttributeValue> getAllAttributes()
          Returns a Map containing all AttributeValue objects.
 java.util.Map<java.lang.String,PredicateValue> getAllPredicates()
          Returns a Map containing all PredicateValue objects.
 java.util.Map<java.lang.String,java.lang.Object> getAllProperties()
          Returns a Map containing all AttributeValue, PredicateValue Objects and roles.
 java.util.Map<java.lang.String,java.lang.String> getAllRoles()
          Returns a Map containing all Roles that subject has
 IAttributeValue getAttribute(java.lang.String attribute)
          Returns the AttributeValue containing the values for the requested Attribute as identified by its name identifier.
 java.util.Map<java.lang.String,IAttributeValue> getAttributes(java.lang.String[] attributes)
          Returns a Map containing requested AttributeValue objects.
 java.lang.String getAttributeValue(java.lang.String attribute)
          Returns the first attribute value for the requested attribute as identified by its name identifier.
 java.lang.Exception getError()
          Returns an Exception or null depending on whether there was an error returning the subject.
 PredicateValue getPredicate(java.lang.String predicate)
          Returns the PredicateValue for the requested predicate as identified by its name identifier.
 java.util.Map<java.lang.String,PredicateValue> getPredicates(java.lang.String[] predicates)
          Returns a Map containing requested PredicateValue objects.
 boolean getPredicateValue(java.lang.String predicate)
          Returns the value for the requested Predicate as identified by its name identifier.
 IPrincipalIdentifier getPrincipalIdentifier()
          Returns the IPrincipalIdentifier (a subclass of java.security.Principal) for the subject.
 java.util.Map<java.lang.String,java.lang.Object> getProperties(java.lang.String[] properties)
          Returns a Map containing all requested AttributeValue, PredicateValue Objects and roles.
 java.lang.Object getProperty(java.lang.String property)
          Returns a property Object requested by it's name identifier
 java.lang.Object getPropertyValue(java.lang.String property)
          Returns the first value of the property object requested by it's name identifier.
 java.lang.String getRole(java.lang.String role)
          Returns the requested Role, if exists for the subject, as identified by its name identifier.
 java.util.Map<java.lang.String,java.lang.String> getRoles(java.lang.String[] roles)
          Returns a Map containing all requested Roles that subject has
 java.lang.String getSubjectName()
          Returns Subject's key identifier.
 boolean hasRole(java.lang.String role)
          Returns TRUE if the given role is present for the subject
 boolean isError()
          Returns whether there was an error returning this subject.
 boolean isPredicateTrue(java.lang.String predicateName)
          Returns whether a particular predicate condition is true.
 void setAttribute(ModPropertyValue attr)
          Modifies the attributes value of the Subject in Attribute Authority.
 void setAttribute(ModPropertyValue attr, java.security.Principal user)
          Modifies the attributes value of the Subject in Attribute Authority.
 void setAttributes(java.util.List<ModPropertyValue> attrs)
          Modifies the attributes values of the Subject in Attribute Authority.
 void setAttributes(java.util.List<ModPropertyValue> attrs, java.security.Principal user)
          Modifies the attributes values of the Subject in Attribute Authority.
 void setAttributeValue(java.lang.String attrName, java.lang.String attrValue)
          Modifies the attributes value of the Subject in Attribute Authority for the supplied attribute name and value It goes through each modify interaction and checks if the supplied attribute can be modified in that interaction.
 void setAttributeValue(java.lang.String attrName, java.lang.String attrValue, java.security.Principal user)
          Modifies the attributes value of the Subject in Attribute Authority for the supplied attribute name and value It goes through each modify interaction and checks if the supplied attribute can be modified in that interaction.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IGFObject

public IGFObject(IGFObjectManager mgr,
                 IDigitalSubject subj)
IGFObject is initialized with IGFObjectManager and DigitalSubject

Parameters:
mgr - IGFObjectManager object
subj - DigitalSubject
Method Detail

getPrincipalIdentifier

public IPrincipalIdentifier getPrincipalIdentifier()
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.

Returns:
A IPrincipalIdentifier

getSubjectName

public java.lang.String getSubjectName()
Returns Subject's key identifier.

Returns:
String subject key identifier.

getError

public java.lang.Exception getError()
Returns an Exception or null depending on whether there was an error returning the subject.

Returns:
an Exception that occurred returning this subject.

hasRole

public boolean hasRole(java.lang.String role)
Returns TRUE if the given role is present for the subject

Parameters:
role - The name id of the role to be checked
Returns:
true if the role is present for the subject.

isError

public boolean isError()
Returns whether there was an error returning this subject.

Returns:
true if an error exists.

isPredicateTrue

public boolean isPredicateTrue(java.lang.String predicateName)
Returns whether a particular predicate condition is true.

Parameters:
predicateName - The name id of a predicate.
Returns:
whether a particular predicate condition is present.

getAllAttributes

public java.util.Map<java.lang.String,IAttributeValue> getAllAttributes()
Returns a Map containing all AttributeValue objects. Note an AttributeValue may contain a value or an error.

Returns:
A Map where each AttributeValue is indexed by its name identifier.

getAttributes

public java.util.Map<java.lang.String,IAttributeValue> getAttributes(java.lang.String[] attributes)
Returns a Map containing requested AttributeValue objects. Note an AttributeValue may contain a value or an error.

Parameters:
attributes - Array of attribute names for the attribute request
Returns:
A Map where each AttributeValue is indexed by its name identifier.

getAttribute

public IAttributeValue getAttribute(java.lang.String attribute)
Returns the AttributeValue containing the values for the requested Attribute as identified by its name identifier.

Parameters:
attribute - The name identifier for the attribute request.
Returns:
An AttributeValue containing the values for the requested attribute name identifier.

getAttributeValue

public java.lang.String getAttributeValue(java.lang.String attribute)
Returns the first attribute value for the requested attribute as identified by its name identifier.

Parameters:
attribute - The name identifier for the attribute request.
Returns:
first value of the attribute for the requested attribute name identifier.

getAllPredicates

public java.util.Map<java.lang.String,PredicateValue> getAllPredicates()
Returns a Map containing all PredicateValue objects.

Returns:
A Map where each PredicateValue is indexed by its name identifier.

getPredicates

public java.util.Map<java.lang.String,PredicateValue> getPredicates(java.lang.String[] predicates)
Returns a Map containing requested PredicateValue objects.

Parameters:
predicates - Array of predicate names for the predicate request
Returns:
A Map where each PredicateValue is indexed by its name identifier.

getPredicate

public PredicateValue getPredicate(java.lang.String predicate)
Returns the PredicateValue for the requested predicate as identified by its name identifier.

Parameters:
predicate - The name identifier for the attribute request.
Returns:
a PredicateValue for the requested predicate name identifier.

getPredicateValue

public boolean getPredicateValue(java.lang.String predicate)
Returns the value for the requested Predicate as identified by its name identifier.

Parameters:
predicate - The name identifier for the predicate.
Returns:
the value of the predicate for the requested predicate name identifier.

getAllRoles

public java.util.Map<java.lang.String,java.lang.String> getAllRoles()
Returns a Map containing all Roles that subject has

Returns:
A Map where each Role is indexed by its name identifier.

getRoles

public java.util.Map<java.lang.String,java.lang.String> getRoles(java.lang.String[] roles)
Returns a Map containing all requested Roles that subject has

Returns:
A Map where each Role is indexed by its name identifier.

getRole

public java.lang.String getRole(java.lang.String role)
Returns the requested Role, if exists for the subject, as identified by its name identifier.

Parameters:
role - The name identifier for the role request.
Returns:
a requested role if the role exists for the subject

getAllProperties

public java.util.Map<java.lang.String,java.lang.Object> getAllProperties()
Returns a Map containing all AttributeValue, PredicateValue Objects and roles.

Returns:
A Map where each Property is indexed by its name identifier.

getProperties

public java.util.Map<java.lang.String,java.lang.Object> getProperties(java.lang.String[] properties)
Returns a Map containing all requested AttributeValue, PredicateValue Objects and roles.

Returns:
A Map where each Property is indexed by its name identifier.

getProperty

public java.lang.Object getProperty(java.lang.String property)
Returns a property Object requested by it's name identifier

Returns:
A property Object requested

getPropertyValue

public java.lang.Object getPropertyValue(java.lang.String property)
Returns the first value of the property object requested by it's name identifier.

Returns:
A value of the requested property

setAttributes

public void setAttributes(java.util.List<ModPropertyValue> attrs,
                          java.security.Principal user)
                   throws ConnectionException,
                          PolicyException,
                          NoSuchSubjectException,
                          SubjectNotUniqueException,
                          IDBeanException,
                          OperationNotSupportedException
Modifies the attributes values of the Subject in Attribute Authority. It goes through each modify interaction and checks if all the supplied attributes can be modified in that interaction. If none of the modify interactions support modifying all these attributes, OperationNotSupportedException is thrown.

Parameters:
attrs - Array of AttributeValues to be modified in Attribute Authority
user - The user context to execute under or NULL to use the application context.
Throws:
OperationNotSupportedException
NoSuchSubjectException - The attribute service could not locate a subject within the mapped context to authenticate
ConnectionException - Occurs when there was a connection error trying to connect to the appropriate attribute authority.
PolicyException - Occurs when the modify is refused due to policy restrictions
SubjectNotUniqueException - subject or user cannot be uniquely mapped to a single context or is not unique within a context
IDBeanException - General IdentityBean Exception

setAttributes

public void setAttributes(java.util.List<ModPropertyValue> attrs)
                   throws ConnectionException,
                          PolicyException,
                          NoSuchSubjectException,
                          SubjectNotUniqueException,
                          IDBeanException,
                          OperationNotSupportedException
Modifies the attributes values of the Subject in Attribute Authority. It goes through each modify interaction and checks if all the supplied attributes can be modified in that interaction. If none of the modify interactions support modifying all these attributes, OperationNotSupportedException is thrown.

Parameters:
attrs - Array of AttributeValues to be modified in Attribute Authority
Throws:
OperationNotSupportedException
NoSuchSubjectException - The attribute service could not locate a subject within the mapped context to authenticate
ConnectionException - Occurs when there was a connection error trying to connect to the appropriate attribute authority.
PolicyException - Occurs when the modify is refused due to policy restrictions
SubjectNotUniqueException - subject or user cannot be uniquely mapped to a single context or is not unique within a context
IDBeanException - General IdentityBean Exception

setAttribute

public void setAttribute(ModPropertyValue attr,
                         java.security.Principal user)
                  throws ConnectionException,
                         PolicyException,
                         NoSuchSubjectException,
                         SubjectNotUniqueException,
                         IDBeanException,
                         OperationNotSupportedException
Modifies the attributes value of the Subject in Attribute Authority. It goes through each modify interaction and checks if the supplied attribute can be modified in that interaction. If none of the modify interactions support modifying this attribute, OperationNotSupportedException is thrown.

Parameters:
attr - AttributeValue to be modified in Attribute Authority
user - The user context to execute under or NULL to use the application context.
Throws:
OperationNotSupportedException
NoSuchSubjectException - The attribute service could not locate a subject within the mapped context to authenticate
ConnectionException - Occurs when there was a connection error trying to connect to the appropriate attribute authority.
PolicyException - Occurs when the modify is refused due to policy restrictions
SubjectNotUniqueException - subject or user cannot be uniquely mapped to a single context or is not unique within a context
IDBeanException - General IdentityBean Exception

setAttribute

public void setAttribute(ModPropertyValue attr)
                  throws ConnectionException,
                         PolicyException,
                         NoSuchSubjectException,
                         SubjectNotUniqueException,
                         IDBeanException,
                         OperationNotSupportedException
Modifies the attributes value of the Subject in Attribute Authority. It goes through each modify interaction and checks if the supplied attribute can be modified in that interaction. If none of the modify interactions support modifying this attribute, OperationNotSupportedException is thrown.

Parameters:
attr - AttributeValue to be modified in Attribute Authority
Throws:
OperationNotSupportedException
NoSuchSubjectException - The attribute service could not locate a subject within the mapped context to authenticate
ConnectionException - Occurs when there was a connection error trying to connect to the appropriate attribute authority.
PolicyException - Occurs when the modify is refused due to policy restrictions
SubjectNotUniqueException - subject or user cannot be uniquely mapped to a single context or is not unique within a context
IDBeanException - General IdentityBean Exception

setAttributeValue

public void setAttributeValue(java.lang.String attrName,
                              java.lang.String attrValue,
                              java.security.Principal user)
                       throws ConnectionException,
                              PolicyException,
                              NoSuchSubjectException,
                              SubjectNotUniqueException,
                              IDBeanException,
                              OperationNotSupportedException
Modifies the attributes value of the Subject in Attribute Authority for the supplied attribute name and value It goes through each modify interaction and checks if the supplied attribute can be modified in that interaction. If none of the modify interactions support modifying this attribute, OperationNotSupportedException is thrown.

Parameters:
attrName - Name of the attribute to be modified in Attribute Authority
attrValue - Value of the attribute to be set in Attribute Authority
user - The user context to execute under or NULL to use the application context.
Throws:
OperationNotSupportedException
NoSuchSubjectException - The attribute service could not locate a subject within the mapped context to authenticate
ConnectionException - Occurs when there was a connection error trying to connect to the appropriate attribute authority.
PolicyException - Occurs when the modify is refused due to policy restrictions
SubjectNotUniqueException - subject or user cannot be uniquely mapped to a single context or is not unique within a context
IDBeanException - General IdentityBean Exception

setAttributeValue

public void setAttributeValue(java.lang.String attrName,
                              java.lang.String attrValue)
                       throws ConnectionException,
                              PolicyException,
                              NoSuchSubjectException,
                              SubjectNotUniqueException,
                              IDBeanException,
                              OperationNotSupportedException
Modifies the attributes value of the Subject in Attribute Authority for the supplied attribute name and value It goes through each modify interaction and checks if the supplied attribute can be modified in that interaction. If none of the modify interactions support modifying this attribute, OperationNotSupportedException is thrown.

Parameters:
attrName - Name of the attribute to be modified in Attribute Authority
attrValue - Value of the attribute to be set in Attribute Authority
Throws:
OperationNotSupportedException
NoSuchSubjectException - The attribute service could not locate a subject within the mapped context to authenticate
ConnectionException - Occurs when there was a connection error trying to connect to the appropriate attribute authority.
PolicyException - Occurs when the modify is refused due to policy restrictions
SubjectNotUniqueException - subject or user cannot be uniquely mapped to a single context or is not unique within a context
IDBeanException - General IdentityBean Exception

OpenLiberty.org - Licensed under Apache APL 2.0