Package org.drasyl.peer
Class PeersManager
java.lang.Object
org.drasyl.peer.PeersManager
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 relation
This class is optimized for concurrent access and is thread-safe.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddPeer(CompressedPublicKey publicKey) getPeer(CompressedPublicKey publicKey) getPeers()voidremoveChildrenAndPath(CompressedPublicKey publicKey, Path path) voidremovePath(CompressedPublicKey publicKey, Path path) voidsetPeerInformation(CompressedPublicKey publicKey, PeerInformation peerInformation) voidsetPeerInformationAndAddPath(CompressedPublicKey publicKey, PeerInformation peerInformation, Path path) voidsetPeerInformationAndAddPathAndChildren(CompressedPublicKey publicKey, PeerInformation peerInformation, Path path) voidsetPeerInformationAndAddPathAndSetSuperPeer(CompressedPublicKey publicKey, PeerInformation peerInformation, Path path) toString()voidvoid
-
Constructor Details
-
PeersManager
-
-
Method Details
-
toString
-
getPeers
-
getChildren
-
getSuperPeer
- Returns:
- public key and information about Super Peer. If no Super Peer is defined, then
nullis returned
-
getSuperPeerKey
-
getChildrenKeys
-
getPeer
-
setPeerInformationAndAddPath
public void setPeerInformationAndAddPath(CompressedPublicKey publicKey, PeerInformation peerInformation, Path path) -
setPeerInformation
-
addPeer
-
removePath
-
unsetSuperPeer
public void unsetSuperPeer() -
unsetSuperPeerAndRemovePath
-
setPeerInformationAndAddPathAndSetSuperPeer
public void setPeerInformationAndAddPathAndSetSuperPeer(CompressedPublicKey publicKey, PeerInformation peerInformation, Path path) -
removeChildrenAndPath
-
setPeerInformationAndAddPathAndChildren
public void setPeerInformationAndAddPathAndChildren(CompressedPublicKey publicKey, PeerInformation peerInformation, Path path)
-