Package org.drasyl.peer
Class PeersManager
- java.lang.Object
-
- org.drasyl.peer.PeersManager
-
public class PeersManager extends Object
This class contains information about other peers. This includes the public keys, available interfaces, connections or relations (e.g. direct/relayed connection, super peer, child). Before a relation is set for a peer, it must be ensured that its information is available. Likewise, the information may not be removed from a peer if the peer still has a relationThis class is optimized for concurrent access and is thread-safe.
-
-
Constructor Summary
Constructors Constructor Description PeersManager(Consumer<Event> eventConsumer, Identity identity)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addPath(CompressedPublicKey publicKey, Object path)
void
addPathAndChildren(CompressedPublicKey publicKey, Object path)
void
addPathAndSuperPeer(CompressedPublicKey publicKey, Object path)
Set<CompressedPublicKey>
getChildren()
Set<Object>
getPaths(CompressedPublicKey publicKey)
Set<CompressedPublicKey>
getPeers()
Set<CompressedPublicKey>
getSuperPeers()
void
removeChildrenAndPath(CompressedPublicKey publicKey, Object path)
void
removePath(CompressedPublicKey publicKey, Object path)
void
removeSuperPeerAndPath(CompressedPublicKey publicKey, Object path)
String
toString()
-
-
-
Method Detail
-
getPeers
public Set<CompressedPublicKey> getPeers()
-
getChildren
public Set<CompressedPublicKey> getChildren()
-
getSuperPeers
public Set<CompressedPublicKey> getSuperPeers()
-
getPaths
public Set<Object> getPaths(CompressedPublicKey publicKey)
-
addPath
public void addPath(CompressedPublicKey publicKey, Object path)
-
removePath
public void removePath(CompressedPublicKey publicKey, Object path)
-
addPathAndSuperPeer
public void addPathAndSuperPeer(CompressedPublicKey publicKey, Object path)
-
removeSuperPeerAndPath
public void removeSuperPeerAndPath(CompressedPublicKey publicKey, Object path)
-
addPathAndChildren
public void addPathAndChildren(CompressedPublicKey publicKey, Object path)
-
removeChildrenAndPath
public void removeChildrenAndPath(CompressedPublicKey publicKey, Object path)
-
-