Module lettuce.core

Class KillArgs

java.lang.Object
io.lettuce.core.KillArgs
All Implemented Interfaces:
CompositeArgument

public class KillArgs
extends Object
implements CompositeArgument
Argument list builder for the Redis CLIENT KILL command. Static import the methods from KillArgs.Builder and chain the method calls: id(1).skipme().

KillArgs is a mutable object and instances should be used only once to avoid shared mutable state.

Since:
3.0
Author:
Mark Paluch, dengliming
  • Nested Class Summary

    Nested Classes
    Modifier and Type Class Description
    static class  KillArgs.Builder
    Builder entry points for KillArgs.
  • Constructor Summary

    Constructors
    Constructor Description
    KillArgs()  
  • Method Summary

    Modifier and Type Method Description
    KillArgs addr​(String addr)
    Kill the client at addr (Remote Address).
    <K,​ V> void build​(CommandArgs<K,​V> args)
    Build command arguments and contribute arguments to CommandArgs.
    KillArgs id​(long id)
    Kill the client with its client id.
    KillArgs laddr​(String laddr)
    Kill the client at laddr (Local Address).
    KillArgs skipme()
    By default this option is enabled, that is, the client calling the command will not get killed, however setting this option to no will have the effect of also killing the client calling the command.
    KillArgs skipme​(boolean state)
    By default this option is enabled, that is, the client calling the command will not get killed, however setting this option to no will have the effect of also killing the client calling the command.
    KillArgs type​(io.lettuce.core.KillArgs.Type type)
    This closes the connections of all the clients in the specified KillArgs.Type.
    KillArgs user​(String username)
    Closes all the connections that are authenticated with the specified ACL username.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • KillArgs

      public KillArgs()
  • Method Details

    • skipme

      public KillArgs skipme()
      By default this option is enabled, that is, the client calling the command will not get killed, however setting this option to no will have the effect of also killing the client calling the command.
      Returns:
      this MigrateArgs.
    • skipme

      public KillArgs skipme​(boolean state)
      By default this option is enabled, that is, the client calling the command will not get killed, however setting this option to no will have the effect of also killing the client calling the command.
      Parameters:
      state -
      Returns:
      this KillArgs.
    • addr

      public KillArgs addr​(String addr)
      Kill the client at addr (Remote Address).
      Parameters:
      addr - must not be null.
      Returns:
      this KillArgs.
    • laddr

      public KillArgs laddr​(String laddr)
      Kill the client at laddr (Local Address).
      Parameters:
      laddr - must not be null.
      Returns:
      this KillArgs.
      Since:
      6.1
    • id

      public KillArgs id​(long id)
      Kill the client with its client id.
      Parameters:
      id -
      Returns:
      this KillArgs.
    • type

      public KillArgs type​(io.lettuce.core.KillArgs.Type type)
      This closes the connections of all the clients in the specified KillArgs.Type. Note that clients blocked into the MONITOR command are considered to belong to the normal class.
      Parameters:
      type - must not be null.
      Returns:
      this KillArgs.
    • user

      public KillArgs user​(String username)
      Closes all the connections that are authenticated with the specified ACL username.
      Parameters:
      username - must not be null.
      Returns:
      this KillArgs.
      Since:
      6.1
    • build

      public <K,​ V> void build​(CommandArgs<K,​V> args)
      Description copied from interface: CompositeArgument
      Build command arguments and contribute arguments to CommandArgs.

      Implementing classes are required to implement this method. Depending on the command nature and configured arguments, this method may contribute arguments but is not required to add arguments if none are specified.

      Specified by:
      build in interface CompositeArgument
      Type Parameters:
      K - Key type.
      V - Value type.
      Parameters:
      args - the command arguments, must not be null.