Package org.apache.cassandra.auth
Class RoleOptions
- java.lang.Object
-
- org.apache.cassandra.auth.RoleOptions
-
public class RoleOptions extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description RoleOptions()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Optional<java.util.Map<java.lang.String,java.lang.String>>getCustomOptions()Return aMap<String, String>representing custom options It is the responsiblity of IRoleManager implementations which support IRoleManager.Option.OPTION to handle type checking and conversion of these values, if presentjava.util.Optional<java.lang.String>getHashedPassword()Return the string value of the hashed password option.java.util.Optional<java.lang.Boolean>getLogin()Return a boolean value of the login optionjava.util.Map<IRoleManager.Option,java.lang.Object>getOptions()Return a map of all the options which have been setjava.util.Optional<java.lang.String>getPassword()Return the string value of the password optionjava.util.Optional<java.lang.Boolean>getSuperuser()Return a boolean value of the superuser optionbooleanisEmpty()Return true if there are no options with values set, false otherwisevoidsetOption(IRoleManager.Option option, java.lang.Object value)Set a value for a specific option.java.lang.StringtoString()voidvalidate()Validate the contents of the options in two ways: - Ensure that only a subset of the options supported by the configured IRoleManager are set - Validate the type of any option values present.
-
-
-
Method Detail
-
setOption
public void setOption(IRoleManager.Option option, java.lang.Object value)
Set a value for a specific option. Throws SyntaxException if the same option is set multiple times- Parameters:
option-value-
-
isEmpty
public boolean isEmpty()
Return true if there are no options with values set, false otherwise- Returns:
- whether any options have values set or not
-
getOptions
public java.util.Map<IRoleManager.Option,java.lang.Object> getOptions()
Return a map of all the options which have been set- Returns:
- all options with values
-
getSuperuser
public java.util.Optional<java.lang.Boolean> getSuperuser()
Return a boolean value of the superuser option- Returns:
- superuser option value
-
getLogin
public java.util.Optional<java.lang.Boolean> getLogin()
Return a boolean value of the login option- Returns:
- login option value
-
getPassword
public java.util.Optional<java.lang.String> getPassword()
Return the string value of the password option- Returns:
- password option value
-
getHashedPassword
public java.util.Optional<java.lang.String> getHashedPassword()
Return the string value of the hashed password option.- Returns:
- hashed password option value
-
getCustomOptions
public java.util.Optional<java.util.Map<java.lang.String,java.lang.String>> getCustomOptions()
Return aMap<String, String>representing custom options It is the responsiblity of IRoleManager implementations which support IRoleManager.Option.OPTION to handle type checking and conversion of these values, if present- Returns:
- map of custom options
-
validate
public void validate()
Validate the contents of the options in two ways: - Ensure that only a subset of the options supported by the configured IRoleManager are set - Validate the type of any option values present. Should either condition fail, then InvalidRequestException is thrown. This method is called during validation of CQL statements, so the IRE results in a error response to the client.- Throws:
InvalidRequestException- if any options which are not supported by the configured IRoleManager are set or if any option value is of an incorrect type.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-