@PrivateApi public interface EndpointManager<T extends Connection> extends ConnectionListenable, Consumer<Packet>
Connection
objects.Modifier and Type | Method and Description |
---|---|
Collection<T> |
getActiveConnections()
Returns all connections bind or not that are currently holding resources on this member.
|
T |
getConnection(Address address)
Gets the connection for a given address.
|
Collection<T> |
getConnections()
Returns connections that have been successfully established (ie.
|
T |
getOrConnect(Address address)
Gets the existing connection for a given address or connects.
|
T |
getOrConnect(Address address,
boolean silent)
Gets the existing connection for a given address.
|
boolean |
registerConnection(Address address,
T connection)
Registers (ie.
|
boolean |
transmit(Packet packet,
Address target)
Transmits a packet to a certain address.
|
boolean |
transmit(Packet packet,
T connection)
Transmits a packet to a certain connection.
|
addConnectionListener
Collection<T> getConnections()
Collection<T> getActiveConnections()
boolean registerConnection(Address address, T connection)
getConnection(Address)
will return
the relevant Connection
resource.address
- - The remote endpoint to register the connection underconnection
- - The connection to be registeredT getConnection(Address address)
address
- the remote side of the connectionT getOrConnect(Address address)
address
- the address to connect tonull
if no connection existsgetOrConnect(Address, boolean)
T getOrConnect(Address address, boolean silent)
null
.
When the connection is established at some point in time, it can be retrieved using the
getConnection(Address)
.
address
- the address to connect tosilent
- if logging should be done on debug level (silent=true
) or on info level (silent=false
)boolean transmit(Packet packet, T connection)
If this method is called with a null
connection, the call returns false
.
packet
- the packet to transmitconnection
- he connection to where the Packet should be transmittedtrue
if the transmit was a success, false
if a failure (there is no guarantee that the packet is
actually going to be received since the packet perhaps is stuck in some buffer; it just means that it's buffered somewhere)NullPointerException
- if the packet is null
boolean transmit(Packet packet, Address target)
If the connection to the target doesn't exist yet, the system will try to make the connection. In this case true can be returned, even though the connection eventually can't be established.
packet
- The Packet to transmit.target
- The address of the target machine where the Packet should be transmitted.NullPointerException
- if packet or target is null.transmit(com.hazelcast.nio.Packet, com.hazelcast.nio.Connection)
Copyright © 2020 Hazelcast, Inc.. All Rights Reserved.