tuweni / org.apache.tuweni.rlpx / WireConnectionRepository

WireConnectionRepository

interface WireConnectionRepository (source)

A repository managing wire connections.

Types

Listener

Connection listener

interface Listener

Functions

add

Adds a new wire connection to the repository.

abstract fun add(wireConnection: WireConnection!): String!

addConnectionListener

Adds a listener called when connection occurs, ie when the connection is established and capabilities are exchanged.

abstract fun addConnectionListener(listener: Listener!): Unit

addDisconnectionListener

Adds a listener called when disconnection occurs, either from us or the peer initiative.

abstract fun addDisconnectionListener(listener: Listener!): Unit

asIterable

Provides a view of the wire connections as an iterable. There is no guarantee of sorting wire connections.

abstract fun asIterable(): MutableIterable<WireConnection!>!

Provides a subset of wire connections with a particular capabilities.

abstract fun asIterable(identifier: SubProtocolIdentifier!): MutableIterable<WireConnection!>!

close

Closes the repository. After it has been closed, the repository should no longer be able to add or retrieve connections.

abstract fun close(): Unit

get

Gets a wire connection by its identifier, as provided by org.apache.tuweni.rlpx.wire.DefaultWireConnection#id

abstract fun get(id: String!): WireConnection?

Inheritors

MemoryWireConnectionsRepository

In-memory implementation of the wire connections repository.

open class MemoryWireConnectionsRepository : WireConnectionRepository

WireConnectionPeerRepositoryAdapter

class WireConnectionPeerRepositoryAdapter : WireConnectionRepository