public interface ResumptionSupportingConnectionStore
| Modifier and Type | Method and Description |
|---|---|
void |
attach(ConnectionIdGenerator connectionIdGenerator)
Attach connection id generator.
|
void |
clear()
Removes all connections from the store.
|
Connection |
find(SessionId id)
Finds a connection by its session ID.
|
Connection |
get(ConnectionId cid)
Gets a connection by its connection id.
|
Connection |
get(InetSocketAddress peerAddress)
Gets a connection by its peer address.
|
Iterator<Connection> |
iterator()
Get "weakly consistent" iterator over all connections.
|
void |
markAllAsResumptionRequired()
Mark all connections as resumption required.
|
boolean |
put(Connection connection)
Puts a connection into the store.
|
void |
putEstablishedSession(DTLSSession session,
Connection connection)
Associates the connection with the session id.
|
int |
remainingCapacity()
Gets the number of additional connection this store can manage.
|
boolean |
remove(Connection connection)
Removes a connection from the store and session cache.
|
boolean |
remove(Connection connection,
boolean removeFromSessionCache)
Removes a connection from the store and optional from the session cache.
|
void |
removeFromEstablishedSessions(DTLSSession session,
Connection connection)
Remove the association of the connection with the session id.
|
void |
setConnectionListener(ConnectionListener listener) |
void |
stop(List<Runnable> pending)
Stop all serial executors of connections from the store.
|
boolean |
update(Connection connection,
InetSocketAddress newPeerAddress)
Update a connection in the store.
|
void setConnectionListener(ConnectionListener listener)
void attach(ConnectionIdGenerator connectionIdGenerator)
put(Connection).connectionIdGenerator - connection id generator. If null a
default connection id generator is created.IllegalStateException - if attach(ConnectionIdGenerator)
was already called before.boolean put(Connection connection)
Connection.getConnectionId(). If the connection doesn't have a
connection id, a unique connection id created with the
attach(ConnectionIdGenerator) is assigned. If the connection has
also a peer address and/or a established session, it get's associated
with that as well. It removes also an other connection from these
associations.
Note: attach(ConnectionIdGenerator) must be called before!connection - the connection to storetrue if the connection could be stored, false,
otherwise (e.g. because the store's capacity is exhausted)IllegalStateException - if the connection is not executing, the
connection ids are exhausted, or the connection id is empty
or in use, or the connection id generator is not
attach(ConnectionIdGenerator) before!get(ConnectionId),
get(InetSocketAddress),
find(SessionId)boolean update(Connection connection, InetSocketAddress newPeerAddress)
connection - the connection to update.newPeerAddress - the (new) peer address. If null, don't
update the connection's address.true, if updated, false, otherwise.void putEstablishedSession(DTLSSession session, Connection connection)
session - established session.connection - connection of established sessionvoid removeFromEstablishedSessions(DTLSSession session, Connection connection)
session - established session.connection - connection of established sessionint remainingCapacity()
Connection get(InetSocketAddress peerAddress)
peerAddress - the peer addressnull if no connection
exists for the given addressConnection get(ConnectionId cid)
cid - connection idnull if no connection
exists for the given connection idConnection find(SessionId id)
id - the session IDnull if no connection
with an established session with the given ID existsboolean remove(Connection connection)
connection - the connection to removetrue if the connection was removed,
false, otherwiseboolean remove(Connection connection, boolean removeFromSessionCache)
connection - the connection to removeremoveFromSessionCache - true if the session of the
connection should be removed from the session cache,
false, otherwisetrue if the connection was removed,
false, otherwisevoid clear()
void stop(List<Runnable> pending)
pending - list to add pending jobsvoid markAllAsResumptionRequired()
Iterator<Connection> iterator()
ConcurrentModificationException, and guarantees to traverse
elements as they existed upon construction of the iterator, and may (but
is not guaranteed to) reflect any modifications subsequent to
construction.Copyright © 2023 Eclipse Foundation. All rights reserved.