Package io.lettuce.core
Class AclSetuserArgs
- java.lang.Object
-
- io.lettuce.core.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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AclSetuserArgs.Builder
Builder entry points forAclSetuserArgs
.
-
Constructor Summary
Constructors Constructor Description AclSetuserArgs()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AclSetuserArgs
addCategory(AclCategory category)
Adds all the commands in the specified category to the list of commands the user is able to execute.AclSetuserArgs
addCommand(CommandType command)
Adds this command to the list of the commands the user can call.AclSetuserArgs
addCommand(CommandType command, ProtocolKeyword subCommand)
Adds all the commands there are in the server.AclSetuserArgs
addHashedPassword(String hashedPassword)
Adds the specified hashed password to the list of user passwords.AclSetuserArgs
addPassword(String password)
Adds the specified clear text password as an hashed password in the list of the users passwords.AclSetuserArgs
allChannels()
Allows the user to access all the Pub/Sub channels.AclSetuserArgs
allCommands()
Adds all the commands there are in the server.AclSetuserArgs
allKeys()
Allows the user to access all the keys.<K,V>
voidbuild(CommandArgs<K,V> args)
Build command arguments and contribute arguments toCommandArgs
.AclSetuserArgs
channelPattern(String channelPattern)
Adds accessible channel pattern.AclSetuserArgs
keyPattern(String keyPattern)
Adds accessible key pattern.AclSetuserArgs
noCommands()
Removes all the commands the user can execute.AclSetuserArgs
nopass()
Sets the user as a "no password".AclSetuserArgs
off()
Set user inactive.AclSetuserArgs
on()
Set user active.AclSetuserArgs
removeCategory(AclCategory category)
Removes all the commands in the specified category to the list of commands the user is able to execute.AclSetuserArgs
removeCommand(CommandType command)
Removes this command to the list of the commands the user can call.AclSetuserArgs
removeCommand(CommandType command, ProtocolKeyword subCommand)
Removes the specified command to the list of the commands the user can execute.AclSetuserArgs
removeHashedPassword(String hashedPassword)
Removes the specified hashed password to the list of user passwords.AclSetuserArgs
removePassword(String password)
Removes the specified clear text password as an hashed password in the list of the users passwords.AclSetuserArgs
reset()
Removes any capability from the user.AclSetuserArgs
resetChannels()
Removes all channel patterns from the list of Pub/Sub channel patterns the user can access.AclSetuserArgs
resetKeys()
Removes all the key patterns from the list of key patterns the user can access.AclSetuserArgs
resetpass()
Flushes the list of allowed passwords and removes the "no password" status.
-
-
-
Method Detail
-
on
public AclSetuserArgs on()
Set user active.- Returns:
this
-
off
public AclSetuserArgs off()
Set user inactive.- Returns:
this
-
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
-
addCommand
public AclSetuserArgs addCommand(CommandType command, ProtocolKeyword subCommand)
Adds all the commands there are in the server.- 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 commandsubCommand
- 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 asnopass()
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 toCommandArgs
.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 interfaceCompositeArgument
- Type Parameters:
K
- Key type.V
- Value type.- Parameters:
args
- the command arguments, must not benull
.
-
-