se.entitymanager.logic
Interface LogicFacade

All Known Implementing Classes:
FileLogicFacade

public interface LogicFacade

The interface for facades of all backends.

All backends must have a facade, that implements this interface. All frontends will access their backends only by this facade.


Method Summary
 void addEntityChangeListener(EntityChangedListener listener)
          Adds listener for changed entites.
 void copy(EntityInterface entity)
          Copies an entity.
 void delete(EntityInterface entity)
          Deletes an entity.
 java.util.Collection getAllChildren(EntityInterface entity)
          Returns sub-entities of folderish entity.
 EntityInterface getClipboardEntity()
          Returns entity to be pasted.
 java.util.Comparator getComparator()
          Returns a comparator for entity interfaces.
 boolean getDeleteAfterPaste()
           
 java.lang.String getEntityLastModified(EntityInterface entity)
          Returns date of last modification of entity.
 java.lang.String getEntityName(EntityInterface entity)
          Returns name of entity.
 java.lang.String getEntitySize(EntityInterface entity)
          Returns size of entity.
 EntityInterface getRootEntity()
          Returns root entity.
 boolean isEntityReadable(EntityInterface entity)
          Returns if file is readable.
 boolean isEntityWriteable(EntityInterface entity)
          Returns if file is writable.
 boolean isFolderish(EntityInterface entity)
          Returns whether entity is folderish.
 void paste(EntityInterface destinationEntity)
          Pastes to an entity.
 void removeEntityChangeListener(EntityChangedListener listener)
          Removes listener for changed entities.
 void rename(EntityInterface entity, java.lang.String newName)
          Renames an entity.
 void setDeleteAfterPaste(boolean shouldBeDeleted)
           
 

Method Detail

getRootEntity

EntityInterface getRootEntity()
Returns root entity.

All entities must be within a tree like hierarchy. This method returns the root of this hierarchy.

Returns:
root entity

getEntityName

java.lang.String getEntityName(EntityInterface entity)
Returns name of entity.

All entities must have name. This method returns the name of the given entity.

Parameters:
entity - the entity
Returns:
name of entity

getClipboardEntity

EntityInterface getClipboardEntity()
Returns entity to be pasted.

Returns:
name of entity to be pasted

getEntitySize

java.lang.String getEntitySize(EntityInterface entity)
Returns size of entity.

All entities must have size. This method returns the size of the given entity.

Parameters:
entity - the entity
Returns:
size of entity

getEntityLastModified

java.lang.String getEntityLastModified(EntityInterface entity)
Returns date of last modification of entity.

All entities must have date of last modification. This method returns the date of last modification of the given entity.

Parameters:
entity - the entity
Returns:
date of last modification of entity

isEntityReadable

boolean isEntityReadable(EntityInterface entity)
Returns if file is readable.

Parameters:
entity - the entity
Returns:
true if file associated with entity is redable

isEntityWriteable

boolean isEntityWriteable(EntityInterface entity)
Returns if file is writable.

Parameters:
entity - the entity
Returns:
true if file associated with entity is writable

isFolderish

boolean isFolderish(EntityInterface entity)
Returns whether entity is folderish.

Folderish entities may contain other entities. These may be accessed with method getAllChildren.

Parameters:
entity - the entity
Returns:
true if entity is folderish, false otherwise
See Also:
getAllChildren(EntityInterface)

getAllChildren

java.util.Collection getAllChildren(EntityInterface entity)
                                    throws EntityNotFolderishException
Returns sub-entities of folderish entity.

Parameters:
entity - the entity
Returns:
sub-entities
Throws:
EntityNotFolderishException

rename

void rename(EntityInterface entity,
            java.lang.String newName)
            throws EntityRenameFailedException
Renames an entity.

Parameters:
entity - the entity
newName - new name for the entity
Throws:
EntityRenameFailedException - if an error occured

delete

void delete(EntityInterface entity)
            throws EntityDeletionFailedException
Deletes an entity.

Parameters:
entity - the entity
Throws:
EntityDeletionFailedException - if an error occured

setDeleteAfterPaste

void setDeleteAfterPaste(boolean shouldBeDeleted)

getDeleteAfterPaste

boolean getDeleteAfterPaste()

copy

void copy(EntityInterface entity)
          throws EntityCopyCutFailedException
Copies an entity.

Parameters:
entity - the entity
Throws:
EntityCopyCutFailedException - if an error occured

paste

void paste(EntityInterface destinationEntity)
           throws EntityPasteFailedException
Pastes to an entity.

Parameters:
entity - the entity
Throws:
EntityPasteFailedException - if an error occured

getComparator

java.util.Comparator getComparator()
Returns a comparator for entity interfaces. The sort criteria depends on implementation.

Returns:
comparator for entity interfaces

addEntityChangeListener

void addEntityChangeListener(EntityChangedListener listener)
Adds listener for changed entites.

Parameters:
listener - the listener to add

removeEntityChangeListener

void removeEntityChangeListener(EntityChangedListener listener)
Removes listener for changed entities.

Parameters:
listener - the listener to remove