org.apache.chemistry.opencmis.inmemory.storedobj.impl
Class AbstractMultiFilingImpl

java.lang.Object
  extended by org.apache.chemistry.opencmis.inmemory.storedobj.impl.StoredObjectImpl
      extended by org.apache.chemistry.opencmis.inmemory.storedobj.impl.AbstractMultiFilingImpl
All Implemented Interfaces:
Filing, MultiFiling, StoredObject
Direct Known Subclasses:
DocumentImpl, VersionedDocumentImpl

public abstract class AbstractMultiFilingImpl
extends StoredObjectImpl
implements MultiFiling

AbstractMultiPathImpl is the common superclass of all objects hold in the repository that have multiple parent folders, these are: Folders

Author:
Jens

Field Summary
protected  List<Folder> fParents
           
 
Fields inherited from class org.apache.chemistry.opencmis.inmemory.storedobj.impl.StoredObjectImpl
fCreatedAt, fCreatedBy, fId, fModifiedAt, fModifiedBy, fName, fObjStore, fProperties, fRepositoryId, fTypeId
 
Fields inherited from interface org.apache.chemistry.opencmis.inmemory.storedobj.api.Filing
PATH_SEPARATOR
 
Method Summary
 void addParent(Folder parent)
          Add this document to a new parent folder as child object
 List<Folder> getParents()
          return a list of parents.
 String getPathSegment()
          retrieve the path segment of this folder
 boolean hasParent()
          usually true except for the root folder, optimized call that just tests existence to provide information for AtomPub links (much cheaper than calling getParents() and test for empty result.
 void move(Folder oldParent, Folder newParent)
          Move an object to a different folder.
 void removeParent(Folder parent)
          Remove this object from the children of parent
 void rename(String newName)
          Rename an object
 
Methods inherited from class org.apache.chemistry.opencmis.inmemory.storedobj.impl.StoredObjectImpl
createSystemBasePropertiesWhenCreated, fillProperties, getChangeToken, getCreatedAt, getCreatedBy, getId, getModifiedAt, getModifiedBy, getName, getProperties, getRepositoryId, getTypeId, persist, setCreatedAt, setCreatedBy, setCustomProperties, setModifiedAtNow, setModifiedBy, setName, setProperties, setRepositoryId, setSystemBasePropertiesWhenCreatedDirect, setTypeId, updateSystemBasePropertiesWhenModified
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fParents

protected List<Folder> fParents
Method Detail

addParent

public void addParent(Folder parent)
Description copied from interface: MultiFiling
Add this document to a new parent folder as child object

Specified by:
addParent in interface MultiFiling
Parameters:
parent - new parent folder of the document.

removeParent

public void removeParent(Folder parent)
Description copied from interface: MultiFiling
Remove this object from the children of parent

Specified by:
removeParent in interface MultiFiling
Parameters:
parent - parent folder of the document

getParents

public List<Folder> getParents()
Description copied from interface: Filing
return a list of parents. for single parent object this list must contain only one element. returns an empty list if this is an unfiled document.

Specified by:
getParents in interface Filing
Returns:
list of parent folders

hasParent

public boolean hasParent()
Description copied from interface: Filing
usually true except for the root folder, optimized call that just tests existence to provide information for AtomPub links (much cheaper than calling getParents() and test for empty result.

Specified by:
hasParent in interface Filing
Returns:
true if object has a parent, false if it is a root object

getPathSegment

public String getPathSegment()
Description copied from interface: MultiFiling
retrieve the path segment of this folder

Specified by:
getPathSegment in interface MultiFiling
Returns:

move

public void move(Folder oldParent,
                 Folder newParent)
Description copied from interface: Filing
Move an object to a different folder. Source and target object are persisted in this call as part of a transactional step.

Specified by:
move in interface Filing
newParent - new parent folder for the object

rename

public void rename(String newName)
Description copied from interface: StoredObject
Rename an object

Specified by:
rename in interface StoredObject
Overrides:
rename in class StoredObjectImpl
Parameters:
newName - the new name of the object


Copyright © 2009-2011 The Apache Software Foundation. All Rights Reserved.