|
|||||||||
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<DirectoryDelegate,DirectoryAdapter>
org.entityfs.impl.AbstractDirectoryDelegateProxy
org.entityfs.cap.entityattrs.impl.metadata.AttributesEnablingDirectoryDelegateProxy<T>
public class AttributesEnablingDirectoryDelegateProxy<T extends EntityAttributes>
Constructor Summary | |
---|---|
AttributesEnablingDirectoryDelegateProxy(DirectoryDelegate proxied,
AbstractEntityAttributesEnablingFileSystemDelegate<T> fsd,
ChildEntityAttributeManager<T> parentAttr,
LogAdapterHolder lah)
|
Methods inherited from class org.entityfs.impl.AbstractDirectoryDelegateProxy |
---|
containsEntity, createEntity, getEntityNames, getEntityType |
Methods inherited from class org.entityfs.impl.AbstractEntityDelegateProxy |
---|
canRead, canWrite, copy, exists, getDelegateOfTypeOrNull, getEntityAdapter, getFileSystem, getLastModified, getName, getOwner, init, isReadOnly, setLastModified, setOwner |
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 |
Methods inherited from interface org.entityfs.impl.EntityDelegate |
---|
canRead, canWrite, copy, exists, getDelegateOfTypeOrNull, getEntityAdapter, getFileSystem, getLastModified, getName, getOwner, init, isReadOnly, setLastModified, setOwner |
Constructor Detail |
---|
public AttributesEnablingDirectoryDelegateProxy(DirectoryDelegate proxied, AbstractEntityAttributesEnablingFileSystemDelegate<T> fsd, ChildEntityAttributeManager<T> parentAttr, LogAdapterHolder lah)
Method Detail |
---|
public Class<T> getAttributesType()
AttributesEntityDelegate
getAttributesType
in interface AttributesEntityDelegate<T extends EntityAttributes>
public void setParentAttributes(ChildEntityAttributeManager<T> attr)
public ChildEntityAttributeManager<T> getChildAttributes()
protected AbstractEntityAttributesEnablingFileSystemDelegate<T> getFileSystemDelegate()
protected AttributesEntityDelegate<T> createFileDelegateProxy(FileDelegate proxied)
FileDelegate
proxy. This is called from
createChildDelegate(FileSystemImplementation, EntityType, String, Object, boolean)
.
This implementation creates an
AttributesEnablingFileDelegateProxy
instance. Subclasses may
override this method if they want to create proxies of another type.
proxied
- The FileDelegate
to proxy.
AttributesEnablingFileDelegateProxy
protected AttributesEntityDelegate<T> createDirectoryDelegateProxy(DirectoryDelegate proxied, LogAdapterHolder lah)
DirectoryDelegate
proxy. This is called from
createChildDelegate(FileSystemImplementation, EntityType, String, Object, boolean)
.
This implementation creates an
AttributesEnablingDirectoryDelegateProxy
instance. Subclasses may
override this method if they want to create proxies of another type.
proxied
- The DirectoryDelegate
to proxy.
AttributesEnablingDirectoryDelegateProxy
public EntityDelegate createChildDelegate(FileSystemImplementation fs, EntityType et, String name, Object data, boolean createInBackend)
createFileDelegateProxy(FileDelegate)
and
createDirectoryDelegateProxy(DirectoryDelegate, LogAdapterHolder)
instead.
createChildDelegate
in interface DirectoryDelegate
data
- Data used for creating the delegate. If the created entity is
a file and the data contains a FileDelegate
, the contents of the
supplied FileDelegate
is moved to the new delegate. The caller
must ensure that the supplied FileDelegate
object is discarded.createInBackend
- Should the entity be created in the backend? If
false
, the backend representation (the File
, for
instance) must already exist.public void delete(Collection<String> cetd)
DirectoryDelegate
Since capabilities may add files to a directory that are not visible to the client, this method takes a collection of names of child files that should be deleted before the directory is deleted. If the directory would not be deleted after all named files had been deleted, nothing should be deleted.
delete
in interface DirectoryDelegate
delete
in class AbstractDirectoryDelegateProxy
cetd
- The names of child entities to delete before
the directory is deleted. Capability delegates that use files in the
directory add to this collection. If no names have been added yet, this
argument may be null
. Implementations have to check that. before
calling their proxied delegate. (See comment above.)public void rename(String oldName, DirectoryImplementation targetDir, String newName) throws FileSystemException
EntityDelegate
rename
in interface EntityDelegate
rename
in class AbstractEntityDelegateProxy<DirectoryDelegate,DirectoryAdapter>
oldName
- The old name,targetDir
- The new parent directory.newName
- The new name.
FileSystemException
- On errors.public void assertParentIsReadLocked()
public void assertParentIsWriteLocked()
public T getAttributes()
AttributesEntityDelegate
getAttributes
in interface AttributesEntityDelegate<T extends EntityAttributes>
public void setAttributes(T attrs)
AttributesEntityDelegate
setAttributes
in interface AttributesEntityDelegate<T extends EntityAttributes>
attrs
- The new attributes for the entity.public static <T extends EntityAttributes> DirectoryDelegate proxyRootDirectoryDelegate(DirectoryDelegate dd, AbstractEntityAttributesEnablingFileSystemDelegate<T> fsd, LogAdapterHolder lah)
public Set<EntityView> copyFromEntity(EntityImplementation ent, String targetName, boolean preserveAttrs, List<EntityAttributeSetter> asl, EntityLock[] setupLocks)
copyFromEntity
in interface DirectoryDelegate
copyFromEntity
in class AbstractDirectoryDelegateProxy
ent
- The entity to copy.targetName
- The name of the entity to create.preserveAttrs
- Should entity attributes be copied to the target
entity?asl
- A list of entity attribute setters that are run just after the
target entity has been created and before the setup locks are released.
The setters are run in the order that they are stored in the list. May be
null
. This may only be non-null
when preserveAttrs
is set to true
.setupLocks
- Exception to the rule that the delegate should not
bother with locking. This is here so that the delegate can release the
lock needed for creating a new entity just after it has been created (but
before data is copied to it). This method is responsible for unlocking
this lock regardless of whether it is successful or fails.public void copyAttributes(DirectoryImplementation targetParent, EntityImplementation target)
AbstractEntityDelegateProxy
copyAttributes
in interface EntityDelegate
copyAttributes
in class AbstractEntityDelegateProxy<DirectoryDelegate,DirectoryAdapter>
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.public void setDefaultAttributes(String name, ObjectFactory<T> defaultAttributesFactory)
EntityAttributesPreparer
set. (Otherwise, the attributes will be
set the first time that they are saved.)
Subclasses may override this if necessary.
setDefaultAttributes
in interface AttributesEntityDelegate<T extends EntityAttributes>
name
- The name of the new entity.defaultAttributesFactory
- Factory for the default entity attributes
for the entity type of the delegate.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |