org.entityfs.cap.entityattrs
Interface ECNamedEntityAttributes<T extends EntityAttributes>

All Superinterfaces:
EntityCapability

public interface ECNamedEntityAttributes<T extends EntityAttributes>
extends EntityCapability

This interface defines an entity capability that can associate several EntityAttributes objects with an entity. Each entity attribute type is identified by a unique name. All entities can have all attribute types specified by the capability provider.

The attributes of an entity is a property of its parent directory. A consequence of this is that a file system's root directory does not support entity attributes since it does not have a parent directory.

Changes made to an EntityAttributes object are not automatically saved to its parent entity. Clients must call setAttributes(String, EntityAttributes) to update the parent entity with the new attributes.

When copying an entity with EntityAttributes, the attributes are not copied. Instead, the target entity is given a default set of attributes.

Since:
1.0
Author:
Karl Gustafsson
See Also:
ECTNamedEntityAttributes, ECEntityAttributes, EntityAttributes
In_jar:
entityfs-entity_attributes

Method Summary
 T getAttributes(String name)
          Get the named attributes for an entity.
 void setAttributes(String name, T attr)
          Set the named attributes for an entity.
 
Methods inherited from interface org.entityfs.cap.EntityCapability
getEntity, isValid
 

Method Detail

getAttributes

T getAttributes(String name)
                                         throws AccessDeniedException,
                                                ReadLockRequiredException,
                                                UnknownEntityAttributeException
Get the named attributes for an entity. The capability provider must have handler objects for the specified entity attribute name.

The returned object is only guaranteed to represent the real attributes of the entity as long as the calling thread has an EntityLock on the entity's parent directory.

Parameters:
name - The name of the attributes.
Returns:
The entity's attributes for the specified name.
Throws:
AccessDeniedException - If the current Subject does not have execute access to the entity's parent directory.
ReadLockRequiredException - If the client does not have a read lock on the entity's parent directory.
UnknownEntityAttributeException - If no handler object is registered for the specified attribute name.
Locks_required:
A read lock on the entity's parent directory.
Permissions_required:
Execute access to the entity's parent directory.

setAttributes

void setAttributes(String name,
                   T attr)
                   throws AccessDeniedException,
                          WriteLockRequiredException,
                          UnknownEntityAttributeException
Set the named attributes for an entity. Previous attributes with the same name are overwritten. The capability provider must have handler objects for the specified entity attribute name.

Parameters:
name - The name of the attributes.
attr - The new attributes.
Throws:
ReadOnlyException - If the entity is read only.
AccessDeniedException - If the current Subject does not have write and execute access to the entity's parent directory.
WriteLockRequiredException - If the client does not have a write lock on the entity's parent directory.
UnknownEntityAttributeException - If no handler object is registered for the specified attribute name.
Locks_required:
A write lock on the entity's parent directory.
Permissions_required:
Write and execute access to the entity's parent directory.