|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.entityfs.impl.AbstractFileSystemBuilder<T>
T
- The concrete file system builder type.public abstract class AbstractFileSystemBuilder<T extends FileSystemBuilder<T>>
This abstract base class can serve as the starting point for an
FileSystemBuilder
implementation.
Field Summary |
---|
Fields inherited from interface org.entityfs.FileSystemBuilder |
---|
DEFAULT_BUFFER_SIZE |
Constructor Summary | |
---|---|
protected |
AbstractFileSystemBuilder(LogAdapter la,
EntityValidityControlStrategy evcs)
|
Method Summary | |
---|---|
T |
addCapabilityProvider(CapabilityProvider cp)
Add a capability provider to the file system. |
T |
addCapabilityProviders(Collection<? extends CapabilityProvider> c)
Add a collection of capability providers. |
T |
disableAccessControls()
Disable access controls in the file system altogether. |
T |
disableEntityValidityControls()
Disable entity validity controls altogether. |
T |
enableLocking()
Enable locking for the file system with default values for the lock acquiring strategy and the lock adapter factory. |
AccessController |
getAccessController()
Get the file system's access controller. |
int |
getBufferSize()
Get the size of temporary buffers in the file system. |
Collection<CapabilityProvider> |
getCapabilityProviders()
Get the file system's capability providers. |
protected Collection<CapabilityProvider> |
getCapabilityProvidersInternal()
Get the file system's capability providers, cast to CapabilityProviderImplementation . |
EntityValidityControlStrategy |
getEntityValidityControlStrategy()
Get the file system's entity validity control strategy. |
LockAcquiringStrategy |
getLockAcquiringStrategy()
Get the file system's lock acquiring strategy. |
EntityLockAdapterFactory |
getLockAdapterFactory()
Get the file system's lock adapter factory. |
LockCommandExecutor |
getLockCommandExecutor()
Get the org.entityfs.lock.cmd.LockCommandExecutor . |
LogAdapter |
getLogAdapter()
Get the file system's log adapter, if set. |
String |
getName()
Get the file system's name, if set. |
protected T |
getThis()
Get this cast to its actual type. |
T |
setAccessController(AccessController ac)
Set an access controller. |
T |
setBufferSize(int size)
Set the size of temporary buffers in the file system. |
T |
setEntityValidityControlStrategy(EntityValidityControlStrategy evcs)
Set the entity validity control strategy -- the strategy for validating existing entities. |
T |
setLockAcquiringStrategy(LockAcquiringStrategy las)
Set the lock acquiring strategy. |
T |
setLockAdapterFactory(EntityLockAdapterFactory laf)
Set the lock adapter factory. |
T |
setLockCommandExecutor(LockCommandExecutor lce)
Set a new org.entityfs.lock.cmd.LockCommandExecutor . |
T |
setLogAdapter(LogAdapter la)
Set the file system's log adapter. |
T |
setName(String name)
Set the file system's optional name. |
protected Collection<String> |
validate()
Validate that we can create a file system with the current properties. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.entityfs.FileSystemBuilder |
---|
create, enableEvents, isLockingSupported |
Constructor Detail |
---|
protected AbstractFileSystemBuilder(LogAdapter la, EntityValidityControlStrategy evcs)
Method Detail |
---|
protected final T getThis()
this
cast to its actual type. This is useful for returning
the right type of this
when implementing setter methods that
return the called object.
this
cast to its actual type.public T setLogAdapter(LogAdapter la)
setLogAdapter
in interface FileSystemBuilder<T extends FileSystemBuilder<T>>
la
- A log adapter.
this
FileSystem.getLogAdapterHolder()
public LogAdapter getLogAdapter()
getLogAdapter
in interface FileSystemBuilder<T extends FileSystemBuilder<T>>
public T setLockCommandExecutor(LockCommandExecutor lce)
org.entityfs.lock.cmd.LockCommandExecutor
.
The default org.entityfs.lock.cmd.LockCommandExecutor
is the
LockCommandExecutorImpl
. Some
AccessController
implementations may
require other LockCommandExecutor
implementations.
lce
- The new LockCommandExecutor
.
this
.public LockCommandExecutor getLockCommandExecutor()
org.entityfs.lock.cmd.LockCommandExecutor
.
org.entityfs.lock.cmd.LockCommandExecutor
.public T setLockAcquiringStrategy(LockAcquiringStrategy las)
setLockAcquiringStrategy
in interface FileSystemBuilder<T extends FileSystemBuilder<T>>
las
- The lock acquiring strategy.
this
.public LockAcquiringStrategy getLockAcquiringStrategy()
getLockAcquiringStrategy
in interface FileSystemBuilder<T extends FileSystemBuilder<T>>
public T setLockAdapterFactory(EntityLockAdapterFactory laf)
setLockAdapterFactory
in interface FileSystemBuilder<T extends FileSystemBuilder<T>>
laf
- A lock adapter factory.
this
public EntityLockAdapterFactory getLockAdapterFactory()
getLockAdapterFactory
in interface FileSystemBuilder<T extends FileSystemBuilder<T>>
public T enableLocking() throws UnsupportedOperationException
This is equivalent to calling
setLockAcquiringStrategy(LockAcquiringStrategy)
with a
SimpleLockAcquiringStrategy
and then
setLockAdapterFactory(EntityLockAdapterFactory)
with a
NonFairReadWriteEntityLockAdapterFactory
.
enableLocking
in interface FileSystemBuilder<T extends FileSystemBuilder<T>>
this
UnsupportedOperationException
- If the file system being built does
not support locking.FileSystemBuilder.isLockingSupported()
public T setEntityValidityControlStrategy(EntityValidityControlStrategy evcs)
If this is set to null
, the validity controls are disabled
altogether. If a backing file or directory disappears in a file system
without validity controls, for instance by someone deleting it directly
in the backing file system, this may lead to strange errors.
setEntityValidityControlStrategy
in interface FileSystemBuilder<T extends FileSystemBuilder<T>>
evcs
- The validity control strategy, or null
to disable the
validation.
this
disableEntityValidityControls()
public T disableEntityValidityControls()
disableEntityValidityControls
in interface FileSystemBuilder<T extends FileSystemBuilder<T>>
this
setEntityValidityControlStrategy(EntityValidityControlStrategy)
public EntityValidityControlStrategy getEntityValidityControlStrategy()
getEntityValidityControlStrategy
in interface FileSystemBuilder<T extends FileSystemBuilder<T>>
public T setAccessController(AccessController ac)
setAccessController
in interface FileSystemBuilder<T extends FileSystemBuilder<T>>
ac
- An access controller.
this
.public T disableAccessControls()
Access controls are disabled by default, so normally there should be no reason for calling this method.
disableAccessControls
in interface FileSystemBuilder<T extends FileSystemBuilder<T>>
this
.public AccessController getAccessController()
getAccessController
in interface FileSystemBuilder<T extends FileSystemBuilder<T>>
public T setName(String name)
setName
in interface FileSystemBuilder<T extends FileSystemBuilder<T>>
name
- The file system name,
this
.public String getName()
getName
in interface FileSystemBuilder<T extends FileSystemBuilder<T>>
public T addCapabilityProvider(CapabilityProvider cp)
addCapabilityProvider
in interface FileSystemBuilder<T extends FileSystemBuilder<T>>
cp
- A capability provider.
this
.addCapabilityProviders(Collection)
public T addCapabilityProviders(Collection<? extends CapabilityProvider> c)
addCapabilityProviders
in interface FileSystemBuilder<T extends FileSystemBuilder<T>>
c
- A collection of capability providers.
this
addCapabilityProvider(CapabilityProvider)
public Collection<CapabilityProvider> getCapabilityProviders()
getCapabilityProviders
in interface FileSystemBuilder<T extends FileSystemBuilder<T>>
protected Collection<CapabilityProvider> getCapabilityProvidersInternal()
CapabilityProviderImplementation
.
public T setBufferSize(int size)
FileSystemBuilder.DEFAULT_BUFFER_SIZE
.
setBufferSize
in interface FileSystemBuilder<T extends FileSystemBuilder<T>>
size
- The size of temporary buffers.
this
.public int getBufferSize()
getBufferSize
in interface FileSystemBuilder<T extends FileSystemBuilder<T>>
protected Collection<String> validate()
super.validate()
).
Collection
of error messages. Can be empty but never
null
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |