public interface RaftSessions extends Iterable<RaftSession>
Server state machines can use the Sessions object to access the list of sessions currently open to the
state machine. Session sets are guaranteed to be deterministic. All state machines will see the same set of
open sessions at the same point in the log except in cases where a session has already been closed and removed.
If a session has already been closed on another server, the session is guaranteed to have been expired on all
servers and thus operations like RaftSession.publish(io.atomix.protocols.raft.event.RaftEvent) are effectively no-ops.
| Modifier and Type | Method and Description |
|---|---|
RaftSessions |
addListener(RaftSessionListener listener)
Adds a listener to the sessions.
|
RaftSession |
getSession(long sessionId)
Returns a session by session ID.
|
RaftSessions |
removeListener(RaftSessionListener listener)
Removes a listener from the sessions.
|
forEach, iterator, spliteratorRaftSession getSession(long sessionId)
sessionId - The session ID.null if no session with the given sessionId exists.RaftSessions addListener(RaftSessionListener listener)
listener - The listener to add.NullPointerException - if the session listener is nullRaftSessions removeListener(RaftSessionListener listener)
listener - The listener to remove.Copyright © 2013–2017. All rights reserved.