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
public class CoreService extends DefaultComponent
Service used to register version removal policies.
-
-
Field Summary
Fields Modifier and Type Field Description protected ComponentContext
context
protected static DefaultVersionRemovalPolicy
DEFAULT_VERSION_REMOVAL_POLICY
protected Map<CoreServiceOrphanVersionRemovalFilterDescriptor,OrphanVersionRemovalFilter>
orphanVersionRemovalFilters
protected Map<CoreServicePolicyDescriptor,VersionRemovalPolicy>
versionRemovalPolicies
-
Fields inherited from class org.nuxeo.runtime.model.DefaultComponent
lastModified, name
-
-
Constructor Summary
Constructors Constructor Description CoreService()
-
Method Summary
-
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
applicationStarted, getApplicationStartedOrder
-
-
-
-
Field Detail
-
DEFAULT_VERSION_REMOVAL_POLICY
protected static final DefaultVersionRemovalPolicy DEFAULT_VERSION_REMOVAL_POLICY
-
versionRemovalPolicies
protected Map<CoreServicePolicyDescriptor,VersionRemovalPolicy> versionRemovalPolicies
-
orphanVersionRemovalFilters
protected Map<CoreServiceOrphanVersionRemovalFilterDescriptor,OrphanVersionRemovalFilter> orphanVersionRemovalFilters
-
context
protected ComponentContext context
-
-
Method Detail
-
activate
public void activate(ComponentContext context)
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
public void deactivate(ComponentContext context)
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
public void registerContribution(Object contrib, String point, ComponentInstance contributor)
- Overrides:
registerContribution
in classDefaultComponent
-
unregisterContribution
public void unregisterContribution(Object contrib, String point, ComponentInstance contributor)
- Overrides:
unregisterContribution
in classDefaultComponent
-
registerVersionRemovalPolicy
protected void registerVersionRemovalPolicy(CoreServicePolicyDescriptor contrib)
-
unregisterVersionRemovalPolicy
protected void unregisterVersionRemovalPolicy(CoreServicePolicyDescriptor contrib)
-
registerOrphanVersionRemovalFilter
protected void registerOrphanVersionRemovalFilter(CoreServiceOrphanVersionRemovalFilterDescriptor contrib)
-
unregisterOrphanVersionRemovalFilter
protected void unregisterOrphanVersionRemovalFilter(CoreServiceOrphanVersionRemovalFilterDescriptor contrib)
-
getVersionRemovalPolicy
public VersionRemovalPolicy getVersionRemovalPolicy()
Gets the last version removal policy registered.
-
getOrphanVersionRemovalFilters
public Collection<OrphanVersionRemovalFilter> 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 public long cleanupOrphanVersions(long commitSize)
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
protected long doCleanupOrphanVersions(CoreSession session, long commitSize)
-
-