Package com.usatiuk.dhfs.peersync

# Class ReachablePeerManager

java.lang.Object
com.usatiuk.dhfs.peersync.ReachablePeerManager

@ApplicationScoped public class ReachablePeerManager extends Object

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static final record`
`ReachablePeerManager.HostStateSnapshot`

## Constructor Summary

Constructors
Constructor
Description
`ReachablePeerManager(jakarta.enterprise.inject.Instance<PeerConnectedEventListener> connectedListeners, jakarta.enterprise.inject.Instance<PeerDisconnectedEventListener> disconnectedListeners)`

## Method Summary

Modifier and Type
Method
Description
`void`
`addRemoteHost(PeerId host, String cert)`
`PeerAddress`
`getAddress(PeerId host)`
`List<PeerId>`
`getAvailableHosts()`
`ReachablePeerManager.HostStateSnapshot`
`getHostStateSnapshot()`
`Collection<org.apache.commons.lang3.tuple.Pair<PeerId,ApiPeerInfo>>`
`getSeenButNotAddedHosts()`
`void`
`handleConnectionError(PeerId host)`
`void`
`handleConnectionError(PeerInfo host)`
`boolean`
`isReachable(PeerId host)`
`boolean`
`isReachable(PeerInfo host)`
`void`
`removeRemoteHost(PeerId peerId)`
`Optional<PeerAddress>`
`selectBestAddress(PeerId host)`
`void`
`tryConnectAll()`

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

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

## Constructor Details

### ReachablePeerManager

public ReachablePeerManager(jakarta.enterprise.inject.Instance<PeerConnectedEventListener> connectedListeners, jakarta.enterprise.inject.Instance<PeerDisconnectedEventListener> disconnectedListeners)

## Method Details

### tryConnectAll

public void tryConnectAll()

### handleConnectionError

public void handleConnectionError(PeerId host)

### handleConnectionError

public void handleConnectionError(PeerInfo host)

### isReachable

public boolean isReachable(PeerId host)

### isReachable

public boolean isReachable(PeerInfo host)

### getAddress

public PeerAddress getAddress(PeerId host)

### getAvailableHosts

public List<PeerId> getAvailableHosts()

### getHostStateSnapshot

public ReachablePeerManager.HostStateSnapshot getHostStateSnapshot()

### removeRemoteHost

public void removeRemoteHost(PeerId peerId)

### selectBestAddress

public Optional<PeerAddress> selectBestAddress(PeerId host)

### addRemoteHost

public void addRemoteHost(PeerId host, @Nullable String cert)

### getSeenButNotAddedHosts

public Collection<org.apache.commons.lang3.tuple.Pair<PeerId,ApiPeerInfo>> getSeenButNotAddedHosts()