Package org.apache.sling.discovery.base.commons

# Class DefaultTopologyView

java.lang.Object
org.apache.sling.discovery.commons.providers.BaseTopologyView
org.apache.sling.discovery.base.commons.DefaultTopologyView

All Implemented Interfaces:
  `org.apache.sling.discovery.TopologyView`

public class DefaultTopologyView extends org.apache.sling.discovery.commons.providers.BaseTopologyView
Default Implementation of the topology view interface

## Constructor Summary

Constructors
Constructor
Description
`DefaultTopologyView()`
Create a new empty topology
`DefaultTopologyView(Collection<org.apache.sling.discovery.InstanceDescription> instances)`
Create a new topology filled with the given list of instances

## Method Summary

Modifier and Type
Method
Description
`void`
`addInstances(Collection<org.apache.sling.discovery.InstanceDescription> instances)`
Adds the given instances to this topology
`org.apache.sling.discovery.TopologyEvent.Type`
`compareTopology(DefaultTopologyView other)`
Compare this topology with the given one and determine how they compare
`boolean`
`equals(Object obj)`
`Set<org.apache.sling.discovery.InstanceDescription>`
`findInstances(org.apache.sling.discovery.InstanceFilter picker)`
`Set<org.apache.sling.discovery.ClusterView>`
`getClusterViews()`
`Set<org.apache.sling.discovery.InstanceDescription>`
`getInstances()`
`String`
`getLocalClusterSyncTokenId()`
`org.apache.sling.discovery.InstanceDescription`
`getLocalInstance()`
`int`
`hashCode()`
`void`
`setLocalClusterView(org.apache.sling.discovery.commons.providers.spi.LocalClusterView localClusterView)`
Adds the instances of the given ClusterView to this topology
`String`
`toString()`

### Methods inherited from class org.apache.sling.discovery.commons.providers.BaseTopologyView

`getInstance, isCurrent, setNotCurrent, toShortString`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

## Constructor Details

### DefaultTopologyView

public DefaultTopologyView()
Create a new empty topology

### DefaultTopologyView

public DefaultTopologyView(Collection<org.apache.sling.discovery.InstanceDescription> instances)
Create a new topology filled with the given list of instances

## Method Details

### compareTopology

public org.apache.sling.discovery.TopologyEvent.Type compareTopology(DefaultTopologyView other)
Compare this topology with the given one and determine how they compare

Parameters:
  `other` - the other topology against which to compare
Returns:
  the type describing how these two compare
See Also:
  - `TopologyEvent.Type`

### equals

public boolean equals(Object obj)

Overrides:
  `equals` in class `Object`

### hashCode

public int hashCode()

Overrides:
  `hashCode` in class `Object`

### getLocalInstance

public org.apache.sling.discovery.InstanceDescription getLocalInstance()

See Also:
  - `TopologyView.getLocalInstance()`

### getInstances

public Set<org.apache.sling.discovery.InstanceDescription> getInstances()

See Also:
  - `TopologyView.getInstances()`

### setLocalClusterView

public void setLocalClusterView(org.apache.sling.discovery.commons.providers.spi.LocalClusterView localClusterView)
Adds the instances of the given ClusterView to this topology

### addInstances

public void addInstances(Collection<org.apache.sling.discovery.InstanceDescription> instances)
Adds the given instances to this topology

### findInstances

public Set<org.apache.sling.discovery.InstanceDescription> findInstances(org.apache.sling.discovery.InstanceFilter picker)

See Also:
  - `TopologyView.findInstances(org.apache.sling.discovery.InstanceFilter)`

### getClusterViews

public Set<org.apache.sling.discovery.ClusterView> getClusterViews()

See Also:
  - `TopologyView.getClusterViews()`

### toString

public String toString()

Overrides:
  `toString` in class `Object`

### getLocalClusterSyncTokenId

public String getLocalClusterSyncTokenId()

Specified by:
  `getLocalClusterSyncTokenId` in class `org.apache.sling.discovery.commons.providers.BaseTopologyView`