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 TypeMethodDescriptionvoid
addPeer
(CompressedPublicKey publicKey) getPeer
(CompressedPublicKey publicKey) getPeers()
void
removeChildrenAndPath
(CompressedPublicKey publicKey, Path path) void
removePath
(CompressedPublicKey publicKey, Path path) void
setPeerInformation
(CompressedPublicKey publicKey, PeerInformation peerInformation) void
setPeerInformationAndAddPath
(CompressedPublicKey publicKey, PeerInformation peerInformation, Path path) void
setPeerInformationAndAddPathAndChildren
(CompressedPublicKey publicKey, PeerInformation peerInformation, Path path) void
setPeerInformationAndAddPathAndSetSuperPeer
(CompressedPublicKey publicKey, PeerInformation peerInformation, Path path) toString()
void
void
-
Constructor Details
-
PeersManager
-
-
Method Details
-
toString
-
getPeers
-
getChildren
-
getSuperPeer
- Returns:
- public key and information about Super Peer. If no Super Peer is defined, then
null
is 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)
-