org.xcmis.spi
Interface ObjectData

All Known Subinterfaces:
DocumentData, FolderData, PolicyData, RelationshipData
All Known Implementing Classes:
BasicObjectData

public interface ObjectData

Version:
$Id: ObjectData.java 316 2010-03-09 15:20:28Z andrew00x $
Author:
Andrey Parfonov

Method Summary
 void accept(ObjectDataVisitor visitor)
          Accepts an ObjectDataVisitor.
 void applyPolicy(PolicyData policy)
          Applied specified policy to the current object.
 List<AccessControlEntry> getACL(boolean onlyBasicPermissions)
          Get ACL currently applied to object.
 BaseType getBaseType()
          To get object's base type.
 String getChangeToken()
          Shortcut to 'cmis:changeToken' property.
 ContentStream getContentStream(String streamId)
          Get the content stream with specified id.
 String getCreatedBy()
          Shortcut to 'cmis:createdBy' property.
 Calendar getCreationDate()
          Shortcut to 'cmis:creationDate' property.
 Calendar getLastModificationDate()
          Shortcut to 'cmis:lastModificationDate' property.
 String getLastModifiedBy()
          Shortcut to 'cmis:lastModifiedBy' property.
 String getName()
          Shortcut to 'cmis:name' property.
 String getObjectId()
          Shortcut to 'cmis:objectId' property.
 FolderData getParent()
          Get object parent.
 Collection<FolderData> getParents()
          Get collections of parent folders.
 Collection<PolicyData> getPolicies()
          Get policies applied to the current object.
 Map<String,Property<?>> getProperties()
          To get the object's properties.
 Map<String,Property<?>> getProperties(PropertyFilter filter)
          Get subset of properties accepted by PropertyFilter.
 Property<?> getProperty(String id)
           
 ItemsIterator<RelationshipData> getRelationships(RelationshipDirection direction, TypeDefinition type, boolean includeSubRelationshipTypes)
          Objects relationships.
 TypeDefinition getTypeDefinition()
          To get the object's type definition.
 String getTypeId()
          To get the object's type id.
 void removePolicy(PolicyData policy)
          Remove specified policy from object.
 void setACL(List<AccessControlEntry> acl)
          Set new ACL for object.
 void setProperties(Map<String,Property<?>> properties)
          Set or add new properties.
 void setProperty(Property<?> property)
          Set or update property.
 

Method Detail

accept

void accept(ObjectDataVisitor visitor)
Accepts an ObjectDataVisitor. Calls the visit method of visitor and pass this as parameter.

Parameters:
visitor - visitor

applyPolicy

void applyPolicy(PolicyData policy)
Applied specified policy to the current object. Implementation Compatibility: the support for policy objects is optional, If Policy object type is not supported then this method must throw NotSupportedException.

Parameters:
policy - policy to be applied

getACL

List<AccessControlEntry> getACL(boolean onlyBasicPermissions)
Get ACL currently applied to object. If ACL capability is not supported then this method must throw NotSupportedException. 2.2.10.1 getACL Implementation Compatibility: MUST be implemented if getRepository returns capabilityACL=discover or =manage.

Parameters:
onlyBasicPermissions - if true then only CMIS basic permissions Permission.BasicPermissions must be returned if false then basic permissions and repository specific permissions must be returned
Returns:
applied ACL. If there is no ACL applied to object or if object is not controllable by ACL empty list must be returned, never null
Throws:
NotSupportedException - if ACL is not supported at all
See Also:
Permission.BasicPermissions

getBaseType

BaseType getBaseType()
To get object's base type.

Returns:
base type of object
See Also:
BaseType

getChangeToken

String getChangeToken()
Shortcut to 'cmis:changeToken' property.

Returns:
'cmis:changeToken' property

getContentStream

ContentStream getContentStream(String streamId)
                               throws IOException
Get the content stream with specified id. Often it should be rendition stream. If object has type other then Document and streamId == null then this method return null. For Document objects default content stream will be returned.

Parameters:
streamId - the content stream id
Returns:
content stream or null
Throws:
IOException - if an I/O error occurs

getCreatedBy

String getCreatedBy()
Shortcut to 'cmis:createdBy' property.

Returns:
'cmis:createdBy' property

getCreationDate

Calendar getCreationDate()
Shortcut to 'cmis:creationDate' property.

Returns:
'cmis:creationDate' property

getLastModificationDate

Calendar getLastModificationDate()
Shortcut to 'cmis:lastModificationDate' property.

Returns:
'cmis:lastModificationDate' property

getLastModifiedBy

String getLastModifiedBy()
Shortcut to 'cmis:lastModifiedBy' property.

Returns:
'cmis:lastModifiedBy' property

