|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.entityfs.impl.impl.AbstractFileSystem
public abstract class AbstractFileSystem
This is an abstract base class for FileSystem
implementations.
Constructor Summary | |
---|---|
protected |
AbstractFileSystem(String name,
SupportObjects fso,
FileSystemDelegate fsd)
|
Method Summary | ||
---|---|---|
void |
addObserver(EntityObserver obs)
Add an observer. |
|
void |
close()
Delegates to the FileSystemAdapter . |
|
int |
countObservers()
Count the number of currently listening observers. |
|
void |
deleteObserver(EntityObserver obs)
Deregister the observer. |
|
void |
deleteObservers()
Deregisters all observers. |
|
protected void |
finalize()
|
|
AccessController |
getAccessController()
Get the file system's access controller. |
|
int |
getBufferSize()
Get the buffer size configured when creating the file system. |
|
|
getCapability(FileSystemCapabilityType<T> t)
Get a supported FileSystemCapability . |
|
|
getCapabilityForEntity(EntityView ev,
EntityCapabilityType<T> type)
Get a supported EntityCapability for an Entity (or an
entity viewed by an EntityView . |
|
FileSystemDelegate |
getDelegate()
Get the file system delegate. |
|
EventManager |
getEventManager()
Get this file system's event manager. |
|
FileSystemAdapter |
getFileSystemAdapter()
Get the backend adapter for this file system. |
|
LockAcquiringStrategy |
getLockAcquiringStrategy()
Get the file system's lock acquiring strategy object. |
|
EntityLockAdapterFactory |
getLockAdapterFactory()
Get the file system's lock adapter factory. |
|
LockCommandExecutor |
getLockCommandExecutor()
Get the file system's lock command executor. |
|
LogAdapter |
getLogAdapter()
Convenient alternative to calling getLogAdapterHolder().getLogAdapter() . |
|
LogAdapterHolder |
getLogAdapterHolder()
Get the file system's current LogAdapterHolder . |
|
String |
getName()
Get the file system's name. |
|
List<EntityObserver> |
getObserverList()
Get the list of EntityObserver :s that are registered for this
file system object. |
|
Directory |
getRootDirectory()
Get the file system's root directory. |
|
Set<FileSystemCapabilityType<?>> |
getSupportedCapabilities()
Get the set of all supported file system capability types for this file system. |
|
Set<EntityCapabilityType<?>> |
getSupportedEntityCapabilities()
Get the set of all supported entity capability types for this file system. |
|
SupportObjects |
getSupportObjects()
Get this file system's support objects. |
|
Directory |
getTemporaryFilesDirectory()
Get the directory where this file system keeps its temporary files. |
|
void |
init()
This method calls init on the file system delegate. |
|
boolean |
isAccessControlling()
Does the file system use any kind of access controls? |
|
void |
setLogAdapter(LogAdapter logAdapter)
|
|
void |
setRootDirectory(DirectoryImplementation di)
Set the file system's root directory. |
|
void |
setTemporaryFilesDirectory(Directory d)
Set the directory where this file system keeps its temporary files. |
|
boolean |
supportsCapability(FileSystemCapabilityType<?> cap)
Check if the file system supports a specific FileSystemCapability
. |
|
boolean |
supportsCapabilityForEntity(EntityView ev,
EntityCapabilityType<?> type)
Check if an Entity (or an entity viewed by an EntityView
supports a specific EntityCapability . |
|
boolean |
supportsCapabilityForEntityType(EntityType et,
EntityCapabilityType<?> type)
Check if a entity type supports a capability type in this file system. |
|
String |
toString()
This method delegates to ... |
|
void |
validateEntityName(String name,
EntityType et)
Default validation implementation. |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.entityfs.FileSystem |
---|
isLocking, isReadOnly, setReadOnly |
Constructor Detail |
---|
protected AbstractFileSystem(String name, SupportObjects fso, FileSystemDelegate fsd)
Method Detail |
---|
public void init()
init
on the file system delegate. Be sure to
call super.init()
if overriding this method.
init
in interface FileSystemImplementation
public void setRootDirectory(DirectoryImplementation di)
FileSystemImplementation
setRootDirectory
in interface FileSystemImplementation
di
- The root directory.public void setTemporaryFilesDirectory(Directory d)
FileSystem
setTemporaryFilesDirectory
in interface FileSystem
d
- The Directory
for temporary files. The directory must be
in this file system.FileSystem.getTemporaryFilesDirectory()
public Directory getTemporaryFilesDirectory()
FileSystem
FileSystem.setTemporaryFilesDirectory(Directory)
before calling this
method.
getTemporaryFilesDirectory
in interface FileSystem
null
if it has not
been set.public FileSystemDelegate getDelegate()
FileSystemImplementation
getDelegate
in interface FileSystemImplementation
public FileSystemAdapter getFileSystemAdapter()
FileSystemImplementation
getFileSystemAdapter
in interface FileSystemImplementation
public void addObserver(EntityObserver obs)
Observable
addObserver
in interface Observable
obs
- The new observer.public void deleteObserver(EntityObserver obs)
Observable
deleteObserver
in interface Observable
obs
- The observer to deregister. If the observer is not listening
to this observable, this method does nothing.public void deleteObservers()
Observable
deleteObservers
in interface Observable
public int countObservers()
Observable
countObservers
in interface Observable
public List<EntityObserver> getObserverList()
FileSystemImplementation
EntityObserver
:s that are registered for this
file system object. The returned list should be immutable.
getObserverList
in interface FileSystemImplementation
EntityObserver
:s.public String getName()
FileSystem
getName
in interface FileSystem
public boolean isAccessControlling()
FileSystem
isAccessControlling
in interface FileSystem
true
if the file system is access controlling, false
if not.public LogAdapterHolder getLogAdapterHolder()
FileSystem
LogAdapterHolder
.
getLogAdapterHolder
in interface FileSystem
LogAdapterHolder
.FileSystem.getLogAdapter()
public EntityLockAdapterFactory getLockAdapterFactory()
FileSystem
LockAdapter
:s for their own locking.
getLockAdapterFactory
in interface FileSystem
public LockAcquiringStrategy getLockAcquiringStrategy()
FileSystem
getLockAcquiringStrategy
in interface FileSystem
public SupportObjects getSupportObjects()
FileSystemImplementation
getSupportObjects
in interface FileSystemImplementation
public LogAdapter getLogAdapter()
FileSystem
getLogAdapterHolder().getLogAdapter()
.
The LogAdapter
returned from this method should not be saved by
the client. (Not for a long time, anyway.) Save the file system's
LogAdapterHolder
instead or let the client call getLogAdapter()
every time it wants to log.
getLogAdapter
in interface FileSystem
LogAdapter
.FileSystem.getLogAdapterHolder()
public AccessController getAccessController()
FileSystem
getAccessController
in interface FileSystem
DisabledAccessController.INSTANCE
if access controls are
disabled.public LockCommandExecutor getLockCommandExecutor()
FileSystem
This is used, for instance, by utility classes to acquire locks required for access control checks and other operations.
The default LockCommandExecutor
implementation is
LockCommandExecutorImpl
. Some
AccessController
:s may require other implementations.
getLockCommandExecutor
in interface FileSystem
public EventManager getEventManager()
FileSystemImplementation
getEventManager
in interface FileSystemImplementation
public int getBufferSize()
FileSystem
getBufferSize
in interface FileSystem
public Directory getRootDirectory()
FileSystem
getRootDirectory
in interface FileSystem
public void setLogAdapter(LogAdapter logAdapter)
public boolean supportsCapability(FileSystemCapabilityType<?> cap)
FileSystem
FileSystemCapability
. Capabilities are either supported directly by file system
implementations or by CapabilityProvider
:s given to the file
system at creation time.
supportsCapability
in interface FileSystem
cap
- The capability's FileSystemCapabilityType
.
true
if the file system supports the capability, false
if not.FileSystem.getCapability(FileSystemCapabilityType)
public <T extends FileSystemCapability> T getCapability(FileSystemCapabilityType<T> t)
FileSystem
FileSystemCapability
.
getCapability
in interface FileSystem
t
- The capability's FileSystemCapabilityType
.
FileSystem.supportsCapability(FileSystemCapabilityType)
public Set<FileSystemCapabilityType<?>> getSupportedCapabilities()
FileSystem
getSupportedCapabilities
in interface FileSystem
public boolean supportsCapabilityForEntity(EntityView ev, EntityCapabilityType<?> type)
FileSystem
Entity
(or an entity viewed by an EntityView
supports a specific EntityCapability
. Capabilities are either
supported directly by file system implementations or by
CapabilityProvider
:s given to the file system at creation time.
supportsCapabilityForEntity
in interface FileSystem
ev
- The EntityView
to check for.type
- The capability's EntityCapabilityType
.
true
if the entity supports the capability, false
if not.FileSystem.getCapabilityForEntity(EntityView, EntityCapabilityType)
,
FileSystem.supportsCapabilityForEntityType(EntityType, EntityCapabilityType)
,
EntityView.supportsCapability(EntityCapabilityType)
public boolean supportsCapabilityForEntityType(EntityType et, EntityCapabilityType<?> type)
FileSystem
CapabilityProvider
:s given to the file system at creation
time.
There may be exceptions to the result returned by this method for certain
special entities (i.e. the root directory). For querying about
capabilities of existing entities, use the
EntityView.supportsCapability(EntityCapabilityType)
method
instead.
supportsCapabilityForEntityType
in interface FileSystem
et
- The entity type.type
- The entity capability type.
true
if the capability type is supported by the supplied
entity type in this file systems. (There may be exceptions to that rule,
however. See above.)FileSystem.supportsCapabilityForEntity(EntityView, EntityCapabilityType)
public <T extends EntityCapability> T getCapabilityForEntity(EntityView ev, EntityCapabilityType<T> type)
FileSystem
EntityCapability
for an Entity
(or an
entity viewed by an EntityView
.
getCapabilityForEntity
in interface FileSystem
ev
- The EntityView
to get the capability object for.type
- The capability's EntityCapabilityType
.
EntityCapability
object for the Entity
.FileSystem.supportsCapabilityForEntity(EntityView, EntityCapabilityType)
,
EntityView.getCapability(EntityCapabilityType)
public Set<EntityCapabilityType<?>> getSupportedEntityCapabilities()
FileSystem
getSupportedEntityCapabilities
in interface FileSystem
public void validateEntityName(String name, EntityType et)
validateEntityName
in interface FileSystemImplementation
name
- The name to validate.et
- The type of the entity.public void close()
FileSystemAdapter
.
close
in interface FileSystem
public String toString()
toString
in class Object
protected void finalize() throws Throwable
finalize
in class Object
Throwable
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |