public interface RaftProxyExecutor
| Modifier and Type | Method and Description |
|---|---|
void |
addEventListener(Consumer<RaftEvent> listener)
Adds a session event listener.
|
void |
addStateChangeListener(Consumer<RaftProxy.State> listener)
Registers a session state change listener.
|
default CompletableFuture<byte[]> |
execute(OperationId operationId)
Executes an operation to the Raft cluster.
|
default CompletableFuture<byte[]> |
execute(OperationId operationId,
byte[] operation)
Executes an operation to the Raft cluster.
|
CompletableFuture<byte[]> |
execute(RaftOperation operation)
Executes an operation to the cluster.
|
RaftProxy.State |
getState()
Returns the session state.
|
String |
name()
Returns the client proxy name.
|
void |
removeEventListener(Consumer<RaftEvent> listener)
Removes a session event listener.
|
void |
removeStateChangeListener(Consumer<RaftProxy.State> listener)
Removes a state change listener.
|
ServiceType |
serviceType()
Returns the client proxy type.
|
SessionId |
sessionId()
Returns the proxy session identifier.
|
SessionId sessionId()
String name()
ServiceType serviceType()
RaftProxy.State getState()
void addStateChangeListener(Consumer<RaftProxy.State> listener)
listener - The callback to call when the session state changes.void removeStateChangeListener(Consumer<RaftProxy.State> listener)
listener - the state change listener to removedefault CompletableFuture<byte[]> execute(OperationId operationId)
operationId - the operation identifierNullPointerException - if command is nulldefault CompletableFuture<byte[]> execute(OperationId operationId, byte[] operation)
operationId - the operation identifieroperation - the operation to executeNullPointerException - if command is nullCompletableFuture<byte[]> execute(RaftOperation operation)
operation - the operation to executeNullPointerException - if operation is nullvoid addEventListener(Consumer<RaftEvent> listener)
listener - the event listener to addCopyright © 2013–2017. All rights reserved.