getName

String getName()
Shortcut to 'cmis:name' property.

Returns:
'cmis:name' property

getObjectId

String getObjectId()
Shortcut to 'cmis:objectId' property.

Returns:
'cmis:objectId' property

getParent

FolderData getParent()
                     throws ConstraintException
Get object parent.

Returns:
parent of current object or null if object unfiled
Throws:
ConstraintException - if object has more then one parent or if current object is root folder

getParents

Collection<FolderData> getParents()
Get collections of parent folders. It may contains exactly one object for single-filed and empty collection for unfiled object or root folder.

Returns:
collection of object's parents

getPolicies

Collection<PolicyData> getPolicies()
Get policies applied to the current object. 2.2.9.3 getAppliedPolicies Implementation Compatibility: the support for policy objects is optional, if implementation does not support cmis:policy object-type method should throw NotSupportedException

Returns:
applied Policies. If there is no policies applied to object or if object is not controllable by policy then empty list must be returned, never null
Throws:
NotSupportedException - if policies is not supported at all

getProperties

Map<String,Property<?>> getProperties()
To get the object's properties.

Returns:
the set of CMIS properties

getProperties

Map<String,Property<?>> getProperties(PropertyFilter filter)
Get subset of properties accepted by PropertyFilter.

Parameters:
filter - property filter
Returns:
subset of properties

getProperty

Property<?> getProperty(String id)
Parameters:
id - property ID
Returns:
property with specified ID or null

getRelationships

ItemsIterator<RelationshipData> getRelationships(RelationshipDirection direction,
                                                 TypeDefinition type,
                                                 boolean includeSubRelationshipTypes)
Objects relationships. Implementation Compatibility: the support for relationship objects is optional, if implementation does not support cmis:relationship object-type method should throw NotSupportedException

Parameters:
direction - relationship's direction.
type - relationship type. If includeSubRelationshipTypes == true then all descendants of this type must be returned. If includeSubRelationshipTypes == true only relationship of the same type must be returned
includeSubRelationshipTypes - if true, then the return all relationships whose object types are descendant types of typeId.
Returns:
relationships if object has not any relationships then empty ItemsIterator must be returned, never null
Throws:
NotSupportedException - if relationship feature is not supported by storage
See Also:
RelationshipDirection

getTypeDefinition

TypeDefinition getTypeDefinition()
To get the object's type definition.

Returns:
type definition of object

getTypeId

String getTypeId()
To get the object's type id. It is shortcut to property 'cmis:objectTypeId'.

Returns:
type id

removePolicy

void removePolicy(PolicyData policy)
Remove specified policy from object. This method must not remove Policy object itself. Implementation Compatibility: the support for policy objects is optional, if implementation does not support cmis:policy object-type method should throw NotSupportedException

Parameters:
policy - the policy object
Throws:
NotSupportedException - if policies is not supported at all

setACL

void setACL(List<AccessControlEntry> acl)
Set new ACL for object. New ACL overwrite existed one. If ACL capability is not supported then this method must throw NotSupportedException . ACLs will be not merged but replace existed one by new. 2.2.10.2 applyACL Implementation Compatibility: MUST be implemented if getRepository returns capabilityACL != none

Parameters:
acl - ACL that should replace currently applied ACL
Throws:
NotSupportedException - if ACL is not supported by storage

setProperties

void setProperties(Map<String,Property<?>> properties)
                   throws NameConstraintViolationException,
                          UpdateConflictException,
                          VersioningException,
                          StorageException
Set or add new properties. Properties will be merged with existed one and not replace whole set of existed properties. Changes will be updated immediately. Empty list for property value Property.getValues() minds the property will be in 'value not set' state.

Parameters:
properties - the new set of properties
Throws:
NameConstraintViolationException - if cmis:name specified in properties throws conflict
VersioningException - if object is not current version and storage do not support update other then latest version
UpdateConflictException - if object that is no longer current (as determined by the storage)
StorageException - if object's properties can not be updated (save changes) cause to storage internal problem

setProperty

void setProperty(Property<?> property)
                 throws NameConstraintViolationException,
                        UpdateConflictException,
                        VersioningException,
                        StorageException
Set or update property. Changes will be updated immediately. Empty list for property value Property.getValues() minds the property will be in 'value not set' state. If property is required then ConstraintException will be thrown.

Parameters:
property - the new property
Throws:
NameConstraintViolationException - if cmis:name specified in properties throws conflict
VersioningException - if object is not current version and storage do not support update other then latest version
UpdateConflictException - if object that is no longer current (as determined by the storage)
StorageException - if object's properties can not be updated (save changes) cause to storage internal problem


Copyright © 2011 eXo Platform SAS. All Rights Reserved.