Package org.apache.cassandra.auth
Class FunctionResource
java.lang.Object
org.apache.cassandra.auth.FunctionResource
- All Implemented Interfaces:
IResource
IResource implementation representing functions.
The root level "functions" resource represents the collection of all Functions.
"functions" - root level resource representing all functions defined across every keyspace
"functions/keyspace" - keyspace level resource to apply permissions to all functions within a keyspace
"functions/keyspace/function" - a specific function, scoped to a given keyspace
-
Method Summary
Modifier and TypeMethodDescriptionReturns the set of Permissions that may be applied to this resource Certain permissions are not applicable to particular types of resources.intbooleanbooleanexists()static FunctionResourceParses a resource name into a FunctionResource instance.static FunctionResourcefunction(String keyspace, String name, List<AbstractType<?>> argTypes) Creates a FunctionResource representing a specific, keyspace-scoped function.static FunctionResourcefunction(UserFunction function) static FunctionResourcefunctionFromCql(String keyspace, String name, List<CQL3Type.Raw> argTypes) Creates a FunctionResource representing a specific, keyspace-scoped function.static FunctionResourcefunctionFromCql(FunctionName name, List<CQL3Type.Raw> argTypes) Get the name of the keyspace this resource relates to.getName()Gets next resource in the hierarchy.inthashCode()booleanIndicates whether or not this resource has a parent in the hierarchy.static FunctionResourceCreates a FunctionResource representing the collection of functions scoped to a specific keyspace.static FunctionResourceroot()toString()
-
Method Details
-
root
- Returns:
- the root-level resource.
-
keyspace
Creates a FunctionResource representing the collection of functions scoped to a specific keyspace.- Parameters:
keyspace- name of the keyspace- Returns:
- FunctionResource instance representing all of the keyspace's functions
-
function
public static FunctionResource function(String keyspace, String name, List<AbstractType<?>> argTypes) Creates a FunctionResource representing a specific, keyspace-scoped function.- Parameters:
keyspace- the keyspace in which the function is scopedname- name of the function.argTypes- the types of the arguments to the function- Returns:
- FunctionResource instance reresenting the function.
-
function
-
functionFromCql
public static FunctionResource functionFromCql(String keyspace, String name, List<CQL3Type.Raw> argTypes) Creates a FunctionResource representing a specific, keyspace-scoped function. This variant is used to create an instance during parsing of a CQL statement. It includes transposition of the arg types from CQL types to AbstractType implementations- Parameters:
keyspace- the keyspace in which the function is scopedname- name of the function.argTypes- the types of the function arguments in raw CQL form- Returns:
- FunctionResource instance reresenting the function.
-
functionFromCql
-
fromName
Parses a resource name into a FunctionResource instance. A valid resource name for function should be in the follow format: functions/KEYSPACE/FUNCTION_NAME[FUNCTION_ARGS] Note that 1. FUNCTION_NAME could contain any character due to the use of quoted text in CQL. 2. FUNCTION_ARGS could be empty. If it is not empty, it is expressed in this format: FUNCTION_ARG1^FUNCTION_ARG2... where ^ is the delimiter for arguments- Parameters:
name- Name of the function resource.- Returns:
- FunctionResource instance matching the name.
-
getName
-
getKeyspace
Get the name of the keyspace this resource relates to. In the case of the global root resource, return null- Returns:
- the keyspace name of this resource, or null for the root resource
-
getFunctionName
- Returns:
- a qualified FunctionName instance for a function-level resource. Throws IllegalStateException if called on the resource which doens't represent a single function.
-
getParent
Description copied from interface:IResourceGets next resource in the hierarchy. Call hasParent first to make sure there is one. -
hasParent
public boolean hasParent()Description copied from interface:IResourceIndicates whether or not this resource has a parent in the hierarchy. Please perform this check before calling getParent() method. -
exists
public boolean exists() -
applicablePermissions
Description copied from interface:IResourceReturns the set of Permissions that may be applied to this resource Certain permissions are not applicable to particular types of resources. For instance, it makes no sense to talk about CREATE permission on table, or SELECT on a Role. Here we filter a set of permissions depending on the specific resource they're being applied to. This is necessary because the CQL syntax supports ALL as wildcard, but the set of permissions that should resolve to varies by IResource.- Specified by:
applicablePermissionsin interfaceIResource- Returns:
- the permissions that may be granted on the specific resource
-
compareTo
-
toString
-
equals
-
hashCode
public int hashCode()
-