public class DefaultStateLog<T> extends AbstractResource<StateLog<T>> implements StateLog<T>
context, executor, serializer| Constructor and Description |
|---|
DefaultStateLog(ResourceContext context) |
| Modifier and Type | Method and Description |
|---|---|
CompletableFuture<Void> |
close() |
<V> StateLog<T> |
installWith(java.util.function.Consumer<V> installer)
Registers a state log snapshot installer.
|
CompletableFuture<StateLog<T>> |
open() |
<U extends T,V> |
registerCommand(String name,
java.util.function.Function<U,V> command)
Registers a state command.
|
<U extends T,V> |
registerQuery(String name,
java.util.function.Function<U,V> query)
Registers a state query.
|
<U extends T,V> |
registerQuery(String name,
java.util.function.Function<U,V> query,
Consistency consistency)
Registers a state query.
|
<V> StateLog<T> |
snapshotWith(java.util.function.Supplier<V> snapshotter)
Registers a state log snapshot function.
|
<U> CompletableFuture<U> |
submit(String command,
T entry)
Submits a state command or query to the log.
|
String |
toString() |
StateLog<T> |
unregister(String name)
Unregisters a state command or query.
|
StateLog<T> |
unregisterCommand(String name)
Unregisters a state command.
|
StateLog<T> |
unregisterQuery(String name)
Unregisters a state query.
|
addShutdownTask, addStartupTask, cluster, isClosed, isOpen, name, runShutdownTasks, runStartupTasksclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddShutdownTask, addStartupTask, cluster, namepublic DefaultStateLog(ResourceContext context)
public <U extends T,V> StateLog<T> registerCommand(String name, java.util.function.Function<U,V> command)
StateLogregisterCommand in interface StateLog<T>U - The command input type.V - The command output type.name - The command name.command - The command function.public StateLog<T> unregisterCommand(String name)
StateLogunregisterCommand in interface StateLog<T>name - The command name.public <U extends T,V> StateLog<T> registerQuery(String name, java.util.function.Function<U,V> query)
StateLogregisterQuery in interface StateLog<T>U - The query input type.V - The query output type.name - The query name.query - The query function.public <U extends T,V> StateLog<T> registerQuery(String name, java.util.function.Function<U,V> query, Consistency consistency)
StateLogregisterQuery in interface StateLog<T>U - The query input type.V - The query output type.name - The query name.query - The query function.consistency - The default query consistency.public StateLog<T> unregisterQuery(String name)
StateLogunregisterQuery in interface StateLog<T>name - The query name.public StateLog<T> unregister(String name)
StateLogunregister in interface StateLog<T>name - The command or query name.public <V> StateLog<T> snapshotWith(java.util.function.Supplier<V> snapshotter)
StateLogsnapshotWith in interface StateLog<T>snapshotter - The snapshot function.public <V> StateLog<T> installWith(java.util.function.Consumer<V> installer)
StateLoginstallWith in interface StateLog<T>installer - The snapshot installer.public <U> CompletableFuture<U> submit(String command, T entry)
StateLogpublic CompletableFuture<StateLog<T>> open()
Copyright © 2013-2015. All Rights Reserved.