Package org.nuxeo.ecm.core
Class CoreService
java.lang.Object
org.nuxeo.runtime.model.DefaultComponent
org.nuxeo.ecm.core.CoreService
- All Implemented Interfaces:
Adaptable
,Component
,Extensible
,TimestampedService
Service used to register version removal policies.
-
Field Summary
Modifier and TypeFieldDescriptionprotected ComponentContext
protected static final DefaultVersionRemovalPolicy
protected Map<CoreServicePolicyDescriptor,
VersionRemovalPolicy> Fields inherited from class org.nuxeo.runtime.model.DefaultComponent
lastModified, name
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
activate
(ComponentContext context) Activates the component.long
cleanupOrphanVersions
(long commitSize) Deprecated.void
deactivate
(ComponentContext context) Deactivates the component.protected long
doCleanupOrphanVersions
(CoreSession session, long commitSize) void
Schedule a removal of the orphan versions through BAF.Gets all the orphan version removal filters registered.Gets the last version removal policy registered.void
registerContribution
(Object contrib, String point, ComponentInstance contributor) protected void
protected void
void
unregisterContribution
(Object contrib, String point, ComponentInstance contributor) protected void
protected void
Methods inherited from class org.nuxeo.runtime.model.DefaultComponent
addRuntimeMessage, addRuntimeMessage, getAdapter, getDescriptor, getDescriptors, getLastModified, getRegistry, register, registerExtension, setLastModified, setModifiedNow, setName, start, stop, unregister, unregisterExtension
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.nuxeo.runtime.model.Component
getApplicationStartedOrder
-
Field Details
-
DEFAULT_VERSION_REMOVAL_POLICY
-
versionRemovalPolicies
-
orphanVersionRemovalFilters
protected Map<CoreServiceOrphanVersionRemovalFilterDescriptor,OrphanVersionRemovalFilter> orphanVersionRemovalFilters -
context
-
-
Constructor Details
-
CoreService
public CoreService()
-
-
Method Details
-
activate
Description copied from interface:Component
Activates the component.This method is called by the runtime when a component is activated.
- Specified by:
activate
in interfaceComponent
- Overrides:
activate
in classDefaultComponent
- Parameters:
context
- the runtime context
-
deactivate
Description copied from interface:Component
Deactivates the component.This method is called by the runtime when a component is deactivated.
- Specified by:
deactivate
in interfaceComponent
- Overrides:
deactivate
in classDefaultComponent
- Parameters:
context
- the runtime context
-
registerContribution
- Overrides:
registerContribution
in classDefaultComponent
-
unregisterContribution
- Overrides:
unregisterContribution
in classDefaultComponent
-
registerVersionRemovalPolicy
-
unregisterVersionRemovalPolicy
-
registerOrphanVersionRemovalFilter
protected void registerOrphanVersionRemovalFilter(CoreServiceOrphanVersionRemovalFilterDescriptor contrib) -
unregisterOrphanVersionRemovalFilter
protected void unregisterOrphanVersionRemovalFilter(CoreServiceOrphanVersionRemovalFilterDescriptor contrib) -
getVersionRemovalPolicy
Gets the last version removal policy registered. -
getOrphanVersionRemovalFilters
Gets all the orphan version removal filters registered. -
garbageCollectOrphanVersions
public void garbageCollectOrphanVersions()Schedule a removal of the orphan versions through BAF.A version stays referenced, and therefore is not removed, if any proxy points to a version in the version history of any live document, or in the case of tree snapshot if there is a snapshot containing a version in the version history of any live document.
- Since:
- 2023
-
cleanupOrphanVersions
Deprecated.since 2023 usegarbageCollectOrphanVersions()
instead.Removes the orphan versions.A version stays referenced, and therefore is not removed, if any proxy points to a version in the version history of any live document. Warning: this implementation does NOT take into account contribution made to the orphanVersionRemovalFilter extension point.
- Parameters:
commitSize
- the maximum number of orphan versions to delete in one transaction- Returns:
- the number of orphan versions deleted
- Since:
- 9.1
-
doCleanupOrphanVersions
-
garbageCollectOrphanVersions()
instead.