Package org.apache.sling.distribution.journal.impl.discovery

## Class TopologyView

- java.lang.Object
- - org.apache.sling.distribution.journal.impl.discovery.TopologyView

    @Immutable
    @ParametersAreNonnullByDefault
    public class TopologyView
    extends Object

### Constructor Summary

Constructors
`TopologyView()`
`TopologyView​(Set<State> newStates)`

### Method Summary

All Methods Instance Methods Concrete Methods
`boolean` `equals​(Object o)`
`Map<String,​Long>` `getMinOffsetByPubAgentName()` Return the map of min offset per publisher agent
`State` `getState​(String subAgentId, String pubAgentName)`
`Set<String>` `getSubscribedAgentIds()` Return the identifiers of subscriber agents
`Set<String>` `getSubscribedAgentIds​(String pubAgentName)` Return the identifiers of subscriber agents subscribed to the given publisher agent.
`Set<State>` `getSubscribedAgents​(String pubAgentName)` Return the identifiers of subscriber agents subscribed to the given publisher agent.
`Set<State>` `getSubscriberAgentStates​(String subAgentId)` Return the states for the given subscriber agent.
`int` `hashCode()`
`Stream<Long>` `offsets()` Return a stream of the offsets from all states in the view.
`String` `toString()`

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

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

### Constructor Detail

#### TopologyView

    public TopologyView()

#### TopologyView

    public TopologyView​(Set<State> newStates)

### Method Detail

#### getSubscribedAgentIds

    public Set<String> getSubscribedAgentIds()

Return the identifiers of subscriber agents

Returns:
  a set of subscriber agent identifiers (subAgentId)

#### getSubscribedAgentIds

    public Set<String> getSubscribedAgentIds​(String pubAgentName)

Return the identifiers of subscriber agents subscribed to the given publisher agent.

Parameters:
  `pubAgentName` - the name of the publisher agent
Returns:
  a set of subscriber agent identifiers (subAgentId)

#### getSubscribedAgents

    public Set<State> getSubscribedAgents​(String pubAgentName)

Return the identifiers of subscriber agents subscribed to the given publisher agent.

Parameters:
  `pubAgentName` - the name of the publisher agent
Returns:
  a set of subscriber agent identifiers (subAgentId)

#### getSubscriberAgentStates

    public Set<State> getSubscriberAgentStates​(String subAgentId)

Return the states for the given subscriber agent.

Parameters:
  `subAgentId` - the name of the subscriber agent to get the states for
Returns:
  states of that subscriber agent

#### getState

    @CheckForNull
    public State getState​(String subAgentId,
                          String pubAgentName)

#### getMinOffsetByPubAgentName

    public Map<String,​Long> getMinOffsetByPubAgentName()

Return the map of min offset per publisher agent

Returns:
  a map (pubAgentName x offset)

#### offsets

    public Stream<Long> offsets()

Return a stream of the offsets from all states in the view.

Returns:
  a stream of offsets

#### equals

    public boolean equals​(Object o)

Overrides:
  `equals` in class `Object`

#### hashCode

    public int hashCode()

Overrides:
  `hashCode` in class `Object`

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`