org.entityfs.cap.metadata.impl
Class ECNamedMetadataImpl

java.lang.Object
  extended by org.entityfs.cap.metadata.impl.AbstractECMetadata
      extended by org.entityfs.cap.metadata.impl.ECNamedMetadataImpl
All Implemented Interfaces:
EntityCapability, ECNamedMetadata

public class ECNamedMetadataImpl
extends AbstractECMetadata
implements ECNamedMetadata


Constructor Summary
ECNamedMetadataImpl(EntityImplementation parent, MetadataEnablingEntityDelegate delegate)
           
 
Method Summary
 void deleteMetadataFile(String name)
          Delete the named metadata file.
 ReadWritableFile getMetadataFile(String name)
          Get the named metadata file.
 Set<String> getMetadataFileNames()
          Get a set containing all metadata file names for the entity.
 boolean hasMetadataFile(String name)
          Check if the entity has a metadata file with the supplied name.
 ReadWritableFile newMetadataFile(String name)
          Create a new metadata file.
 
Methods inherited from class org.entityfs.cap.metadata.impl.AbstractECMetadata
getEntity, getParentEntity, isValid, prepareForRead, prepareForWrite
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.entityfs.cap.EntityCapability
getEntity, isValid
 

Constructor Detail

ECNamedMetadataImpl

public ECNamedMetadataImpl(EntityImplementation parent,
                           MetadataEnablingEntityDelegate delegate)
Method Detail

getMetadataFileNames

public Set<String> getMetadataFileNames()
Description copied from interface: ECNamedMetadata
Get a set containing all metadata file names for the entity.

Specified by:
getMetadataFileNames in interface ECNamedMetadata
Returns:
A set with all metadata file names. This set may be empty, but never null.

hasMetadataFile

public boolean hasMetadataFile(String name)
Description copied from interface: ECNamedMetadata
Check if the entity has a metadata file with the supplied name.

Specified by:
hasMetadataFile in interface ECNamedMetadata
Parameters:
name - The name of the metadata file to look for. This name is case-sensitive.
Returns:
true if the entity has a metadata file with the supplied name, false if not.

getMetadataFile

public ReadWritableFile getMetadataFile(String name)
                                 throws EntityNotFoundException
Description copied from interface: ECNamedMetadata
Get the named metadata file.

Specified by:
getMetadataFile in interface ECNamedMetadata
Parameters:
name - The name of the metadata file. This must be a valid file name in the backing file system.
Returns:
The metadata file with the supplied name,
Throws:
EntityNotFoundException - If no metadata file with the supplied name exists for the entity.

newMetadataFile

public ReadWritableFile newMetadataFile(String name)
                                 throws EntityFoundException,
                                        ReadOnlyException
Create a new metadata file.

Specified by:
newMetadataFile in interface ECNamedMetadata
Parameters:
name - The name of the metadata file. This must be a valid file name in the backing file system.
Returns:
The new metadata file.
Throws:
EntityFoundException - If the entity already has a metadata file with the supplied name.
ReadOnlyException - If the file system is read only.

deleteMetadataFile

public void deleteMetadataFile(String name)
                        throws EntityNotFoundException,
                               ReadOnlyException
Delete the named metadata file.

Specified by:
deleteMetadataFile in interface ECNamedMetadata
Parameters:
name - The name of the metadata file.
Throws:
EntityNotFoundException - If no such metadata file exists.
ReadOnlyException - If the file system is read only.