public abstract class OwCMISAbstractTransientObject<N extends org.apache.chemistry.opencmis.client.api.TransientCmisObject> extends Object implements OwCMISTransientObject<N>
Caches CmisObject
properties to minimize the number of DMS repository accesses.
Alfresco Workdesk
Copyright (c) Alfresco Software, Inc.
All rights reserved.
For licensing information read the license.txt file or
go to: http://wiki.alfresco.com
Modifier and Type | Field and Description |
---|---|
protected OwCMISContextBoundObject<N> |
contextBoundObject |
protected org.apache.chemistry.opencmis.client.api.Session |
session |
Constructor and Description |
---|
OwCMISAbstractTransientObject(N transientCmisObject,
org.apache.chemistry.opencmis.client.api.OperationContext creationContext,
org.apache.chemistry.opencmis.client.api.Session session) |
Modifier and Type | Method and Description |
---|---|
protected org.apache.chemistry.opencmis.client.api.OperationContext |
addPropertyFilter(org.apache.chemistry.opencmis.client.api.OperationContext context,
Set<String> nativePropertyFilter,
Set<String> nativeRenditionFilter) |
void |
detach()
Detaches this transient object form the ECM CMIS repository.
|
protected org.apache.chemistry.opencmis.client.api.Session |
getSession() |
N |
getTransientCmisObject() |
org.apache.chemistry.opencmis.client.api.OperationContext |
getTransientContext() |
protected org.apache.chemistry.opencmis.commons.definitions.PropertyDefinition<?> |
getUnfetchedPropertyDefinition(String nativePropertyName)
(overridable)
Called by
secureProperties(Collection) if a property is requested, which is not cached. |
boolean |
isDetached() |
void |
refresh(Collection<String> propertyNames)
Refreshes the requested cached CMIS properties.
|
protected abstract OwCMISContextBoundObject<N> |
retrieveProperties(Set<String> nativePropertyFilter) |
protected abstract OwCMISContextBoundObject<N> |
retrieveRenditions(Set<String> nativeRenditionsFilter) |
N |
secureObject(Collection<String> propertyNames)
Make sure we have these properties cached.
|
N |
secureObject(String... propertyNames) |
Map<String,org.apache.chemistry.opencmis.client.api.Property<?>> |
secureProperties(Collection<String> propertyNames) |
org.apache.chemistry.opencmis.client.api.Property<?> |
secureProperty(String propertyName)
The property is first looked up in the cache, if not found it is loaded from the DMS repository.
|
List<org.apache.chemistry.opencmis.client.api.Rendition> |
secureRenditions(Set<String> renditions,
boolean refresh) |
void |
setProperties(Map<String,Object> propertyValues)
Persists to the CMIS-ECM and sets the mapped property values to the underlying
TransientCmisObject . |
protected org.apache.chemistry.opencmis.client.api.Session session
protected OwCMISContextBoundObject<N extends org.apache.chemistry.opencmis.client.api.TransientCmisObject> contextBoundObject
public OwCMISAbstractTransientObject(N transientCmisObject, org.apache.chemistry.opencmis.client.api.OperationContext creationContext, org.apache.chemistry.opencmis.client.api.Session session)
public void detach()
OwCMISTransientObject
detach
in interface OwCMISTransientObject<N extends org.apache.chemistry.opencmis.client.api.TransientCmisObject>
public boolean isDetached()
isDetached
in interface OwCMISTransientObject<N extends org.apache.chemistry.opencmis.client.api.TransientCmisObject>
protected org.apache.chemistry.opencmis.client.api.Session getSession()
public org.apache.chemistry.opencmis.client.api.OperationContext getTransientContext()
getTransientContext
in interface OwCMISTransientObject<N extends org.apache.chemistry.opencmis.client.api.TransientCmisObject>
public N getTransientCmisObject()
getTransientCmisObject
in interface OwCMISTransientObject<N extends org.apache.chemistry.opencmis.client.api.TransientCmisObject>
TransientCmisObject
state dataprotected abstract OwCMISContextBoundObject<N> retrieveProperties(Set<String> nativePropertyFilter) throws com.wewebu.ow.server.exceptions.OwException
com.wewebu.ow.server.exceptions.OwException
protected abstract OwCMISContextBoundObject<N> retrieveRenditions(Set<String> nativeRenditionsFilter) throws com.wewebu.ow.server.exceptions.OwException
com.wewebu.ow.server.exceptions.OwException
protected org.apache.chemistry.opencmis.client.api.OperationContext addPropertyFilter(org.apache.chemistry.opencmis.client.api.OperationContext context, Set<String> nativePropertyFilter, Set<String> nativeRenditionFilter)
public N secureObject(String... propertyNames) throws com.wewebu.ow.server.exceptions.OwException
secureObject
in interface OwCMISTransientObject<N extends org.apache.chemistry.opencmis.client.api.TransientCmisObject>
propertyNames
- CMIS property IDs that need to be securedTransientCmisObject
state data with the given properties securedcom.wewebu.ow.server.exceptions.OwException
public N secureObject(Collection<String> propertyNames) throws com.wewebu.ow.server.exceptions.OwException
secureObject
in interface OwCMISTransientObject<N extends org.apache.chemistry.opencmis.client.api.TransientCmisObject>
propertyNames
- TransientCmisObject
state data with the given properties securedcom.wewebu.ow.server.exceptions.OwException
public Map<String,org.apache.chemistry.opencmis.client.api.Property<?>> secureProperties(Collection<String> propertyNames) throws com.wewebu.ow.server.exceptions.OwException
secureProperties
in interface OwCMISTransientObject<N extends org.apache.chemistry.opencmis.client.api.TransientCmisObject>
propertyNames
- Collection of String (native property names)com.wewebu.ow.server.exceptions.OwException
protected org.apache.chemistry.opencmis.commons.definitions.PropertyDefinition<?> getUnfetchedPropertyDefinition(String nativePropertyName)
secureProperties(Collection)
if a property is requested, which is not cached.
Returned PropertyDefinition will be used to transform id to corresponding queryName representation which will be used for fetching.nativePropertyName
- String native (non-qualified) property Idpublic org.apache.chemistry.opencmis.client.api.Property<?> secureProperty(String propertyName) throws com.wewebu.ow.server.exceptions.OwException
secureProperty
in interface OwCMISTransientObject<N extends org.apache.chemistry.opencmis.client.api.TransientCmisObject>
propertyName
- native property name (not qualified)com.wewebu.ow.server.exceptions.OwException
- If the property is not defined for this object or it could not be retrieved from the DMS repository.public void refresh(Collection<String> propertyNames)
OwCMISTransientObject
refresh
in interface OwCMISTransientObject<N extends org.apache.chemistry.opencmis.client.api.TransientCmisObject>
public void setProperties(Map<String,Object> propertyValues)
OwCMISTransientObject
TransientCmisObject
.setProperties
in interface OwCMISTransientObject<N extends org.apache.chemistry.opencmis.client.api.TransientCmisObject>
public List<org.apache.chemistry.opencmis.client.api.Rendition> secureRenditions(Set<String> renditions, boolean refresh) throws com.wewebu.ow.server.exceptions.OwException
secureRenditions
in interface OwCMISTransientObject<N extends org.apache.chemistry.opencmis.client.api.TransientCmisObject>
renditions
- string filter of renditions to securerefresh
- true to retrieve again available renditionscom.wewebu.ow.server.exceptions.OwException
Copyright © 2014 Alfresco Business Solutions. All Rights Reserved.