Class CMISVersioningFilter
- java.lang.Object
-
- org.nuxeo.ecm.core.opencmis.impl.server.versioning.CMISVersioningFilter
-
- All Implemented Interfaces:
BiPredicate<DocumentModel,DocumentModel>
,VersioningPolicyFilter
public class CMISVersioningFilter extends Object implements VersioningPolicyFilter
Automatic versioning filter to filter out document from CMIS (automatic versioning is currently not supported by CMIS).This filter has an enabled state which is a
ThreadLocal
, it returnsBoolean.TRUE
only for thread from CMIS.- Since:
- 9.1
-
-
Field Summary
Fields Modifier and Type Field Description protected static ThreadLocal<Boolean>
ENABLED
-
Constructor Summary
Constructors Constructor Description CMISVersioningFilter()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static void
disable()
Disables the filter for current thread.static void
enable()
Enables the filter for current thread, which will disable the automatic versioning.boolean
test(DocumentModel previousDocument, DocumentModel currentDocument)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.function.BiPredicate
and, negate, or
-
-
-
-
Field Detail
-
ENABLED
protected static final ThreadLocal<Boolean> ENABLED
-
-
Constructor Detail
-
CMISVersioningFilter
public CMISVersioningFilter()
-
-
Method Detail
-
test
public boolean test(DocumentModel previousDocument, DocumentModel currentDocument)
- Specified by:
test
in interfaceBiPredicate<DocumentModel,DocumentModel>
- Specified by:
test
in interfaceVersioningPolicyFilter
- Parameters:
previousDocument
- the document before modification, could be null if event is aboutToCreatecurrentDocument
- the document after modification- Returns:
- whether or not this filter matches the current context, if all policy's filters match, then apply policy
-
enable
public static void enable()
Enables the filter for current thread, which will disable the automatic versioning.
-
disable
public static void disable()
Disables the filter for current thread.
-
-