org.entityfs.impl
Interface DirectoryImplementation
- All Superinterfaces:
- Comparable<EntityView>, Deletable, Directory, DirectoryView, DirectoryViewImplementation, Entity, EntityAcceptingEntity<DirectoryView>, EntityAcceptingEntityImplementation<DirectoryView>, EntityAcceptingEntityView<DirectoryView>, EntityAcceptingEntityViewImplementation<DirectoryView>, EntityHolder, EntityImplementation, EntityListable, EntityRepository, EntityView, EntityViewImplementation, Iterable<EntityView>, Lockable, Named, Observable, ReadLockable, ReadWriteLockable, ViewCapable<DirectoryView>, WriteLockable
- All Known Implementing Classes:
- DirectoryImpl
public interface DirectoryImplementation
- extends Directory, DirectoryViewImplementation, EntityAcceptingEntityImplementation<DirectoryView>
This is the interface for a Directory
implementation. It contains
methods that are only used by file system implementations; not by file system
clients. A Directory
object can always be cast to a DirectoryImplementation
object.
The methods in this interface should only be used by file system and
capability implementations.
- Since:
- 1.0
- Author:
- Karl Gustafsson
- In_jar:
- entityfs-core
Methods inherited from interface org.entityfs.impl.EntityImplementation |
assertIsReadLocked, assertIsWriteLocked, assertNotReadOnly, assertOk, assertParentIsReadLocked, assertParentIsWriteLocked, createLockInternal, fireEvent, getDelegate, getDelegateOfType, getDelegateOfTypeOrNull, getEntityAdapter, init, verifyHasExecuteAccess, verifyHasExecuteAccessToParent, verifyHasReadAccess, verifyHasReadAccessToParent, verifyHasWriteAccess, verifyHasWriteAccessToParent |
Methods inherited from interface org.entityfs.EntityView |
canRead, canWrite, copy, copy, copyAttributes, createLock, disconnect, getCapability, getFileSystem, getLastModified, getParent, getType, getViewed, getViewedEntity, isConnected, isRootDirectory, isValid, lock, rename, setLastModified, supportsCapability, touch |
removeChildEntity
void removeChildEntity(EntityImplementation entity,
DirectoryImplementation newParent)
- Called by the child entity when it should be removed from the directory.
Responsible for removing the entity from the directory's
ChildEntityManager
and for firing the EntityModifiedEvent
and ChildEntityRemovedEvent
events.
- Parameters:
entity
- The entity to remove.newParent
- The entity's parent directory after the current
operation if the entity is being moved. This is set to null
if
the entity is deleted.
renameChildEntity
void renameChildEntity(String name,
EntityImplementation entity,
DirectoryImplementation oldParent,
String oldName)
- Called by a child entity when it is renamed. If renamed within the same
directory, the child entity should have removed itself by calling
removeChildEntity(EntityImplementation, DirectoryImplementation)
before calling this method, so it should not be present in the child
entity manager by the time that this method is called. This method is
responsible for adding the child entity to the child entity manager and
for firing the ChildEntityRenamedEvent
if the entity was renamed
within the same directory, or the ChildEntityAddedEvent
if the
entity was moved in from another directory.
- Parameters:
name
- The entity's (new) name.entity
- The entity.oldParent
- The old parent directory.oldName
- The old name.
addChildEntity
void addChildEntity(String name,
EntityImplementation entity)
- Used to add a new entity to the directory when an entity is created. This
method is responsible for adding the entity to the
ChildEntityManager
and for firing the
ChildEntityAddedEvent
and EntityModifiedEvent
events.
- Parameters:
name
- The entity's name.entity
- The entity.
handleDisappearingChild
void handleDisappearingChild(EntityImplementation entity)
- This is called by a child entity when its entity object has detected that
the entity has disappeared from the backing file system. This method is
responsible for removing the entity from the child entity manager and for
firing the
ChildEntityDisappearedEvent
.
- Parameters:
entity
- The entity that has disappeared.
assertNoChildEntityWithName
void assertNoChildEntityWithName(String name)
throws EntityFoundException
- Assert that an entity with the given name does not exist in the
directory.
- Parameters:
name
- The name of the entity.
- Throws:
EntityFoundException
- If an entity with the same name exists in
the directory.