Class AclSetuserArgs

  • All Implemented Interfaces:
    CompositeArgument

    public class AclSetuserArgs
    extends Object
    implements CompositeArgument
    Argument list builder for the Redis ACL SETUSER command.

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

    Since:
    6.1
    Author:
    Mikhael Sokolov, Rohan Nagar
    • Constructor Detail

      • AclSetuserArgs

        public AclSetuserArgs()
    • Method Detail

      • keyPattern

        public AclSetuserArgs keyPattern​(String keyPattern)
        Adds accessible key pattern.
        Parameters:
        keyPattern - accessible key pattern
        Returns:
        this
      • allKeys

        public AclSetuserArgs allKeys()
        Allows the user to access all the keys.
        Returns:
        this
      • resetKeys

        public AclSetuserArgs resetKeys()
        Removes all the key patterns from the list of key patterns the user can access.
        Returns:
        this
      • channelPattern

        public AclSetuserArgs channelPattern​(String channelPattern)
        Adds accessible channel pattern.
        Parameters:
        channelPattern - accessible channel pattern
        Returns:
        this
      • allChannels

        public AclSetuserArgs allChannels()
        Allows the user to access all the Pub/Sub channels.
        Returns:
        this
      • resetChannels

        public AclSetuserArgs resetChannels()
        Removes all channel patterns from the list of Pub/Sub channel patterns the user can access.
        Returns:
        this
      • addCommand

        public AclSetuserArgs addCommand​(CommandType command)
        Adds this command to the list of the commands the user can call.
        Parameters:
        command - accessible command
        Returns:
        this
      • allCommands

        public AclSetuserArgs allCommands()
        Adds all the commands there are in the server.
        Returns:
        this
      • removeCommand

        public AclSetuserArgs removeCommand​(CommandType command)
        Removes this command to the list of the commands the user can call.
        Parameters:
        command - inaccessible command
        Returns:
        this
      • removeCommand

        public AclSetuserArgs removeCommand​(CommandType command,
                                            ProtocolKeyword subCommand)
        Removes the specified command to the list of the commands the user can execute.
        Parameters:
        command - inaccessible command
        subCommand - inaccessible subcommand
        Returns:
        this
      • noCommands

        public AclSetuserArgs noCommands()
        Removes all the commands the user can execute.
        Returns:
        this
      • addCategory

        public AclSetuserArgs addCategory​(AclCategory category)
        Adds all the commands in the specified category to the list of commands the user is able to execute.
        Parameters:
        category - specified category
        Returns:
        this
      • removeCategory

        public AclSetuserArgs removeCategory​(AclCategory category)
        Removes all the commands in the specified category to the list of commands the user is able to execute.
        Parameters:
        category - specified category
        Returns:
        this
      • nopass

        public AclSetuserArgs nopass()
        Sets the user as a "no password".
        Returns:
        this
      • resetpass

        public AclSetuserArgs resetpass()
        Flushes the list of allowed passwords and removes the "no password" status. After resetting the password there is no way to authenticate as the user without adding some password (or setting it as nopass() later).
        Returns:
        this
      • addPassword

        public AclSetuserArgs addPassword​(String password)
        Adds the specified clear text password as an hashed password in the list of the users passwords.
        Parameters:
        password - clear text password
        Returns:
        this
      • addHashedPassword

        public AclSetuserArgs addHashedPassword​(String hashedPassword)
        Adds the specified hashed password to the list of user passwords.
        Parameters:
        hashedPassword - hashed password
        Returns:
        this
      • removePassword

        public AclSetuserArgs removePassword​(String password)
        Removes the specified clear text password as an hashed password in the list of the users passwords.
        Parameters:
        password - clear text password
        Returns:
        this
      • removeHashedPassword

        public AclSetuserArgs removeHashedPassword​(String hashedPassword)
        Removes the specified hashed password to the list of user passwords.
        Parameters:
        hashedPassword - hashed password
        Returns:
        this
      • reset

        public AclSetuserArgs reset()
        Removes any capability from the user.
        Returns:
        this
      • 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.