org.xcmis.spi
Interface Storage

All Superinterfaces:
TypeManager
All Known Implementing Classes:
BasicStorage

public interface Storage
extends TypeManager

Version:
$Id: Storage.java 332 2010-03-11 17:24:56Z andrew00x $
Author:
Andrey Parfonov

Method Summary
 AllowableActions calculateAllowableActions(ObjectData object)
          Calculate allowable actions for specified object.
 DocumentData copyDocument(DocumentData source, FolderData parent, Map<String,Property<?>> properties, List<AccessControlEntry> acl, Collection<PolicyData> policies, VersioningState versioningState)
          Create new document as copy of the given source document and use parent as parent.
 DocumentData createDocument(FolderData parent, TypeDefinition typeDefinition, Map<String,Property<?>> properties, ContentStream content, List<AccessControlEntry> acl, Collection<PolicyData> policies, VersioningState versioningState)
          Create new document with type typeDefinition using parent as parent.
 FolderData createFolder(FolderData parent, TypeDefinition typeDefinition, Map<String,Property<?>> properties, List<AccessControlEntry> acl, Collection<PolicyData> policies)
          Create new folder with type typeDefinition using folder as parent.
 PolicyData createPolicy(FolderData parent, TypeDefinition typeDefinition, Map<String,Property<?>> properties, List<AccessControlEntry> acl, Collection<PolicyData> policies)
          Create new policy with type typeDefinition using parent as parent.
 RelationshipData createRelationship(ObjectData source, ObjectData target, TypeDefinition typeDefinition, Map<String,Property<?>> properties, List<AccessControlEntry> acl, Collection<PolicyData> policies)
          Create new relationship for specified source and target.
 void deleteObject(ObjectData object, boolean deleteAllVersions)
          Delete specified object.
 Collection<String> deleteTree(FolderData folder, boolean deleteAllVersions, UnfileObject unfileObject, boolean continueOnFailure)
          Delete the specified folder object and all of its child- and descendant-objects.
 Collection<DocumentData> getAllVersions(String versionSeriesId)
          Collection of all Document in the specified version series, sorted by cmis:creationDate descending.
 ItemsIterator<ChangeEvent> getChangeLog(String changeLogToken)
          Gets content changes.
 ItemsIterator<DocumentData> getCheckedOutDocuments(FolderData folder, String orderBy)
          Get checkedout objects (private working copies) that user has access to.
 String getId()
          Get storage unique id.
 ObjectData getObjectById(String objectId)
          Get object by unique identifier.
 ObjectData getObjectByPath(String path)
          Get object by path.
 ItemsIterator<Rendition> getRenditions(ObjectData object)
          Get object renditions.
 RepositoryInfo getRepositoryInfo()
          Get description of storage and its capabilities.
 Iterator<String> getUnfiledObjectsId()
          Iterator of all unfilled documents identifiers.
 ObjectData moveObject(ObjectData object, FolderData target, FolderData source)
          Move object from source to target.
 ItemsIterator<Result> query(Query query)
          Handle specified SQL query.
 void unfileObject(ObjectData object)
          Remove non-folder fileable object from all folder where in which it is currently filed.
 
Methods inherited from interface org.xcmis.spi.TypeManager
addType, getTypeChildren, getTypeDefinition, removeType
 

Method Detail

getId

String getId()
Get storage unique id.

Returns:
storage id

calculateAllowableActions

AllowableActions calculateAllowableActions(ObjectData object)
Calculate allowable actions for specified object.

Parameters:
object - object
Returns:
allowable actions for object

getCheckedOutDocuments

ItemsIterator<DocumentData> getCheckedOutDocuments(FolderData folder,
                                                   String orderBy)
Get checkedout objects (private working copies) that user has access to.

Parameters:
folder - folder, if null then get all checked out objects in any folders
orderBy - comma-separated list of query names and the ascending modifier 'ASC' or the descending modifier 'DESC' for each query name. A storage's handling of the orderBy input is storage-specific and storage may ignore this parameter if it not able sort items
Returns:
iterator over checked out objects

createDocument

DocumentData createDocument(FolderData parent,
                            TypeDefinition typeDefinition,
                            Map<String,Property<?>> properties,
                            ContentStream content,
                            List<AccessControlEntry> acl,
                            Collection<PolicyData> policies,
                            VersioningState versioningState)
                            throws ConstraintException,
                                   NameConstraintViolationException,
                                   IOException,
                                   StorageException
Create new document with type typeDefinition using parent as parent. If parent == null then document created in unfiling state. If unfiling is not supported ConstraintException should be thrown.

