Class RoleOptions

java.lang.Object
org.apache.cassandra.auth.RoleOptions

public class RoleOptions extends Object
  • Constructor Details

    • RoleOptions

      public RoleOptions()
  • Method Details

    • setOption

      public void setOption(IRoleManager.Option option, 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 Map<IRoleManager.Option,Object> getOptions()
      Return a map of all the options which have been set
      Returns:
      all options with values
    • getSuperuser

      public Optional<Boolean> getSuperuser()
      Return a boolean value of the superuser option
      Returns:
      superuser option value
    • getLogin

      public Optional<Boolean> getLogin()
      Return a boolean value of the login option
      Returns:
      login option value
    • getPassword

      public Optional<String> getPassword()
      Return the string value of the password option
      Returns:
      password option value
    • getHashedPassword

      public Optional<String> getHashedPassword()
      Return the string value of the hashed password option.
      Returns:
      hashed password option value
    • getCustomOptions

      public Optional<Map<String,String>> getCustomOptions()
      Return a Map<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 String toString()
      Overrides:
      toString in class Object