it.sistematica.isharedoc.opencmis.indatabase.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
 org.apache.chemistry.opencmis.commons.data.Acl applyAcl(StoredObject so, org.apache.chemistry.opencmis.commons.data.Acl addAces, org.apache.chemistry.opencmis.commons.data.Acl removeAces, org.apache.chemistry.opencmis.commons.enums.AclPropagation aclPropagation, java.lang.String principalId)
          Apply a ACLs by relative adding and removing a list of ACEs to/from an object
 org.apache.chemistry.opencmis.commons.data.Acl applyAcl(StoredObject so, org.apache.chemistry.opencmis.commons.data.Acl aces, org.apache.chemistry.opencmis.commons.enums.AclPropagation aclPropagation, java.lang.String principalId)
          Apply a ACLs by setting a new list of ACEs to an object
 void clear()
          Clear repository and remove all data.
 Document createDocument(java.lang.String name, java.util.Map<java.lang.String,org.apache.chemistry.opencmis.commons.data.PropertyData<?>> propMap, java.lang.String user, Folder folder, java.util.List<java.lang.String> policies, org.apache.chemistry.opencmis.commons.data.Acl addACEs, org.apache.chemistry.opencmis.commons.data.Acl removeACEs)
          Create a document as initial step.
 Folder createFolder(java.lang.String name, java.util.Map<java.lang.String,org.apache.chemistry.opencmis.commons.data.PropertyData<?>> propMap, java.lang.String user, Folder folder, java.util.List<java.lang.String> policies, org.apache.chemistry.opencmis.commons.data.Acl addACEs, org.apache.chemistry.opencmis.commons.data.Acl removeACEs)
          Create a folder as initial step.
 StoredObject createItem(java.lang.String name, java.util.Map<java.lang.String,org.apache.chemistry.opencmis.commons.data.PropertyData<?>> propMap, java.lang.String user, Folder folder, java.util.List<java.lang.String> policies, org.apache.chemistry.opencmis.commons.data.Acl addACEs, org.apache.chemistry.opencmis.commons.data.Acl removeACEs)
          Create an item as initial step.
 StoredObject createPolicy(java.lang.String name, java.lang.String policyText, java.util.Map<java.lang.String,org.apache.chemistry.opencmis.commons.data.PropertyData<?>> propMap, java.lang.String user)
          Create a policy.
 StoredObject createRelationship(java.lang.String name, StoredObject sourceObject, StoredObject targetObject, java.util.Map<java.lang.String,org.apache.chemistry.opencmis.commons.data.PropertyData<?>> propMap, java.lang.String user, org.apache.chemistry.opencmis.commons.data.Acl addACEs, org.apache.chemistry.opencmis.commons.data.Acl removeACEs)
          Create a relationship.
 DocumentVersion createVersionedDocument(java.lang.String name, java.util.Map<java.lang.String,org.apache.chemistry.opencmis.commons.data.PropertyData<?>> propMap, java.lang.String user, Folder folder, java.util.List<java.lang.String> policies, org.apache.chemistry.opencmis.commons.data.Acl addACEs, org.apache.chemistry.opencmis.commons.data.Acl removeACEs, org.apache.chemistry.opencmis.commons.data.ContentStream contentStream, org.apache.chemistry.opencmis.commons.enums.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, org.apache.chemistry.opencmis.commons.enums.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
 java.util.List<StoredObject> getRelationships(java.lang.String objectId, java.util.List<java.lang.String> typeIds, org.apache.chemistry.opencmis.commons.enums.RelationshipDirection direction)
          Get relationships to and from an object
 StoredObject getRootFolder()
          Get the root folder of this object store
 boolean isTypeInUse(java.lang.String typeId)
          Check if this store contains any object with the given type id
 

Method Detail

getRootFolder

StoredObject 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,org.apache.chemistry.opencmis.commons.data.PropertyData<?>> propMap,
                        java.lang.String user,
                        Folder folder,
                        java.util.List<java.lang.String> policies,
                        org.apache.chemistry.opencmis.commons.data.Acl addACEs,
                        org.apache.chemistry.opencmis.commons.data.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
policies - list of policies to apply
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,org.apache.chemistry.opencmis.commons.data.PropertyData<?>> propMap,
                    java.lang.String user,
                    Folder folder,
                    java.util.List<java.lang.String> policies,
                    org.apache.chemistry.opencmis.commons.data.Acl addACEs,
                    org.apache.chemistry.opencmis.commons.data.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
policies - list of policies to apply
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,org.apache.chemistry.opencmis.commons.data.PropertyData<?>> propMap,
                                        java.lang.String user,
                                        Folder folder,
                                        java.util.List<java.lang.String> policies,
                                        org.apache.chemistry.opencmis.commons.data.Acl addACEs,
                                        org.apache.chemistry.opencmis.commons.data.Acl removeACEs,
                                        org.apache.chemistry.opencmis.commons.data.ContentStream contentStream,
                                        org.apache.chemistry.opencmis.commons.enums.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
policies - list of policies to apply
addACEs - aces that are added
removeACEs - aces that are removed
Returns:
versioned document object

createItem

StoredObject createItem(java.lang.String name,
                        java.util.Map<java.lang.String,org.apache.chemistry.opencmis.commons.data.PropertyData<?>> propMap,
                        java.lang.String user,
                        Folder folder,
                        java.util.List<java.lang.String> policies,
                        org.apache.chemistry.opencmis.commons.data.Acl addACEs,
                        org.apache.chemistry.opencmis.commons.data.Acl removeACEs)
Create an item as initial step. The item 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
policies - list of policies to apply
addACEs - aces that are added
removeACEs - aces that are removed
Returns:
document object

createPolicy

StoredObject createPolicy(java.lang.String name,
                          java.lang.String policyText,
                          java.util.Map<java.lang.String,org.apache.chemistry.opencmis.commons.data.PropertyData<?>> propMap,
                          java.lang.String user)
Create a policy. The policy 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
policyText - policy text to apply to this policy
propMap - map of properties
user - the user who creates the document
Returns:
policy 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(java.lang.String name,
                                StoredObject sourceObject,
                                StoredObject targetObject,
                                java.util.Map<java.lang.String,org.apache.chemistry.opencmis.commons.data.PropertyData<?>> propMap,
                                java.lang.String user,
                                org.apache.chemistry.opencmis.commons.data.Acl addACEs,
                                org.apache.chemistry.opencmis.commons.data.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,
                                                    org.apache.chemistry.opencmis.commons.enums.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

applyAcl

org.apache.chemistry.opencmis.commons.data.Acl applyAcl(StoredObject so,
                                                        org.apache.chemistry.opencmis.commons.data.Acl addAces,
                                                        org.apache.chemistry.opencmis.commons.data.Acl removeAces,
                                                        org.apache.chemistry.opencmis.commons.enums.AclPropagation aclPropagation,
                                                        java.lang.String principalId)
Apply a ACLs by relative adding and removing a list of ACEs to/from an object

Parameters:
so - object where ACLs are applied
addAces - list of ACEs to be added
removeAces - list of ACEs to be removed
aclPropagation - enum value how to propagate ACLs to child objects
Returns:
new ACL of object

applyAcl

org.apache.chemistry.opencmis.commons.data.Acl applyAcl(StoredObject so,
                                                        org.apache.chemistry.opencmis.commons.data.Acl aces,
                                                        org.apache.chemistry.opencmis.commons.enums.AclPropagation aclPropagation,
                                                        java.lang.String principalId)
Apply a ACLs by setting a new list of ACEs to an object

Parameters:
so - object where ACLs are applied
aces - list of ACEs to be applied
aclPropagation - enum value how to propagate ACLs to child objects
Returns:
new ACL of object

isTypeInUse

boolean isTypeInUse(java.lang.String typeId)
Check if this store contains any object with the given type id

Parameters:
typeId - id of type definition to check
Returns:
true if at least one object in the store has the given type, false if no objects exist having this type

getRelationships

java.util.List<StoredObject> getRelationships(java.lang.String objectId,
                                              java.util.List<java.lang.String> typeIds,
                                              org.apache.chemistry.opencmis.commons.enums.RelationshipDirection direction)
Get relationships to and from an object

Parameters:
objectId - id of object to get relationships with
subTypeIds - list of all types to be included
relationshipDirection - direction of relationship
Returns: