Package org.apache.sling.discovery

# Class TopologyEvent

java.lang.Object
org.apache.sling.discovery.TopologyEvent

public class TopologyEvent extends Object
A topology event is sent whenever a change in the topology occurs. This event object might be extended in the future with new event types and methods.

See Also:
  - `TopologyEventListener`

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static enum`
`TopologyEvent.Type`

## Constructor Summary

Constructors
Constructor
Description
`TopologyEvent(TopologyEvent.Type type, TopologyView oldView, TopologyView newView)`

## Method Summary

Modifier and Type
Method
Description
`TopologyView`
`getNewView()`
Returns the view which is currently (i.e. newly) valid.
`TopologyView`
`getOldView()`
Returns the view which was valid up until now.
`TopologyEvent.Type`
`getType()`
Returns the type of this event
`String`
`toString()`

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

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

## Constructor Details

### TopologyEvent

public TopologyEvent(TopologyEvent.Type type, TopologyView oldView, TopologyView newView)

## Method Details

### getType

public TopologyEvent.Type getType()
Returns the type of this event

Returns:
  the type of this event

### getOldView

public TopologyView getOldView()
Returns the view which was valid up until now.

This is null in case of `TOPOLOGY_INIT`

Returns:
  the view which was valid up until now, or null in case of a fresh instance start

### getNewView

public TopologyView getNewView()
Returns the view which is currently (i.e. newly) valid.

This is null in case of `TOPOLOGY_CHANGING`

Returns:
  the view which is currently valid, or null in case of `TOPOLOGY_CHANGING`

### toString

public String toString()

Overrides:
  `toString` in class `Object`