Parameters:
parent - parent folder or null if document should be created in unfiling state
typeDefinition - the document type definition
properties - the document properties
content - the document content
acl - the list of ACEs to be applied to newly create document. May be null or empty list if no ACEs to be applied
policies - the list of policies. May be null or empty collection if no policies to be applied
versioningState - versioning state
Returns:
newly created document
Throws:
ConstraintException - if any of following condition are met:
  • versionable attribute of the object type definition is false and a value of the versioningState parameter is other than none
  • versionable attribute of the object type definition is true and and the value of the versioningState parameter is none
  • if parent == null and unfiling is not supported
NameConstraintViolationException - if property 'cmis:name' throws conflict
IOException - if any i/o error occurs when try to set document content stream
StorageException - if object can not be saved cause to storage internal problem
See Also:
VersioningState

copyDocument

DocumentData copyDocument(DocumentData source,
                          FolderData parent,
                          Map<String,Property<?>> properties,
                          List<AccessControlEntry> acl,
                          Collection<PolicyData> policies,
                          VersioningState versioningState)
                          throws ConstraintException,
                                 NameConstraintViolationException,
                                 StorageException
Create new document as copy of the given source document and use parent as parent. If parent == null then document created in unfiling state. If unfiling is not supported ConstraintException should be thrown.

Parameters:
source - source document
parent - parent folder or null if document should be created in unfiling state
properties - the document properties
acl - the list of ACEs to be applie dto newly created document. May be null or empty list if no ACEs to be applied
policies - the list of policies. May be null or empty collection if no policies to be applied
versioningState - versioning state
Returns:
newly created document
Throws:
ConstraintException - if any of following condition are met:
  • versionable attribute of the object type definition is false and a value of the versioningState parameter is other than none
  • versionable attribute of the object type definition is true and and the value of the versioningState parameter is none
  • if parent == null and unfiling is not supported
NameConstraintViolationException - if property 'cmis:name' throws conflict
StorageException - if new document can be saved cause to storage internal problem
See Also:
VersioningState

createFolder

FolderData createFolder(FolderData parent,
                        TypeDefinition typeDefinition,
                        Map<String,Property<?>> properties,
                        List<AccessControlEntry> acl,
                        Collection<PolicyData> policies)
                        throws ConstraintException,
                               NameConstraintViolationException,
                               StorageException
Create new folder with type typeDefinition using folder as parent.

Parameters:
parent - parent folder
typeDefinition - the folder type definition
properties - the folder properties
acl - the list of ACEs to be applied to newly created folder. May be null or empty list if no ACEs to be applied
policies - the list of policies. May be null or empty collection if no policies to be applied
Returns:
newly created folder
Throws:
ConstraintException - if parent == null
NameConstraintViolationException - if property 'cmis:name' throws conflict
StorageException - if object can not be removed cause to storage internal problem

createPolicy

PolicyData createPolicy(FolderData parent,
                        TypeDefinition typeDefinition,
                        Map<String,Property<?>> properties,
                        List<AccessControlEntry> acl,
                        Collection<PolicyData> policies)
                        throws ConstraintException,
                               NameConstraintViolationException,
                               StorageException
Create new policy with type typeDefinition using parent as parent. If parent == null then policy created in unfiling state.

Parameters:
parent - parent folder
typeDefinition - the policy type definition
properties - the policy properties
acl - the list of ACEs to be applied to newly created policy. May be null or empty list if no ACEs to be applied
policies - the list of policies. May be null or empty collection if no policies to be applied
Returns:
newly created policy
Throws:
ConstraintException - if parent == null and policy type is fileable
NameConstraintViolationException - if property 'cmis:name' throws conflict
StorageException - if object can not be saved cause to storage internal problem

createRelationship

RelationshipData createRelationship(ObjectData source,
                                    ObjectData target,
                                    TypeDefinition typeDefinition,
                                    Map<String,Property<?>> properties,
                                    List<AccessControlEntry> acl,
                                    Collection<PolicyData> policies)
                                    throws NameConstraintViolationException,
                                           StorageException
Create new relationship for specified source and target.

Parameters:
source - source of relationship
target - target of relationship
typeDefinition - the relationship type definition
properties - the relationship properties
acl - the list of ACEs to be applied to newly created relationship. May be null or empty list if no ACEs to be applied
policies - the list of policies. May be null or empty collection if no policies to be applied
Returns:
newly created relationship
Throws:
NameConstraintViolationException - if property 'cmis:name' throws conflict
StorageException - if object can not be removed cause to storage internal problem

deleteObject

void deleteObject(ObjectData object,
                  boolean deleteAllVersions)
                  throws VersioningException,
                         UpdateConflictException,
                         StorageException
Delete specified object. If multi-filed object is deleted then it is removed from all folders it is filed in. If specified object is private working copy the deletion object is the same as to cancel checkout operation. See DocumentData.cancelCheckout().

Parameters:
object - object to be deleted
deleteAllVersions - if false then delete only the object specified, if true delete all versions of versionable document. This parameter must be ignored if specified object is not document or not versionable document
Throws:
VersioningException - if object can not be removed cause to versioning conflict
UpdateConflictException - if specified object is not current any more
StorageException - if object can't be delete (persist operation) cause to storage internal problem

deleteTree

Collection<String> deleteTree(FolderData folder,
                              boolean deleteAllVersions,
                              UnfileObject unfileObject,
                              boolean continueOnFailure)
                              throws UpdateConflictException
Delete the specified folder object and all of its child- and descendant-objects.

Parameters:
folder - folder to be deleted
deleteAllVersions - if true then delete all versions of the document in this folder. If false, delete only the document object specified. This parameter will be ignored if parameter when objectId non-document object or non-versionable document
unfileObject - an enumeration specifying how the storage MUST process file-able child objects:
  • unfile: Unfile all fileable objects
  • deletesinglefiled: Delete all fileable non-folder objects whose only parent-folders are in the current folder tree. Unfile all other fileable non-folder objects from the current folder tree
  • delete: Delete all fileable objects
continueOnFailure - if true, then the stprage SHOULD continue attempting to perform this operation even if deletion of a child object in the specified folder cannot be deleted
Returns:
list of id that were not deleted
Throws:
UpdateConflictException - if object that is no longer current (as determined by the storage)

unfileObject

void unfileObject(ObjectData object)
Remove non-folder fileable object from all folder where in which it is currently filed. NOTE This method never remove object itself.

Parameters:
object - object

getChangeLog

ItemsIterator<ChangeEvent> getChangeLog(String changeLogToken)
                                        throws ConstraintException
Gets content changes.

Parameters:
changeLogToken - if value other than null, then change event corresponded to the value of the specified change log token will be returned as the first result in the output. If not specified, then will be returned the first change event recorded in the change log. When set of changes passed is returned then changeLogToken must contains log token corresponded to the last change event. Then it may be used by caller for getting next set on change events
Returns:
iterator over change log events
Throws:
ConstraintException - if the event corresponding to the change log token provided as an input parameter is no longer available in the change log. (E.g. because the change log was truncated)

query

ItemsIterator<Result> query(Query query)
Handle specified SQL query.

Parameters:
query - SQL query
Returns:
set of query results
Throws:
InvalidArgumentException - if specified query is invalid

getObjectById

ObjectData getObjectById(String objectId)
                         throws ObjectNotFoundException
Get object by unique identifier.

Parameters:
objectId - object's ID
Returns:
object
Throws:
ObjectNotFoundException - if object with specified ID was not found

getObjectByPath

ObjectData getObjectByPath(String path)
                           throws ObjectNotFoundException
Get object by path.

Parameters:
path - path
Returns:
object
Throws:
ObjectNotFoundException - if object with specified path was not found

moveObject

ObjectData moveObject(ObjectData object,
                      FolderData target,
                      FolderData source)
                      throws UpdateConflictException,
                             VersioningException,
                             NameConstraintViolationException,
                             StorageException
Move object from source to target. If operation successful then changes saved immediately.

Parameters:
object - object to be moved
target - destination folder
source - folder from which object must be moved
Returns:
Throws:
UpdateConflictException - if object that is no longer current (as determined by the storage).
VersioningException - if object is a non-current document version
NameConstraintViolationException - if moving operation cause name conflict, e.g. destination folder already contains object with the same name
StorageException - if object can not be moved (save changes) cause to storage internal problem

getRenditions

ItemsIterator<Rendition> getRenditions(ObjectData object)
Get object renditions.

Parameters:
object - the object
Returns:
iterator over object's renditions. If object has not any renditions then empty iterator must be returned but never null

getRepositoryInfo

RepositoryInfo getRepositoryInfo()
Get description of storage and its capabilities.

Returns:
storage description

getAllVersions

Collection<DocumentData> getAllVersions(String versionSeriesId)
                                        throws ObjectNotFoundException
Collection of all Document in the specified version series, sorted by cmis:creationDate descending.

Parameters:
versionSeriesId - the id of version series
Returns:
document versions
Throws:
ObjectNotFoundException - if version series with versionSeriesId does not exist

getUnfiledObjectsId

Iterator<String> getUnfiledObjectsId()
                                     throws StorageException
Iterator of all unfilled documents identifiers.

Returns:
Iterator of all unfilled documents identifiers.
Throws:
StorageException - if any storage error occurs


Copyright © 2010 eXo Platform SAS. All Rights Reserved.