Package io.lettuce.core.output
Class ReplayOutput<K,V>
- 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>>
ReplayableCommandOutput
capturing output signals to replay these on a targetCommandOutput
. 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 class
ReplayOutput.BulkString
static class
ReplayOutput.ErrorBytes
static class
ReplayOutput.Signal
Encapsulates 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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
complete(int depth)
Mark the command output complete.void
multi(int count)
Mark the beginning of a multi sequence (array).void
replay(CommandOutput<?,?,?> target)
Replay all captured signals on aCommandOutput
.void
set(long integer)
Update the command output with a 64-bit signed integer.void
set(ByteBuffer bytes)
Update the command output with a sequence of bytes, ornull
.void
setError(String error)
Set command output to an error message from the client.void
setError(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
-
-
-
-
Method Detail
-
set
public void set(ByteBuffer bytes)
Description copied from class:CommandOutput
Update the command output with a sequence of bytes, ornull
. ConcreteCommandOutput
implementations must override this method to decodebulk
/bytes response values.- Overrides:
set
in classCommandOutput<K,V,List<ReplayOutput.Signal>>
- Parameters:
bytes
- The command output, or null.
-
set
public void set(long integer)
Description copied from class:CommandOutput
Update the command output with a 64-bit signed integer. ConcreteCommandOutput
implementations must override this method to decodenumber
(integer) response values.- Overrides:
set
in classCommandOutput<K,V,List<ReplayOutput.Signal>>
- Parameters:
integer
- The command output.
-
setError
public void setError(ByteBuffer error)
Description copied from class:CommandOutput
Set command output to an error message from the server.- Overrides:
setError
in classCommandOutput<K,V,List<ReplayOutput.Signal>>
- Parameters:
error
- Error message.
-
setError
public void setError(String error)
Description copied from class:CommandOutput
Set command output to an error message from the client.- Overrides:
setError
in classCommandOutput<K,V,List<ReplayOutput.Signal>>
- Parameters:
error
- Error message.
-
complete
public void complete(int depth)
Description copied from class:CommandOutput
Mark the command output complete.- Overrides:
complete
in classCommandOutput<K,V,List<ReplayOutput.Signal>>
- Parameters:
depth
- Remaining depth of output queue.
-
multi
public void multi(int count)
Description copied from class:CommandOutput
Mark the beginning of a multi sequence (array).- Overrides:
multi
in classCommandOutput<K,V,List<ReplayOutput.Signal>>
- Parameters:
count
- expected number of elements in this multi sequence.
-
replay
public void replay(CommandOutput<?,?,?> target)
Replay all captured signals on aCommandOutput
.- Parameters:
target
- the targetCommandOutput
.
-
-