org.apache.sling.discovery.impl.common
Class ViewHelper

java.lang.Object
  extended by org.apache.sling.discovery.impl.common.ViewHelper

public class ViewHelper
extends Object

helper for views


Constructor Summary
ViewHelper()
           
 
Method Summary
static Set<String> determineLiveInstances(org.apache.sling.api.resource.Resource clusterInstancesResource, Config config)
          Return the list of cluster instances that are 'live', ie that have sent a heartbeat within the configured heartbeat timeout
static boolean establishedViewMatches(org.apache.sling.api.resource.ResourceResolver resourceResolver, Config config, Set<String> view)
          Check if the established view matches the given set of slingIds
static View getEstablishedView(org.apache.sling.api.resource.ResourceResolver resourceResolver, Config config)
          Return the currently established cluster view - or null if there is no cluster view established at the moment.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ViewHelper

public ViewHelper()
Method Detail

determineLiveInstances

public static Set<String> determineLiveInstances(org.apache.sling.api.resource.Resource clusterInstancesResource,
                                                 Config config)
Return the list of cluster instances that are 'live', ie that have sent a heartbeat within the configured heartbeat timeout

Parameters:
clusterInstancesResource -
config -
Returns:

getEstablishedView

public static View getEstablishedView(org.apache.sling.api.resource.ResourceResolver resourceResolver,
                                      Config config)
Return the currently established cluster view - or null if there is no cluster view established at the moment.

Parameters:
resourceResolver -
Returns:

establishedViewMatches

public static boolean establishedViewMatches(org.apache.sling.api.resource.ResourceResolver resourceResolver,
                                             Config config,
                                             Set<String> view)
Check if the established view matches the given set of slingIds



Copyright © 2007–2014 The Apache Software Foundation. All rights reserved.