Package org.apache.cassandra.auth
Class RoleOptions
java.lang.Object
org.apache.cassandra.auth.RoleOptions
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturn 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 presentReturn the string value of the hashed password option.getLogin()Return a boolean value of the login optionReturn a map of all the options which have been setReturn the string value of the password optionReturn a boolean value of the superuser optionbooleanisEmpty()Return true if there are no options with values set, false otherwisevoidsetOption(IRoleManager.Option option, Object value) Set a value for a specific option.toString()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.
-
Constructor Details
-
RoleOptions
public RoleOptions()
-
-
Method Details
-
setOption
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
Return a map of all the options which have been set- Returns:
- all options with values
-
getSuperuser
Return a boolean value of the superuser option- Returns:
- superuser option value
-
getLogin
Return a boolean value of the login option- Returns:
- login option value
-
getPassword
Return the string value of the password option- Returns:
- password option value
-
getHashedPassword
Return the string value of the hashed password option.- Returns:
- hashed password option value
-
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
-