org.entityfs.cap.entityattrs.impl.metadata
Interface AttributesEntityDelegate<T extends EntityAttributes>

Type Parameters:
T - The kind of EntityAttributes that the implementation uses.
All Superinterfaces:
EntityDelegate
All Known Implementing Classes:
AttributesEnablingDirectoryDelegateProxy, AttributesEnablingFileDelegateProxy

public interface AttributesEntityDelegate<T extends EntityAttributes>
extends EntityDelegate

This interface identifies an EntityDelegate that have some kind of EntityAttributes.

The methods in this interface are not required to do any entity lock verification. That must be handled by the client code that is calling them.

Since:
1.0
Author:
Karl Gustafsson
In_jar:
entityfs-entity_attributes

Method Summary
 T getAttributes()
          Get the entity attributes.
 Class<T> getAttributesType()
          Get the type of entity attributes provided by this delegate.
 void setAttributes(T attr)
          Set (and save) the entity attributes.
 void setDefaultAttributes(String name, ObjectFactory<T> defaultAttributesFactory)
          Set the default attributes for the entity.
 
Methods inherited from interface org.entityfs.impl.EntityDelegate
canRead, canWrite, copy, copyAttributes, exists, getDelegateOfTypeOrNull, getEntityAdapter, getFileSystem, getLastModified, getName, getOwner, init, isReadOnly, rename, setLastModified, setOwner
 

Method Detail

getAttributesType

Class<T> getAttributesType()
Get the type of entity attributes provided by this delegate.

Returns:
The type of entity attributes provided.

getAttributes

T getAttributes()
Get the entity attributes.

Returns:
The entity attributes.

setAttributes

void setAttributes(T attr)
Set (and save) the entity attributes.

Parameters:
attr - The new attributes for the entity.

setDefaultAttributes

void setDefaultAttributes(String name,
                          ObjectFactory<T> defaultAttributesFactory)
Set the default attributes for the entity. This is called for new entities that when a backing file or directory object was also created. (I.e. when the client called DirectoryView.newEntity(EntityType, String, Object).

Implementations of this method may elect to not set any attributes at all. In that case, attributes for the entity will be created the first time that they are set to something.

Implementations of this method cannot call setAttributes(EntityAttributes) to set their attributes since the name of the entity is not set yet when this is called.

Parameters:
name - The name of the new entity.
defaultAttributesFactory - Factory for the default entity attributes for the entity type of the delegate.