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

All Known Subinterfaces:
Document, DocumentVersion, Folder, VersionedDocument
All Known Implementing Classes:
AbstractMultiFilingImpl, AbstractSingleFilingImpl, DocumentImpl, DocumentVersionImpl, FolderImpl, StoredObjectImpl, VersionedDocumentImpl

public interface StoredObject

Stored Object interface is common part that all objects handled by CMIS (Documents, Folders, Relations, Policies, ACLs) share. Objects that implement this interface are always concrete and can live in the object store. A stored object always has an id, a name and properties.

Author:
Jens

Method Summary
 void createSystemBasePropertiesWhenCreated(Map<String,PropertyData<?>> properties, String user)
          Create all system base properties that need to be stored with every object in the repository This method is called when a new object is created to record all of the capturing data like the creation time, creator etc.
 void fillProperties(Map<String,PropertyData<?>> properties, BindingsObjectFactory objFactory, List<String> requestedIds)
           
 String getChangeToken()
          Retrieve a change token uniquely identifying the state of the object when it was persisted (used for optimistic locking)
 GregorianCalendar getCreatedAt()
           
 String getCreatedBy()
          Retrieve the user who created the document
 String getId()
          Retrieve the id of this object.
 GregorianCalendar getModifiedAt()
          Retrieve date and time when the object was last modified.
 String getModifiedBy()
          Retrieve the user who last modified the document
 String getName()
          Retrieve the name of this object
 Map<String,PropertyData<?>> getProperties()
          Retrieve the list of properties
 String getRepositoryId()
          Get the repository id of this object where the object is stored.
 String getTypeId()
          Retrieve the type of this document.
 void persist()
          Persist the object so that it can be later retrieved by its id.
 void rename(String newName)
          Rename an object
 void setCreatedAt(GregorianCalendar createdAt)
          Assign date and time when the object was created.
 void setCreatedBy(String createdBy)
          Set the user who last modified the object.
 void setCustomProperties(Map<String,PropertyData<?>> properties)
          Set all properties which are not system properties.
 void setModifiedAtNow()
          Assign current date and time when the object was last modified.
 void setModifiedBy(String modifiedBy)
          Set the user who last modified the object.
 void setName(String name)
          Set the name of this document.
 void setProperties(Map<String,PropertyData<?>> props)
          Assign the properties to an object.
 void setRepositoryId(String repositoryId)
          Assign a repository where this object will be stored.
 void setTypeId(String type)
          Set the type of this document.
 void updateSystemBasePropertiesWhenModified(Map<String,PropertyData<?>> properties, String user)
          Update all system base properties that need to be stored with every object in the repository This method is called when an object is is updated to record all of the capturing data like the modification time, updating user etc.
 

Method Detail

getId

String getId()
Retrieve the id of this object.

Returns:
id of this object

getName

String getName()
Retrieve the name of this object

Returns:
name of this object

setName

void setName(String name)
Set the name of this document. This method does not persist the object.

Parameters:
name - name that is assigned to this object

getTypeId

String getTypeId()
Retrieve the type of this document.

Returns:
Id of the type identifying the type of this object

setTypeId

void setTypeId(String type)
Set the type of this document. This method does not persist the object.

Parameters:
type - id of the type this object gets assigned.

getCreatedBy

String getCreatedBy()
Retrieve the user who created the document

Returns:
user who created the document.

setCreatedBy

void setCreatedBy(String createdBy)
Set the user who last modified the object. This method does not persist the object.

Parameters:
createdBy - user who last modified the document

getModifiedBy

String getModifiedBy()
Retrieve the user who last modified the document

Returns:
user who last modified the document.

setModifiedBy

void setModifiedBy(String modifiedBy)
Set the user who last modified the object. This method does not persist the object.

Parameters:
modifiedBy - user who last modified the document

getCreatedAt

GregorianCalendar getCreatedAt()

setCreatedAt

void setCreatedAt(GregorianCalendar createdAt)
Assign date and time when the object was created. Usually you should not call this method externally. This method does not persist the object.

Parameters:
createdAt - date the object was created

getModifiedAt

GregorianCalendar getModifiedAt()
Retrieve date and time when the object was last modified.

Returns:
date the object was last modified

setModifiedAtNow

void setModifiedAtNow()
Assign current date and time when the object was last modified. Usually you should not call this method externally. This method does not persist the object.


getRepositoryId

String getRepositoryId()
Get the repository id of this object where the object is stored.

Returns:

setRepositoryId

void setRepositoryId(String repositoryId)
Assign a repository where this object will be stored. This method does not persist the object.

Parameters:
repositoryId - id of the repository

getProperties

Map<String,PropertyData<?>> getProperties()
Retrieve the list of properties

Returns:

setProperties

void setProperties(Map<String,PropertyData<?>> props)
Assign the properties to an object. This method does not persist the object.

Parameters:
props - properties to be assigned

getChangeToken

String getChangeToken()
Retrieve a change token uniquely identifying the state of the object when it was persisted (used for optimistic locking)

Returns:
String identifying the change token

persist

void persist()
Persist the object so that it can be later retrieved by its id. Assign an id to the object


rename

void rename(String newName)
Rename an object

Parameters:
newName - the new name of the object

createSystemBasePropertiesWhenCreated

void createSystemBasePropertiesWhenCreated(Map<String,PropertyData<?>> properties,
                                           String user)
Create all system base properties that need to be stored with every object in the repository This method is called when a new object is created to record all of the capturing data like the creation time, creator etc.

Parameters:
properties - The properties passed by the client, containing, name, type, etc
user - The user creating the document

updateSystemBasePropertiesWhenModified

void updateSystemBasePropertiesWhenModified(Map<String,PropertyData<?>> properties,
                                            String user)
Update all system base properties that need to be stored with every object in the repository This method is called when an object is is updated to record all of the capturing data like the modification time, updating user etc.

Parameters:
properties - The properties passed by the client, containing, name, type, etc
user - The user creating the document

fillProperties

void fillProperties(Map<String,PropertyData<?>> properties,
                    BindingsObjectFactory objFactory,
                    List<String> requestedIds)

setCustomProperties

void setCustomProperties(Map<String,PropertyData<?>> properties)
Set all properties which are not system properties. These are the properties as defined in Type system definition. This method is called when an object is created or updated. The implementation must ignore the system properties.

Parameters:
properties - Set of properties as set by the client, including system parameters


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