|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.entityfs.support.lang.ObjectProxySupport<T>
org.entityfs.impl.AbstractEntityDelegateProxy<T,U>
public abstract class AbstractEntityDelegateProxy<T extends EntityDelegate,U extends EntityAdapter>
This is an abstract stub implementation of an entity delegate proxy that forwards all method calls to the proxied delegate. This can be used as a starting point for implementing custom delegate proxies.
Constructor Summary | |
---|---|
protected |
AbstractEntityDelegateProxy(T proxied)
|
Method Summary | |
---|---|
boolean |
canRead()
Check with the backend to see if this entity can be read. |
boolean |
canWrite()
Check with the backend to see if this entity can be written to. |
Set<EntityView> |
copy(DirectoryImplementation targetDir,
String targetName,
boolean preserveAttrs,
List<EntityAttributeSetter> asl,
EntityLock[] setupLocks)
Copy the entity. |
void |
copyAttributes(DirectoryImplementation targetParent,
EntityImplementation target)
This implementation does not copy any attributes. |
boolean |
exists()
Does the entity really exist in the backend? This is used by some EntityValidityControlStrategy :s. |
EntityDelegate |
getDelegateOfTypeOrNull(Class<? extends EntityDelegate> c)
Get an instance of a specific delegate type from the chain of delegates. |
EntityAdapter |
getEntityAdapter()
Get the underlying EntityAdapter . |
FileSystemImplementation |
getFileSystem()
Get the file system that owns this delegate's entity. |
long |
getLastModified()
Get the last time that the entity was modified. |
String |
getName()
Get the entity's name. |
EntityImplementation |
getOwner()
Get the owner of this delegate. |
void |
init()
If overriding this implementation, remember to call super.init() ! |
boolean |
isReadOnly()
Does the delegate or a delegate proxy make this entity read only? |
void |
rename(String oldName,
DirectoryImplementation targetDir,
String newName)
Rename and/or move the entity. |
void |
setLastModified(long t)
Set the time of last modification for the entity. |
void |
setOwner(EntityImplementation ent)
This is set when the entity object is created. |
Methods inherited from class org.entityfs.support.lang.ObjectProxySupport |
---|
equals, getProxied, hashCode, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
protected AbstractEntityDelegateProxy(T proxied)
Method Detail |
---|
public void init()
super.init()
!
init
in interface EntityDelegate
public EntityDelegate getDelegateOfTypeOrNull(Class<? extends EntityDelegate> c)
EntityDelegate
getDelegateOfTypeOrNull
in interface EntityDelegate
c
- The delegate type.
null
if no such delegate can be
found.public void setOwner(EntityImplementation ent)
EntityDelegate
setOwner
in interface EntityDelegate
ent
- The owning entity object.EntityDelegate.init()
public EntityImplementation getOwner()
EntityDelegate
getOwner
in interface EntityDelegate
public FileSystemImplementation getFileSystem()
EntityDelegate
getFileSystem
in interface EntityDelegate
public EntityAdapter getEntityAdapter()
EntityDelegate
EntityAdapter
. This should only be called by
delegate proxies that introduce entirely new entity types.
getEntityAdapter
in interface EntityDelegate
public boolean exists()
EntityDelegate
EntityValidityControlStrategy
:s.
exists
in interface EntityDelegate
true
if the entity exists in the backend.public boolean canRead()
EntityDelegate
canRead
in interface EntityDelegate
true
if the backend can be read.public boolean canWrite()
EntityDelegate
If EntityDelegate.isReadOnly()
returns true
, this method should always
return false
. (The opposite is not true, however.)
canWrite
in interface EntityDelegate
true
if the backend can be written to.public boolean isReadOnly()
EntityDelegate
This method is invoked frequently and should execute fast. It is only invoked for read/write file systems.
isReadOnly
in interface EntityDelegate
true
if the delegate has made the entity read only.public long getLastModified()
EntityDelegate
getLastModified
in interface EntityDelegate
public void setLastModified(long t)
EntityDelegate
setLastModified
in interface EntityDelegate
t
- A time stamp.public String getName()
EntityDelegate
getName
in interface EntityDelegate
public void rename(String oldName, DirectoryImplementation targetDir, String newName)
EntityDelegate
rename
in interface EntityDelegate
oldName
- The old name,targetDir
- The new parent directory.newName
- The new name.public Set<EntityView> copy(DirectoryImplementation targetDir, String targetName, boolean preserveAttrs, List<EntityAttributeSetter> asl, EntityLock[] setupLocks)
EntityDelegate
copy
in interface EntityDelegate
targetDir
- The target directory of the new entity. This directory
may be in another file system.targetName
- The name of the new entity.preserveAttrs
- Should entity attributes be copied to the target
entity?asl
- A list of EntityAttributeSetter
:s that are run just
after the target entity has been created, before the setupLocks
are released. This may be null
. This may only be non-null
if preserveAttrs
is true
.setupLocks
- Exception to the rule that the delegate should not
bother with locking. This is here so that the delegate can release locks
used to set up the target entity before data is copied to it. This method
is responsible for unlocking this lock regardless of whether it is
successful or fails.
Set
are real entities, not views.public void copyAttributes(DirectoryImplementation targetParent, EntityImplementation target)
copyAttributes
in interface EntityDelegate
targetParent
- The parent directory of the target. This is null
if target
is a root directory of a file system. Otherwise
it is locked for writing.target
- The target entity to copy attributes to. Locked for
writing.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |