All Implemented Interfaces:
org.apache.sling.api.resource.observation.ResourceChangeListener

public class IdMapService extends AbstractServiceWithBackgroundCheck implements org.apache.sling.api.resource.observation.ResourceChangeListener
The IdMapService is responsible for storing a slingId-clusterNodeId pair to the repository and given all other instances in the cluster do the same can map clusterNodeIds to slingIds (or vice-versa)
  • Constructor Details

    • IdMapService

      public IdMapService()
  • Method Details

    • testConstructor

      public static IdMapService testConstructor(DiscoveryLiteConfig commonsConfig, org.apache.sling.settings.SlingSettingsService settingsService, org.apache.sling.api.resource.ResourceResolverFactory resourceResolverFactory)
      test-only constructor
    • activate

      protected void activate(org.osgi.framework.BundleContext bundleContext)
    • deactivate

      protected void deactivate()
    • getMyId

      public long getMyId()
    • waitForInit

      public boolean waitForInit(long timeout)
      for testing only
    • isInitialized

      public boolean isInitialized()
    • clearCache

      public void clearCache()
    • toSlingId

      public String toSlingId(int clusterNodeId, org.apache.sling.api.resource.ResourceResolver resourceResolver) throws org.apache.sling.api.resource.PersistenceException
      Throws:
      org.apache.sling.api.resource.PersistenceException
    • onChange

      public void onChange(List<org.apache.sling.api.resource.observation.ResourceChange> changes)
      Specified by:
      onChange in interface org.apache.sling.api.resource.observation.ResourceChangeListener