Class CoreService

All Implemented Interfaces:
Adaptable, Component, Extensible, TimestampedService

public class CoreService extends DefaultComponent
Service used to register version removal policies.
  • Field Details

  • Constructor Details

    • CoreService

      public CoreService()
  • Method Details

    • 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 interface Component
      Overrides:
      activate in class DefaultComponent
      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 interface Component
      Overrides:
      deactivate in class DefaultComponent
      Parameters:
      context - the runtime context
    • registerContribution

      public void registerContribution(Object contrib, String point, ComponentInstance contributor)
      Overrides:
      registerContribution in class DefaultComponent
    • unregisterContribution

      public void unregisterContribution(Object contrib, String point, ComponentInstance contributor)
      Overrides:
      unregisterContribution in class DefaultComponent
    • 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 use garbageCollectOrphanVersions() 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)