java.lang.Object
io.lettuce.core.output.CommandOutput<K,V,List<ReplayOutput.Signal>>
io.lettuce.core.output.ReplayOutput<K,V>
public class ReplayOutput<K,V> extends CommandOutput<K,V,List<ReplayOutput.Signal>>
Replayable
CommandOutput capturing output signals to replay these on a target CommandOutput. Replay is useful
when the response requires inspection prior to dispatching the actual output to a command target.- Since:
- 5.0.3
- Author:
- Mark Paluch
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classReplayOutput.BulkStringstatic classReplayOutput.ErrorBytesstatic classReplayOutput.SignalEncapsulates a replayable decoding signal. -
Field Summary
Fields inherited from class io.lettuce.core.output.CommandOutput
codec, error, output -
Constructor Summary
Constructors Constructor Description ReplayOutput()Initialize a new instance that encodes and decodes keys and values using the supplied codec. -
Method Summary
Modifier and Type Method Description voidcomplete(int depth)Mark the command output complete.voidmulti(int count)Mark the beginning of a multi sequence (array).voidreplay(CommandOutput<?,?,?> target)Replay all captured signals on aCommandOutput.voidset(long integer)Update the command output with a 64-bit signed integer.voidset(ByteBuffer bytes)Update the command output with a sequence of bytes, ornull.voidsetError(String error)Set command output to an error message from the client.voidsetError(ByteBuffer error)Set command output to an error message from the server.Methods inherited from class io.lettuce.core.output.CommandOutput
decodeAscii, get, getError, hasError, multiArray, multiMap, multiPush, multiSet, set, set, setBigNumber, setSingle, toString
-
Constructor Details
-
ReplayOutput
public ReplayOutput()Initialize a new instance that encodes and decodes keys and values using the supplied codec.
-
-
Method Details
-
set
Description copied from class:CommandOutputUpdate the command output with a sequence of bytes, ornull. ConcreteCommandOutputimplementations must override this method to decodebulk/bytes response values.- Overrides:
setin classCommandOutput<K,V,List<ReplayOutput.Signal>>- Parameters:
bytes- The command output, or null.
-
set
public void set(long integer)Description copied from class:CommandOutputUpdate the command output with a 64-bit signed integer. ConcreteCommandOutputimplementations must override this method to decodenumber(integer) response values.- Overrides:
setin classCommandOutput<K,V,List<ReplayOutput.Signal>>- Parameters:
integer- The command output.
-
setError
Description copied from class:CommandOutputSet command output to an error message from the server.- Overrides:
setErrorin classCommandOutput<K,V,List<ReplayOutput.Signal>>- Parameters:
error- Error message.
-
setError
Description copied from class:CommandOutputSet command output to an error message from the client.- Overrides:
setErrorin classCommandOutput<K,V,List<ReplayOutput.Signal>>- Parameters:
error- Error message.
-
complete
public void complete(int depth)Description copied from class:CommandOutputMark the command output complete.- Overrides:
completein classCommandOutput<K,V,List<ReplayOutput.Signal>>- Parameters:
depth- Remaining depth of output queue.
-
multi
public void multi(int count)Description copied from class:CommandOutputMark the beginning of a multi sequence (array).- Overrides:
multiin classCommandOutput<K,V,List<ReplayOutput.Signal>>- Parameters:
count- expected number of elements in this multi sequence.
-
replay
Replay all captured signals on aCommandOutput.- Parameters:
target- the targetCommandOutput.
-