org.eclipse.higgins.idas.api
Interface IHasAttributes

All Known Subinterfaces:
IAuthNAttributesMaterials, IComplexAttrValue, IDigitalSubject

public interface IHasAttributes


Method Summary
 IAttribute addAttribute(IAttribute copyFrom)
          Creates a new Attribute for this container of attributes (typically IDigitalSubject) by copying the data from the passed IAttribute.
 IAttribute addAttribute(URI attrID)
          Creates a new Attribute for this container of attributes (typically IDigitalSubject).
 boolean equals(IHasAttributes attributes)
          Returns true if the passed attribute set is equal to this one.
 IAttribute getAttribute(URI attrID)
          Returns the specified attribute of this object.
 Iterator getAttributes()
          Return all attributes of this object
 ISingleValuedAttribute getSingleValuedAttribute(URI attrID)
          Returns the specified attribute of this object as an ISingleValuedAttribute.
 void removeAttribute(URI attrID)
          Deletes the specified attrID.
 void removeAttributeValue(IAttribute attr)
          Deletes the specified value(s) from the specified attribute.
 void removeAttributeValue(URI attrID, Object value)
          Deletes the specified value from the specified attrID.
 

Method Detail

getAttributes

public Iterator getAttributes()
                       throws IdASException
Return all attributes of this object

Returns:
An Iterator of IAttributes.
Throws:
IdASException

getAttribute

public IAttribute getAttribute(URI attrID)
                        throws IdASException
Returns the specified attribute of this object.

Parameters:
attrID - The identifier of the attribute to be returned.
Returns:
An IAttribute or if none exits.
Throws:
IdASException

getSingleValuedAttribute

public ISingleValuedAttribute getSingleValuedAttribute(URI attrID)
                                                throws IdASException,
                                                       NotSingleValuedAttributeException
Returns the specified attribute of this object as an ISingleValuedAttribute. The caller of this is assumed to have knowledge that the attribute specified in attrID is in fact a single-valued attribute (as defined by the model for that attribute).

Parameters:
attrID - The identifier of the attribute to be returned.
Returns:
An IAttribute or if none exits.
Throws:
IdASException
NotSingleValuedAttributeException - when the specified attrID is not specified by its model as a single-valued attribute.

addAttribute

public IAttribute addAttribute(URI attrID)
                        throws IdASException,
                               InvalidTypeException
Creates a new Attribute for this container of attributes (typically IDigitalSubject). This call is typically followed by one or more calls to IAttribute.addValue(java.net.URI), IAttribute.addSimpleValue(java.net.URI, java.lang.Object), IAttribute.addComplexValue(java.net.URI), (@link IHasMetadata#addMetadata} on the returned IAttribute Note: If the specified attribute already exists, the subsequently added values are added to the subject, adding to the existing values of that attribute (subject to any model restrictions). Note: This operation is only applied to any backing data store after IContext.applyUpdates() is called.

Parameters:
attrID - The URI specifying the type (attributeID) of the Attribute being created
Throws:
{@link - IdASException}
{@link - InvalidTypeException} when the type is invalid
IdASException
InvalidTypeException

addAttribute

public IAttribute addAttribute(IAttribute copyFrom)
                        throws IdASException
Creates a new Attribute for this container of attributes (typically IDigitalSubject) by copying the data from the passed IAttribute. Note: This operation is only applied to any backing data store after IContext.applyUpdates() is called.

Parameters:
copyFrom - an IAttribute from which data is copied to construct a new Attribute
Throws:
{@link - IdASException}
IdASException

removeAttribute

public void removeAttribute(URI attrID)
                     throws IdASException
Deletes the specified attrID. On one hand, this is a convenience method (in that the caller can call this rather than fetching the attribute using getAttribute(URI) and then calling remove on the returned IAttribute. More importantly however is that this method allows an attribute to be removed when the caller has permissions to remove, but no permissions to read that attribute.

Parameters:
attrID - identifies the attribute to be removed
Throws:
IdASException

removeAttributeValue

public void removeAttributeValue(URI attrID,
                                 Object value)
                          throws IdASException
Deletes the specified value from the specified attrID. On one hand, this is a convenience method (in that the caller can call this rather than fetching the attribute using getAttribute(URI), then fetching the appropriate value from the returned IAttribute, and then calling remove on that value. More importantly however is that this method allows an attribute value to be removed when the caller has permissions to remove values, but no permissions to read that attribute or its values.

Parameters:
attrID - identifies the attribute to be removed
value - identifies the attribute value to be removed
Throws:
IdASException

removeAttributeValue

public void removeAttributeValue(IAttribute attr)
                          throws IdASException
Deletes the specified value(s) from the specified attribute. This is simply a convenience method which is equal to calling removeAttributeValue(URI, Object) once for each value in attr.

Parameters:
attr - Holds one or more values to be deleted from the attribute (named in attr)
Throws:
IdASException

equals

public boolean equals(IHasAttributes attributes)
               throws IdASException
Returns true if the passed attribute set is equal to this one. The sets are compared for size, and then each attribute in the set is compared for equality

Parameters:
attributes - the set of attributes to compare to this one
Returns:
true if the sets are equal, false otherwise.
Throws:
IdASException