tuweni / org.apache.tuweni.peer.repository.memory / MemoryPeerRepository

MemoryPeerRepository

class MemoryPeerRepository : PeerRepository (source)

Memory-backed peer repository.

Constructors

<init>

Memory-backed peer repository.

MemoryPeerRepository()

Properties

connections

val connections: ConcurrentHashMap<String, Connection>

identities

val identities: HashSet<Identity>

peerMap

val peerMap: ConcurrentHashMap<Identity, Peer>

Functions

addConnection

fun addConnection(peer: Peer, identity: Identity): Unit

markConnectionInactive

fun markConnectionInactive(peer: Peer, identity: Identity): Unit

peerDiscoveredAt

fun peerDiscoveredAt(peer: Peer, time: Long): Unit

randomPeer

fun randomPeer(): Peer?

storeIdentity

fun storeIdentity(networkInterface: String, port: Int, publicKey: PublicKey): Identity

storePeer

fun storePeer(id: Identity, lastContacted: Instant?, lastDiscovered: Instant?): Peer