org.entityfs.cap
Interface EntityCapability

All Known Subinterfaces:
DCSymbolicLink, ECAt4jZipEntry, ECEntityAttributes<T>, ECEntityAttributesImplementation<T>, ECFileResolvable, ECJarEntry, ECMetadata, ECNamedEntityAttributes<T>, ECNamedMetadata, ECNtfsAttributes, ECUnixAttributes, ECUriResolvable, ECZipEntry, FCAppendable, FCFileBacked, FCRandomAccess
All Known Implementing Classes:
AbstractEntityCapability, DCSymbolicLinkImpl, ECEntityAttributesImpl, ECMetadataImpl, ECNamedMetadataImpl, ECZipEntryImpl, FCAppendableImpl, FCRandomAccessImpl

public interface EntityCapability

This is the interface for an entity capability; a capability that adds functionality to an entity in some way. Entity capabilities may be valid for all sorts of entities or only for certain sorts of entities.

An entity capability is identified by an EntityCapabilityType singleton instance.

An entity capability implementation for an entity can be had by calling EntityView.getCapability(EntityCapabilityType) or FileSystem.getCapabilityForEntity(EntityView, EntityCapabilityType).

Capability classes are named according to a name standard. Their names have a prefix telling what kind of entities that can have the capability:

Since:
1.0
Author:
Karl Gustafsson
See Also:
EntityCapabilityType, FileSystemCapability
In_jar:
entityfs-core

Method Summary
 Entity getEntity()
          Get the entity that this capability object is for.
 boolean isValid()
          Check if this capability object is valid.
 

Method Detail

isValid

boolean isValid()
                throws ReadLockRequiredException,
                       AccessDeniedException
Check if this capability object is valid.

A capability object becomes invalid when its entity is deleted.

Returns:
true if this capability is still valid, false if not.
Throws:
ReadLockRequiredException - If the client does not have a read lock for the viewed entity.
AccessDeniedException - If the client does not have read access to the entity.
Locks_required:
A read lock on the entity.
Permissions_required:
Read access.

getEntity

Entity getEntity()
Get the entity that this capability object is for.

Returns:
The entity.