public class PrimaryBackupSessionClient extends Object implements SessionClient
| Modifier and Type | Class and Description |
|---|---|
static class |
PrimaryBackupSessionClient.Builder
Primary-backup partition proxy builder.
|
| Constructor and Description |
|---|
PrimaryBackupSessionClient(String clientName,
PartitionId partitionId,
SessionId sessionId,
PrimitiveType primitiveType,
io.atomix.protocols.backup.protocol.PrimitiveDescriptor descriptor,
ClusterMembershipService clusterMembershipService,
io.atomix.protocols.backup.protocol.PrimaryBackupClientProtocol protocol,
PrimaryElection primaryElection,
io.atomix.utils.concurrent.ThreadContext threadContext) |
| Modifier and Type | Method and Description |
|---|---|
void |
addEventListener(EventType eventType,
Consumer<PrimitiveEvent> listener)
Adds an event listener.
|
void |
addStateChangeListener(Consumer<PrimitiveState> listener)
Registers a session state change listener.
|
CompletableFuture<Void> |
close()
Closes the proxy.
|
CompletableFuture<SessionClient> |
connect()
Connects the proxy.
|
io.atomix.utils.concurrent.ThreadContext |
context()
Returns the partition thread context.
|
CompletableFuture<byte[]> |
execute(PrimitiveOperation operation)
Executes an operation to the cluster.
|
PrimitiveState |
getState()
Returns the session state.
|
String |
name()
Returns the primitive name.
|
PartitionId |
partitionId()
Returns the partition identifier.
|
void |
removeEventListener(EventType eventType,
Consumer<PrimitiveEvent> listener)
Removes an event listener.
|
void |
removeStateChangeListener(Consumer<PrimitiveState> listener)
Removes a state change listener.
|
SessionId |
sessionId()
Returns the proxy session identifier.
|
PrimitiveType |
type()
Returns the client proxy type.
|
public PrimaryBackupSessionClient(String clientName, PartitionId partitionId, SessionId sessionId, PrimitiveType primitiveType, io.atomix.protocols.backup.protocol.PrimitiveDescriptor descriptor, ClusterMembershipService clusterMembershipService, io.atomix.protocols.backup.protocol.PrimaryBackupClientProtocol protocol, PrimaryElection primaryElection, io.atomix.utils.concurrent.ThreadContext threadContext)
public String name()
SessionClientname in interface SessionClientpublic PrimitiveType type()
SessionClienttype in interface SessionClientpublic io.atomix.utils.concurrent.ThreadContext context()
SessionClientcontext in interface SessionClientpublic PrimitiveState getState()
SessionClientgetState in interface SessionClientpublic PartitionId partitionId()
SessionClientpartitionId in interface SessionClientpublic SessionId sessionId()
SessionClientsessionId in interface SessionClientpublic void addStateChangeListener(Consumer<PrimitiveState> listener)
SessionClientaddStateChangeListener in interface SessionClientlistener - The callback to call when the session state changes.public void removeStateChangeListener(Consumer<PrimitiveState> listener)
SessionClientremoveStateChangeListener in interface SessionClientlistener - the state change listener to removepublic CompletableFuture<byte[]> execute(PrimitiveOperation operation)
SessionClientexecute in interface SessionClientoperation - the operation to executepublic void addEventListener(EventType eventType, Consumer<PrimitiveEvent> listener)
SessionClientaddEventListener in interface SessionClienteventType - the event type for which to add the listenerlistener - the event listener to addpublic void removeEventListener(EventType eventType, Consumer<PrimitiveEvent> listener)
SessionClientremoveEventListener in interface SessionClienteventType - the event type for which to remove the listenerlistener - the event listener to removepublic CompletableFuture<SessionClient> connect()
SessionClientconnect in interface SessionClientpublic CompletableFuture<Void> close()
SessionClientclose in interface SessionClientCopyright © 2013–2018. All rights reserved.