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

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

public class StoredObjectImpl
extends java.lang.Object
implements StoredObject

StoredObject is the common superclass of all objects hold in the repository Documents, Folders, Relationships and Policies

Author:
Jens

Field Summary
protected  java.util.GregorianCalendar fCreatedAt
           
protected  java.lang.String fCreatedBy
           
protected  java.lang.String fId
           
protected  java.util.GregorianCalendar fModifiedAt
           
protected  java.lang.String fModifiedBy
           
protected  java.lang.String fName
           
protected  ObjectStoreImpl fObjStore
           
protected  java.util.Map<java.lang.String,PropertyData<?>> fProperties
           
protected  java.lang.String fRepositoryId
           
protected  java.lang.String fTypeId
           
 
Method Summary
 void createSystemBasePropertiesWhenCreated(java.util.Map<java.lang.String,PropertyData<?>> properties, java.lang.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(java.util.Map<java.lang.String,PropertyData<?>> properties, BindingsObjectFactory objFactory, java.util.List<java.lang.String> requestedIds)
           
 Acl getAcl()
          get the Acl of the stored object
 AllowableActions getAllowableActions(java.lang.String user)
           
 java.lang.String getChangeToken()
          Retrieve a change token uniquely identifying the state of the object when it was persisted (used for optimistic locking)
 java.util.GregorianCalendar getCreatedAt()
           
 java.lang.String getCreatedBy()
          Retrieve the user who created the document
 java.lang.String getId()
          Retrieve the id of this object.
 java.util.GregorianCalendar getModifiedAt()
          Retrieve date and time when the object was last modified.
 java.lang.String getModifiedBy()
          Retrieve the user who last modified the document
 java.lang.String getName()
          Retrieve the name of this object
 ObjectList getObjectRelationships(java.lang.Boolean includeSubRelationshipTypes, RelationshipDirection relationshipDirection, java.lang.String typeId, java.lang.String filter, java.lang.Boolean includeAllowableActions, java.math.BigInteger maxItems, java.math.BigInteger skipCount, ExtensionsData extension, java.lang.String user)
          get the relationships of the object
 java.util.Map<java.lang.String,PropertyData<?>> getProperties()
          Retrieve the list of properties
 java.lang.String getRepositoryId()
          Get the repository id of this object where the object is stored.
 java.lang.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(java.lang.String newName)
          Rename an object
 void setCreatedAt(java.util.GregorianCalendar createdAt)
          Assign date and time when the object was created.
 void setCreatedBy(java.lang.String createdBy)
          Set the user who last modified the object.
 void setCustomProperties(java.util.Map<java.lang.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(java.lang.String modifiedBy)
          Set the user who last modified the object.
 void setName(java.lang.String name)
          Set the name of this document.
 void setProperties(java.util.Map<java.lang.String,PropertyData<?>> props)
          Assign the properties to an object.
 void setRepositoryId(java.lang.String repositoryId)
          Assign a repository where this object will be stored.
protected  void setSystemBasePropertiesWhenCreatedDirect(java.lang.String name, java.lang.String typeId, java.lang.String user)
          Add CMIS_CREATED_BY, CMIS_CREATION_DATE, CMIS_LAST_MODIFIED_BY, CMIS_LAST_MODIFICATION_DATE, CMIS_CHANGE_TOKEN system properties to the list of properties with current values
 void setTypeId(java.lang.String type)
          Set the type of this document.
 void updateSystemBasePropertiesWhenModified(java.util.Map<java.lang.String,PropertyData<?>> properties, java.lang.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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fId

protected java.lang.String fId

fName

protected java.lang.String fName

fTypeId

protected java.lang.String fTypeId

fCreatedBy

protected java.lang.String fCreatedBy

fModifiedBy

protected java.lang.String fModifiedBy

fCreatedAt

protected java.util.GregorianCalendar fCreatedAt

fModifiedAt

protected java.util.GregorianCalendar fModifiedAt

fRepositoryId

protected java.lang.String fRepositoryId

fProperties

protected java.util.Map<java.lang.String,PropertyData<?>> fProperties

fObjStore

protected final ObjectStoreImpl fObjStore
Method Detail

getId

public java.lang.String getId()
Description copied from interface: StoredObject
Retrieve the id of this object.

Specified by:
getId in interface StoredObject
Returns:
id of this object

getName

public java.lang.String getName()
Description copied from interface: StoredObject
Retrieve the name of this object

Specified by:
getName in interface StoredObject
Returns:
name of this object

setName

public void setName(java.lang.String name)
Description copied from interface: StoredObject
Set the name of this document. This method does not persist the object.

Specified by:
setName in interface StoredObject
Parameters:
name - name that is assigned to this object

getTypeId

public java.lang.String getTypeId()
Description copied from interface: StoredObject
Retrieve the type of this document.

Specified by:
getTypeId in interface StoredObject
Returns:
Id of the type identifying the type of this object

setTypeId

public void setTypeId(java.lang.String type)
Description copied from interface: StoredObject
Set the type of this document. This method does not persist the object.

Specified by:
setTypeId in interface StoredObject
Parameters:
type - id of the type this object gets assigned.

getCreatedBy

public java.lang.String getCreatedBy()
Description copied from interface: StoredObject
Retrieve the user who created the document

Specified by:
getCreatedBy in interface StoredObject
Returns:
user who created the document.

setCreatedBy

public void setCreatedBy(java.lang.String createdBy)
Description copied from interface: StoredObject
Set the user who last modified the object. This method does not persist the object.

Specified by:
setCreatedBy in interface StoredObject
Parameters:
createdBy - user who last modified the document

getModifiedBy

public java.lang.String getModifiedBy()
Description copied from interface: StoredObject
Retrieve the user who last modified the document

Specified by:
getModifiedBy in interface StoredObject
Returns:
user who last modified the document.

setModifiedBy

public void setModifiedBy(java.lang.String modifiedBy)
Description copied from interface: StoredObject
Set the user who last modified the object. This method does not persist the object.

Specified by:
setModifiedBy in interface StoredObject
Parameters:
modifiedBy - user who last modified the document

getCreatedAt

public java.util.GregorianCalendar getCreatedAt()
Specified by:
getCreatedAt in interface StoredObject

setCreatedAt

public void setCreatedAt(java.util.GregorianCalendar createdAt)
Description copied from interface: StoredObject
Assign date and time when the object was created. Usually you should not call this method externally. This method does not persist the object.

Specified by:
setCreatedAt in interface StoredObject
Parameters:
createdAt - date the object was created

getModifiedAt

public java.util.GregorianCalendar getModifiedAt()
Description copied from interface: StoredObject
Retrieve date and time when the object was last modified.

Specified by:
getModifiedAt in interface StoredObject
Returns:
date the object was last modified

setModifiedAtNow

public void setModifiedAtNow()
Description copied from interface: StoredObject
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.

Specified by:
setModifiedAtNow in interface StoredObject

setRepositoryId

public void setRepositoryId(java.lang.String repositoryId)
Description copied from interface: StoredObject
Assign a repository where this object will be stored. This method does not persist the object.

Specified by:
setRepositoryId in interface StoredObject
Parameters:
repositoryId - id of the repository

getRepositoryId

public java.lang.String getRepositoryId()
Description copied from interface: StoredObject
Get the repository id of this object where the object is stored.

Specified by:
getRepositoryId in interface StoredObject
Returns:

setProperties

public void setProperties(java.util.Map<java.lang.String,PropertyData<?>> props)
Description copied from interface: StoredObject
Assign the properties to an object. This method does not persist the object.

Specified by:
setProperties in interface StoredObject
Parameters:
props - properties to be assigned

getProperties

public java.util.Map<java.lang.String,PropertyData<?>> getProperties()
Description copied from interface: StoredObject
Retrieve the list of properties

Specified by:
getProperties in interface StoredObject
Returns:

getChangeToken

public java.lang.String getChangeToken()
Description copied from interface: StoredObject
Retrieve a change token uniquely identifying the state of the object when it was persisted (used for optimistic locking)

Specified by:
getChangeToken in interface StoredObject
Returns:
String identifying the change token

rename

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

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

createSystemBasePropertiesWhenCreated

public void createSystemBasePropertiesWhenCreated(java.util.Map<java.lang.String,PropertyData<?>> properties,
                                                  java.lang.String user)
Description copied from interface: StoredObject
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.

Specified by:
createSystemBasePropertiesWhenCreated in interface StoredObject
Parameters:
properties - The properties passed by the client, containing, name, type, etc
user - The user creating the document

updateSystemBasePropertiesWhenModified

public void updateSystemBasePropertiesWhenModified(java.util.Map<java.lang.String,PropertyData<?>> properties,
                                                   java.lang.String user)
Description copied from interface: StoredObject
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.

Specified by:
updateSystemBasePropertiesWhenModified in interface StoredObject
Parameters:
properties - The properties passed by the client, containing, name, type, etc
user - The user creating the document

fillProperties

public void fillProperties(java.util.Map<java.lang.String,PropertyData<?>> properties,
                           BindingsObjectFactory objFactory,
                           java.util.List<java.lang.String> requestedIds)
Specified by:
fillProperties in interface StoredObject

setCustomProperties

public void setCustomProperties(java.util.Map<java.lang.String,PropertyData<?>> properties)
Description copied from interface: StoredObject
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.

Specified by:
setCustomProperties in interface StoredObject
Parameters:
properties - Set of properties as set by the client, including system parameters

setSystemBasePropertiesWhenCreatedDirect

protected void setSystemBasePropertiesWhenCreatedDirect(java.lang.String name,
                                                        java.lang.String typeId,
                                                        java.lang.String user)
Add CMIS_CREATED_BY, CMIS_CREATION_DATE, CMIS_LAST_MODIFIED_BY, CMIS_LAST_MODIFICATION_DATE, CMIS_CHANGE_TOKEN system properties to the list of properties with current values


persist

public void persist()
Description copied from interface: StoredObject
Persist the object so that it can be later retrieved by its id. Assign an id to the object

Specified by:
persist in interface StoredObject

getAcl

public Acl getAcl()
Description copied from interface: StoredObject
get the Acl of the stored object

Specified by:
getAcl in interface StoredObject

getObjectRelationships

public ObjectList getObjectRelationships(java.lang.Boolean includeSubRelationshipTypes,
                                         RelationshipDirection relationshipDirection,
                                         java.lang.String typeId,
                                         java.lang.String filter,
                                         java.lang.Boolean includeAllowableActions,
                                         java.math.BigInteger maxItems,
                                         java.math.BigInteger skipCount,
                                         ExtensionsData extension,
                                         java.lang.String user)
Description copied from interface: StoredObject
get the relationships of the object

Specified by:
getObjectRelationships in interface StoredObject
Parameters:
includeSubRelationshipTypes - if true, relationships of a sub type will be returned as well
relationshipDirection - whether relationships where the object is the source, or the target or all are returned
typeId - the type of the relationship, may be null
filter - a property filter, "*" means all properties
includeAllowableActions - whether allowable actions should be returned
user - the id of the user calling the method

getAllowableActions

public AllowableActions getAllowableActions(java.lang.String user)
Specified by:
getAllowableActions in interface StoredObject


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