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

java.lang.Object
  extended by org.apache.sling.discovery.impl.common.View
Direct Known Subclasses:
VotingView

public class View
extends Object

DAO for a view stored in the repository.


Field Summary
protected static String VIEW_PROPERTY_CLUSTER_ID
           
protected static String VIEW_PROPERTY_CLUSTER_ID_DEFINED_AT
           
protected static String VIEW_PROPERTY_CLUSTER_ID_DEFINED_BY
           
 
Constructor Summary
View(org.apache.sling.api.resource.Resource resource)
           
 
Method Summary
 boolean equals(Object obj)
           
 org.apache.sling.api.resource.Resource getResource()
          Returns the underlying resource of this view.
 String getViewId()
          Returns the id of this view.
 int hashCode()
           
 boolean matches(Set<String> view)
          Compare this view with the given set of slingIds
 boolean matchesLiveView(org.apache.sling.api.resource.Resource clusterInstancesRes, Config config)
          Checks whether this view matches the 'live view' as represented in the clusterInstances resource
 void remove()
          Delete this view from the repository
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VIEW_PROPERTY_CLUSTER_ID

protected static final String VIEW_PROPERTY_CLUSTER_ID
See Also:
Constant Field Values

VIEW_PROPERTY_CLUSTER_ID_DEFINED_AT

protected static final String VIEW_PROPERTY_CLUSTER_ID_DEFINED_AT
See Also:
Constant Field Values

VIEW_PROPERTY_CLUSTER_ID_DEFINED_BY

protected static final String VIEW_PROPERTY_CLUSTER_ID_DEFINED_BY
See Also:
Constant Field Values
Constructor Detail

View

public View(org.apache.sling.api.resource.Resource resource)
Method Detail

getResource

public org.apache.sling.api.resource.Resource getResource()
Returns the underlying resource of this view.

Returns:
the underlying resource of this view

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

getViewId

public String getViewId()
Returns the id of this view.

Returns:
the id of this view

matchesLiveView

public boolean matchesLiveView(org.apache.sling.api.resource.Resource clusterInstancesRes,
                               Config config)
Checks whether this view matches the 'live view' as represented in the clusterInstances resource

Parameters:
clusterInstancesRes - the clusterInstances resource against which to check
Returns:

matches

public boolean matches(Set<String> view)
Compare this view with the given set of slingIds

Parameters:
view - a set of slingIds against which to compare this view
Returns:
true if this view matches the given set of slingIds

remove

public void remove()
Delete this view from the repository



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