com.ibm.pim.attribute
Interface AttributeOwner

All Known Subinterfaces:
Category, CollaborationCategory, CollaborationItem, ExtendedAttributeOwner, Item, LookupTableEntry, Organization

public interface AttributeOwner

This is the group of common methods for objects that have Spec Driven attributes.


Field Summary
static java.lang.String copyright
           
 
Method Summary
 AttributeChanges getAttributeChangesComparedTo(AttributeOwner otherAttributeOwner)
          Return the difference between this and another AttributeOwner at attribute level.
 AttributeChanges getAttributeChangesSinceLastSave()
          Return the changes at the attribute level since the last time the attribute owner was saved successfully.
 AttributeInstance getAttributeInstance(java.lang.String attributeInstancePath)
          Retrieve the attribute instance at the specified path.
 java.lang.Object getAttributeValue(java.lang.String attributeInstancePath)
          Retrieve the attribute value at the specified path for this item.
 long getLastModifiedTimeMillis()
          get the the last modified time in milliseconds for the given Entry Object
 AttributeOwner getOriginalAttributeOwner()
          get the Original Entry for the given Entry Object
 AttributeInstance getRootAttributeInstance(Spec spec)
          Return the root attribute instance for the spec.
 java.util.List<AttributeInstance> getRootAttributeInstances()
          Return all the root attribute instances for all specs, including primary spec, secondary spec, etc.
 java.util.Collection<Spec> getSpecs()
          Returns all the specs in which this item participates.
 boolean isComparable(AttributeOwner owner)
          Check if this attribute owner is comparable with the given owner.
 void setAttributeValue(java.lang.String attributeInstancePath, java.lang.Object value)
          Set an attribute value on this item at the specified Attribute Path.
 

Field Detail

copyright

static final java.lang.String copyright
See Also:
Constant Field Values
Method Detail

getSpecs

java.util.Collection<Spec> getSpecs()
Returns all the specs in which this item participates.

Returns:
A Collection of Spec
Throws:
PIMInternalException - If an internal error occurs.
PIMAuthorizationException - reserved for future use

getAttributeInstance

AttributeInstance getAttributeInstance(java.lang.String attributeInstancePath)
Retrieve the attribute instance at the specified path.

The path should be of the same format as the attribute definition (starting with a "/") and should use the "#" to indicate the occurrence number.

Parameters:
attributeInstancePath - - the attribute instance path
Returns:
the attribute instance at the specified path, or null if no instance exists at this path. Returns an AttributeInstance object for optional attributes(For a lookup spec, all the attributes are optional attributes.) Returns null for grouping attributes and multi occurrence attributes if no instance exists at this path
Throws:
java.lang.IllegalArgumentException - If the attributeInstancePath parameter is null or empty
java.lang.UnsupportedOperationException - If the attribute path is invalid
PIMInternalException - If an internal error occurs.
PIMAuthorizationException - See subclasses for the specific permission
See Also:
for more information on attribute instance paths

getRootAttributeInstances

java.util.List<AttributeInstance> getRootAttributeInstances()
Return all the root attribute instances for all specs, including primary spec, secondary spec, etc.

For each spec, there is one root attribute instance. A root attribute instance is the top level grouping.

Returns:
List of the root attribute instances, each one corresponding to a spec of the attributeOwner.
Throws:
PIMInternalException - If an internal error occurs.
PIMAuthorizationException - Reserved for future use

getRootAttributeInstance

AttributeInstance getRootAttributeInstance(Spec spec)
Return the root attribute instance for the spec.

This is the top level grouping. Calling getChildren on this method gives the attribute instances that correspond to the first level of the spec, and these instances will be either of type "value" or "multi-occurrence"

Note, this is equivalent to calling getAttributeInstance("/" + theSpec.getName()) and it is possible that this convenience method is not necessary.

Parameters:
spec -
Returns:
The root attribute instance.
Throws:
PIMInternalException - If an internal error occurs.
PIMAuthorizationException - Reserved for future use

isComparable

boolean isComparable(AttributeOwner owner)
Check if this attribute owner is comparable with the given owner.

Parameters:
owner - an attribute owner
Returns:
true if the attribute owners are the same type of entity.

getAttributeChangesComparedTo

AttributeChanges getAttributeChangesComparedTo(AttributeOwner otherAttributeOwner)
Return the difference between this and another AttributeOwner at attribute level. This will query to find information about the differences between this attribute owner (B) and the other attribute owner (A).

Parameters:
otherAttributeOwner - - another AttributeOwner to compare with
Returns:
an AttributeChanges object.
Throws:
java.lang.IllegalArgumentException - If the previousVersion parameters is null
PIMInternalException - If an internal error occurs.
PIMAuthorizationException - Reserved for future use

getAttributeChangesSinceLastSave

AttributeChanges getAttributeChangesSinceLastSave()
Return the changes at the attribute level since the last time the attribute owner was saved successfully. This will query to find information about the differences between this attribute owner when it was last saved (A) and the current in memory form (B).

Returns:
an AttributeChanges object.

getAttributeValue

java.lang.Object getAttributeValue(java.lang.String attributeInstancePath)
Retrieve the attribute value at the specified path for this item.

Parameters:
attributeInstancePath - - an attribute instance path that is valid & can be instantiated.
Returns:
the value of the attribute instance
Throws:
java.lang.IllegalArgumentException - If the attributeInstancePath parameters is null or empty
java.lang.UnsupportedOperationException - If the path is invalid
PIMInternalException - If an internal error occurs
PIMAuthorizationException - Reserved for future use

setAttributeValue

void setAttributeValue(java.lang.String attributeInstancePath,
                       java.lang.Object value)
Set an attribute value on this item at the specified Attribute Path.

If an AttributeInstance exists at this path, the value will be overwritten. If an AttributeInstance does not exist at this path, one will be created with the specified value, and returned.

Note that if there is a type conversion exception due to invalid value, that will result in a validation error and the value will not be saved. Validation errors can be obtained using save or validate methods.

Parameters:
attributeInstancePath - - a path at which an attribute instance exists or can be created
value - - the value for the AttributeInstance
Throws:
java.lang.IllegalArgumentException - If the attributeInstancePath parameters is null or empty
java.lang.UnsupportedOperationException - If the path is invalid or cannot be instantiated
PIMInternalException - If an internal error occurs
PIMAuthorizationException - If the user does not have the equivalent of Permission.CATALOG_MODIFY_ITEMS
See Also:
for more details on attribute paths

getOriginalAttributeOwner

AttributeOwner getOriginalAttributeOwner()
get the Original Entry for the given Entry Object

Throws:
PIMInternalException - If an internal error occurs
PIMAuthorizationException
See Also:
CategoryImpl (the implemantor classes for more details )

getLastModifiedTimeMillis

long getLastModifiedTimeMillis()
get the the last modified time in milliseconds for the given Entry Object

Throws:
PIMInternalException - If an internal error occurs
PIMAuthorizationException
See Also:
GenericEntryImpl (the implemantor classes for more details )