|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface MetadataEnablingEntityDelegate
This interface is implemented by metadata-enabling entity delegates. It is
used by capabilities that implement the ECMetadata
and ECNamedMetadata
capabilities.
Metadata is stored in named "files" (the implementation is up to the implementing capability).
Implementations of this class do not have to verify that entities are properly locked. That is done by the capability objects.
This interface is the public API of metadata implementations for other
capability implementations (entity delegates) that need metadata support.
They can get an implementation of this interface by calling
EntityDelegate.getDelegateOfTypeOrNull(Class)
with the argument
MetadataEnablingEntityDelegate.class
. The delegates that use this
interface must ensure that entities are locked according to the contract in
ECMetadata
or ECNamedMetadata
before calling any of this
interface's methods.
Method Summary | |
---|---|
FileDelegate |
createMetadataFile(String name)
Create the entity's metadata file. |
void |
deleteMetadataFile(String name)
Delete the metadata file with the supplied name. |
FileDelegate |
getMetadataFile(String name)
Get a metadata file. |
Set<String> |
getMetadataFileNames()
Get the names of all metadata files. |
Map<String,FileDelegate> |
getMetadataFiles()
Return all the entity's metadata files, mapped under their names. |
boolean |
hasMetadataFile(String name)
Check if the metadata file is created. |
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 |
---|
boolean hasMetadataFile(String name)
The entity must be locked for reading when calling this method. It is up to the caller to verify that.
name
- The name of the metadata file.
true
if the metadata file has been created.FileDelegate createMetadataFile(String name) throws EntityFoundException, ReadOnlyException
The entity must be locked for writing when calling this method. It is up to the caller to verify that.
name
- The name of the metadata file.
EntityFoundException
- If the metadata file already exists.
ReadOnlyException
- If this is called on a read only file system.FileDelegate getMetadataFile(String name)
null
is
returned.
The entity must be locked for reading when calling this method. It is up to the caller to verify that.
name
- The name of the metadata file.
null
if it has not been
created yet.Map<String,FileDelegate> getMetadataFiles()
null
.void deleteMetadataFile(String name) throws ReadOnlyException
name
- The name of the metadata file to delete.
ReadOnlyException
- If the file system is read only.Set<String> getMetadataFileNames()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |