org.apache.chemistry.opencmis.inmemory.storedobj.api
Interface ObjectStore

All Known Implementing Classes:
ObjectStoreImpl

public interface ObjectStore

Author:
Jens This is the interface an implementation must provide to store any kind of CMIS objects. The ObjectStore is the topmost container of all CMIS object that get persisted. It is comparable to a file system, one object store exists per repository id. The object store allows access objects by an id. In addition a object can be retrieved by path. Typically the object store owns the list of object ids and maintains the path hierarchy.

Method Summary
 void clear()
          Clear repository and remove all data.
 Document createDocument(java.lang.String name, java.util.Map<java.lang.String,PropertyData<?>> propMap, java.lang.String user, Folder folder, Acl addACEs, Acl removeACEs)
          Create a document as initial step.
 Folder createFolder(java.lang.String name, java.util.Map<java.lang.String,PropertyData<?>> propMap, java.lang.String user, Folder folder, Acl addACEs, Acl removeACEs)
          Create a folder as initial step.
 StoredObject createRelationship(StoredObject sourceObject, StoredObject targetObject, java.util.Map<java.lang.String,PropertyData<?>> propMap, java.lang.String user, Acl addACEs, Acl removeACEs)
          Create a relationship.
 DocumentVersion createVersionedDocument(java.lang.String name, java.util.Map<java.lang.String,PropertyData<?>> propMap, java.lang.String user, Folder folder, Acl addACEs, Acl removeACEs, ContentStream contentStream, VersioningState versioningState)
          Create a document that supports versions as initial step.
 void deleteObject(java.lang.String objectId, java.lang.Boolean allVersions, java.lang.String user)
          Deletes an object from the store.
 java.util.List<StoredObject> getCheckedOutDocuments(java.lang.String orderBy, java.lang.String user, IncludeRelationships includeRelationships)
          Return a list of all documents that are checked out in the repository.
 StoredObject getObjectById(java.lang.String folderId)
          get an object by its id
 StoredObject getObjectByPath(java.lang.String path, java.lang.String user)
          return an object by path.
 long getObjectCount()
          For statistics: return the number of objects contained in the system
 Folder getRootFolder()
          Get the root folder of this object store
 

Method Detail

getRootFolder

Folder getRootFolder()
Get the root folder of this object store

Returns:
the root folder of this store

getObjectByPath

StoredObject getObjectByPath(java.lang.String path,
                             java.lang.String user)
return an object by path.

Parameters:
path - the path to the object
Returns:
the stored object with this path

getObjectById

StoredObject getObjectById(java.lang.String folderId)
get an object by its id

Parameters:
folderId - the id of the object
Returns:
the object identified by this id

deleteObject

void deleteObject(java.lang.String objectId,
                  java.lang.Boolean allVersions,
                  java.lang.String user)
Deletes an object from the store. For a folders the folder must be empty.

Parameters:
objectId -
user -
allVersions - is TRUE all version of the document are deleted, otherwise just this one

createDocument

Document createDocument(java.lang.String name,
                        java.util.Map<java.lang.String,PropertyData<?>> propMap,
                        java.lang.String user,
                        Folder folder,
                        Acl addACEs,
                        Acl removeACEs)
Create a document as initial step. The document is created but still temporary It is not yet persisted and does not have an id yet. After this call additional actions can take place (like assigning properties and a type) before it is persisted.

Parameters:
name - name of the document
propMap - map of properties
user - the user who creates the document
folder - the parent folder
addACEs - aces that are added
removeACEs - aces that are removed
Returns:
document object

createFolder

Folder createFolder(java.lang.String name,
                    java.util.Map<java.lang.String,PropertyData<?>> propMap,
                    java.lang.String user,
                    Folder folder,
                    Acl addACEs,
                    Acl removeACEs)
Create a folder as initial step. The folder is created but still temporary It is not yet persisted and does not have an id yet. After this call additional actions can take place (like assigning properties and a type) before it is persisted.

Parameters:
name - name of the folder
propMap - map of properties
user - the user who creates the document
folder - the parent folder
addACEs - aces that are added
removeACEs - aces that are removed
Returns:
folder object

createVersionedDocument

DocumentVersion createVersionedDocument(java.lang.String name,
                                        java.util.Map<java.lang.String,PropertyData<?>> propMap,
                                        java.lang.String user,
                                        Folder folder,
                                        Acl addACEs,
                                        Acl removeACEs,
                                        ContentStream contentStream,
                                        VersioningState versioningState)
Create a document that supports versions as initial step. The document is created but still temporary. It is not yet persisted and does not have an id yet. After this call additional actions can take place (like assigning properties and a type) before it is persisted.

Parameters:
name - name of the document * @param propMap map of properities
user - the user who creates the document
folder - the parent folder
addACEs - aces that are added
removeACEs - aces that are removed
Returns:
versioned document object

clear

void clear()
Clear repository and remove all data.


getObjectCount

long getObjectCount()
For statistics: return the number of objects contained in the system

Returns:
number of stored objects

createRelationship

StoredObject createRelationship(StoredObject sourceObject,
                                StoredObject targetObject,
                                java.util.Map<java.lang.String,PropertyData<?>> propMap,
                                java.lang.String user,
                                Acl addACEs,
                                Acl removeACEs)
Create a relationship. The relationship is created but still temporary. It is not yet persisted and does not have an id yet. After this call additional actions can take place (like assigning properties and a type) before it is persisted.

Parameters:
sourceObject - source of the relationship
targetObject - target of the relationship
propMap - map of properities
user - the user who creates the document
folder - the parent folder
addACEs - aces that are added
removeACEs - aces that are removed
Returns:
versioned document object

getCheckedOutDocuments

java.util.List<StoredObject> getCheckedOutDocuments(java.lang.String orderBy,
                                                    java.lang.String user,
                                                    IncludeRelationships includeRelationships)
Return a list of all documents that are checked out in the repository.

Parameters:
orderBy - orderBy specification according to CMIS spec.
user - user id of user calling
includeRelationships - if true include all relationships in the response
Returns:
list of checked out documents in the repository


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