public abstract class AbstractCmisObject extends Object implements CmisObject, Serializable
Constructor and Description |
---|
AbstractCmisObject() |
Modifier and Type | Method and Description |
---|---|
Acl |
addAcl(List<Ace> addAces,
AclPropagation aclPropagation)
Adds ACEs to the object and refreshes this object afterwards.
|
Acl |
applyAcl(List<Ace> addAces,
List<Ace> removeAces,
AclPropagation aclPropagation)
Adds and removes ACEs to the object and refreshes this object afterwards.
|
void |
applyPolicy(ObjectId... policyIds)
Applies the provided policies and refreshes this object afterwards.
|
void |
delete()
Deletes this object.
|
void |
delete(boolean allVersions)
Deletes this object.
|
List<ObjectType> |
findObjectType(String id)
Returns a list of primary and secondary object types that define the
given property.
|
Acl |
getAcl()
Returns the ACL if it has been fetched for this object.
|
Acl |
getAcl(boolean onlyBasicPermissions) |
<T> T |
getAdapter(Class<T> adapterInterface)
Returns an adapter based on the given interface.
|
AllowableActions |
getAllowableActions()
Returns the allowable actions if they have been fetched for this object.
|
ObjectType |
getBaseType()
Returns the base type of this CMIS object (object type identified by
cmis:baseTypeId ). |
BaseTypeId |
getBaseTypeId()
Returns the id of the base type of this CMIS object (CMIS property
cmis:baseTypeId ). |
protected CmisBinding |
getBinding()
Returns the binding object.
|
String |
getChangeToken()
Returns the change token (CMIS property
cmis:changeToken ). |
String |
getCreatedBy()
Returns the user who created this CMIS object (CMIS property
cmis:createdBy ). |
protected OperationContext |
getCreationContext()
Returns the
OperationContext that was used to create this object. |
GregorianCalendar |
getCreationDate()
Returns the timestamp when this CMIS object has been created (CMIS
property
cmis:creationDate ). |
String |
getDescription()
Returns the description of this CMIS object (CMIS property
cmis:description ). |
List<CmisExtensionElement> |
getExtensions(ExtensionLevel level)
Returns the extensions for the given level.
|
String |
getId()
Returns the object ID.
|
GregorianCalendar |
getLastModificationDate()
Returns the timestamp when this CMIS object has been modified (CMIS
property
cmis:lastModificationDate ). |
String |
getLastModifiedBy()
Returns the user who modified this CMIS object (CMIS property
cmis:lastModifiedBy ). |
String |
getName()
Returns the name of this CMIS object (CMIS property
cmis:name ). |
protected ObjectFactory |
getObjectFactory()
Returns the object factory.
|
protected String |
getObjectId()
Returns the id of this object or throws an exception if the id is
unknown.
|
protected ObjectType |
getObjectType()
Returns the object type.
|
List<Policy> |
getPolicies()
Returns the applied policies if they have been fetched for this object.
|
List<Property<?>> |
getProperties()
Returns a list of all available CMIS properties.
|
<T> Property<T> |
getProperty(String id)
Returns a property.
|
protected String |
getPropertyQueryName(String propertyId)
Returns the query name of a property.
|
<T> T |
getPropertyValue(String id)
Returns the value of a property.
|
long |
getRefreshTimestamp()
Returns the timestamp of the last refresh.
|
List<Relationship> |
getRelationships()
Returns the relationships if they have been fetched for this object.
|
List<Rendition> |
getRenditions()
Returns the renditions if they have been fetched for this object.
|
protected String |
getRepositoryId()
Returns the repository id.
|
List<SecondaryType> |
getSecondaryTypes()
Returns the secondary types of this CMIS object (object types identified
by
cmis:secondaryObjectTypeIds ). |
protected SessionImpl |
getSession()
Returns the session object.
|
ObjectType |
getType()
Returns the type of this CMIS object (object type identified by
cmis:objectTypeId ). |
protected void |
initialize(SessionImpl session,
ObjectType objectType,
ObjectData objectData,
OperationContext context)
Initializes the object.
|
protected void |
readLock()
Acquires a read lock.
|
protected void |
readUnlock()
Releases a read lock.
|
void |
refresh()
Reloads this object from the repository.
|
void |
refreshIfOld(long durationInMillis)
Reloads the data from the repository if the last refresh did not occur
within
durationInMillis . |
Acl |
removeAcl(List<Ace> removeAces,
AclPropagation aclPropagation)
Removes ACEs to the object and refreshes this object afterwards.
|
void |
removePolicy(ObjectId... policyIds)
Removes the provided policies and refreshes this object afterwards.
|
CmisObject |
rename(String newName)
Renames this object (changes the value of
cmis:name ). |
ObjectId |
rename(String newName,
boolean refresh)
Renames this object (changes the value of
cmis:name ). |
Acl |
setAcl(List<Ace> aces)
Removes the direct ACE of this object, sets the provided ACEs to the
object and refreshes this object afterwards.
|
String |
toString() |
CmisObject |
updateProperties(Map<String,?> properties)
Updates the provided properties and refreshes this object afterwards.
|
ObjectId |
updateProperties(Map<String,?> properties,
boolean refresh)
Updates the provided properties.
|
protected void |
writeLock()
Acquires a write lock.
|
protected void |
writeUnlock()
Releases a write lock.
|
protected void initialize(SessionImpl session, ObjectType objectType, ObjectData objectData, OperationContext context)
protected void writeLock()
protected void writeUnlock()
protected void readLock()
protected void readUnlock()
protected SessionImpl getSession()
protected String getRepositoryId()
protected ObjectType getObjectType()
protected CmisBinding getBinding()
protected ObjectFactory getObjectFactory()
protected String getObjectId()
protected OperationContext getCreationContext()
OperationContext
that was used to create this object.protected String getPropertyQueryName(String propertyId)
public void delete()
CmisObject
delete
in interface CmisObject
public void delete(boolean allVersions)
CmisObject
delete
in interface CmisObject
allVersions
- if this object is a document this parameter defines whether
only this version (false
) or all versions (true
) should be deleted, the parameter is ignored for all other
object typespublic CmisObject updateProperties(Map<String,?> properties)
CmisObject
updateProperties
in interface CmisObject
properties
- the properties to updatepublic ObjectId updateProperties(Map<String,?> properties, boolean refresh)
CmisObject
updateProperties
in interface CmisObject
properties
- the properties to updaterefresh
- true
if this object should be refresh after the
update, false
if notpublic CmisObject rename(String newName)
CmisObject
cmis:name
). If the
repository created a new object, for example a new version, this new
object is returned. Otherwise the current object is returned.rename
in interface CmisObject
newName
- the new name, not null
or emptypublic ObjectId rename(String newName, boolean refresh)
CmisObject
cmis:name
). If the
repository created a new object, for example a new version, the object id
of the new object is returned. Otherwise the object id of the current
object is returned.rename
in interface CmisObject
newName
- the new name, not null
or emptyrefresh
- true
if this object should be refresh after the
update, false
if notpublic ObjectType getBaseType()
CmisObjectProperties
cmis:baseTypeId
).getBaseType
in interface CmisObjectProperties
null
if the property
cmis:baseTypeId
hasn't been requested or hasn't been
provided by the repositorypublic BaseTypeId getBaseTypeId()
CmisObjectProperties
cmis:baseTypeId
).getBaseTypeId
in interface CmisObjectProperties
null
if the property
hasn't been requested or hasn't been provided by the repositorypublic String getChangeToken()
CmisObjectProperties
cmis:changeToken
).getChangeToken
in interface CmisObjectProperties
null
if the property
hasn't been requested or hasn't been provided or isn't supported
by the repositorypublic String getCreatedBy()
CmisObjectProperties
cmis:createdBy
).getCreatedBy
in interface CmisObjectProperties
null
if the property hasn't
been requested or hasn't been provided by the repositorypublic GregorianCalendar getCreationDate()
CmisObjectProperties
cmis:creationDate
).getCreationDate
in interface CmisObjectProperties
null
if the property
hasn't been requested or hasn't been provided by the repositorypublic GregorianCalendar getLastModificationDate()
CmisObjectProperties
cmis:lastModificationDate
).getLastModificationDate
in interface CmisObjectProperties
null
if the
property hasn't been requested or hasn't been provided by the
repositorypublic String getLastModifiedBy()
CmisObjectProperties
cmis:lastModifiedBy
).getLastModifiedBy
in interface CmisObjectProperties
null
if the property
hasn't been requested or hasn't been provided by the repositorypublic String getName()
CmisObjectProperties
cmis:name
).getName
in interface CmisObjectProperties
null
if the property hasn't
been requested or hasn't been provided by the repositorypublic String getDescription()
CmisObjectProperties
cmis:description
).getDescription
in interface CmisObjectProperties
null
if the property
hasn't been requested, hasn't been provided by the repository, or
the property value isn't setpublic List<Property<?>> getProperties()
CmisObjectProperties
getProperties
in interface CmisObjectProperties
public <T> Property<T> getProperty(String id)
CmisObjectProperties
getProperty
in interface CmisObjectProperties
id
- the ID of the propertynull
if the property hasn't been
requested or hasn't been provided by the repositorypublic <T> T getPropertyValue(String id)
CmisObjectProperties
getPropertyValue
in interface CmisObjectProperties
id
- the ID of the propertynull
if the property hasn't been
requested, hasn't been provided by the repository, or the
property value isn't setpublic ObjectType getType()
CmisObjectProperties
cmis:objectTypeId
).getType
in interface CmisObjectProperties
null
if the property
cmis:objectTypeId
hasn't been requested or hasn't been
provided by the repositorypublic List<SecondaryType> getSecondaryTypes()
CmisObjectProperties
cmis:secondaryObjectTypeIds
).getSecondaryTypes
in interface CmisObjectProperties
null
if the property
cmis:secondaryObjectTypeIds
hasn't been requested or
hasn't been provided by the repositorypublic List<ObjectType> findObjectType(String id)
CmisObjectProperties
findObjectType
in interface CmisObjectProperties
id
- the ID of the propertynull
if the property couldn't be found in the object
types that are attached to this objectpublic AllowableActions getAllowableActions()
CmisObject
getAllowableActions
in interface CmisObject
public List<Rendition> getRenditions()
CmisObject
getRenditions
in interface CmisObject
public Acl getAcl(boolean onlyBasicPermissions)
public Acl applyAcl(List<Ace> addAces, List<Ace> removeAces, AclPropagation aclPropagation)
CmisObject
applyAcl
in interface CmisObject
public Acl addAcl(List<Ace> addAces, AclPropagation aclPropagation)
CmisObject
addAcl
in interface CmisObject
public Acl removeAcl(List<Ace> removeAces, AclPropagation aclPropagation)
CmisObject
removeAcl
in interface CmisObject
public Acl setAcl(List<Ace> aces)
CmisObject
setAcl
in interface CmisObject
public Acl getAcl()
CmisObject
getAcl
in interface CmisObject
public void applyPolicy(ObjectId... policyIds)
CmisObject
applyPolicy
in interface CmisObject
policyIds
- the IDs of the policies to be appliedpublic void removePolicy(ObjectId... policyIds)
CmisObject
removePolicy
in interface CmisObject
policyIds
- the IDs of the policies to be removedpublic List<Policy> getPolicies()
CmisObject
getPolicies
in interface CmisObject
public List<Relationship> getRelationships()
CmisObject
getRelationships
in interface CmisObject
public List<CmisExtensionElement> getExtensions(ExtensionLevel level)
CmisObject
getExtensions
in interface CmisObject
level
- the levelnull
if there no
extensionspublic <T> T getAdapter(Class<T> adapterInterface)
CmisObject
getAdapter
in interface CmisObject
null
if no adapter object could be
createdpublic long getRefreshTimestamp()
CmisObject
getRefreshTimestamp
in interface CmisObject
public void refresh()
CmisObject
refresh
in interface CmisObject
public void refreshIfOld(long durationInMillis)
CmisObject
durationInMillis
.refreshIfOld
in interface CmisObject
Copyright © 2009-2014 The Apache Software Foundation. All Rights Reserved.