Gemfire JavaDocs
Class ExampleAnnotationBasedMethodInvocationAuthorizer
- java.lang.Object
-
- org.apache.geode.examples.security.ExampleAnnotationBasedMethodInvocationAuthorizer
-
- All Implemented Interfaces:
MethodInvocationAuthorizer
public class ExampleAnnotationBasedMethodInvocationAuthorizer extends java.lang.Object implements MethodInvocationAuthorizer
-
-
Constructor Summary
Constructors Constructor Description ExampleAnnotationBasedMethodInvocationAuthorizer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
authorize(java.lang.reflect.Method method, java.lang.Object target)
Executes the authorization logic to determine whether themethod
is allowed to be executed on thetarget
object instance.void
initialize(Cache cache, java.util.Set<java.lang.String> parameters)
-
-
-
Method Detail
-
initialize
public void initialize(Cache cache, java.util.Set<java.lang.String> parameters)
Description copied from interface:MethodInvocationAuthorizer
Initializes the MethodInvocationAuthorizer using aCache
and aSet
ofString
parameters.This method exists to allow user-specified method authorizers to be configured and used at runtime. If this method is not overridden in a user-specified authorizer then that authorizer will not be configurable.
- Specified by:
initialize
in interfaceMethodInvocationAuthorizer
- Parameters:
cache
- theCache
to which the MethodInvocationAuthorizer will belongparameters
- aSet
ofString
that will be used to configure the
-
authorize
public boolean authorize(java.lang.reflect.Method method, java.lang.Object target)
Description copied from interface:MethodInvocationAuthorizer
Executes the authorization logic to determine whether themethod
is allowed to be executed on thetarget
object instance.Implementation Note: the query engine will remember whether the method invocation has been already authorized or not for the current query context, so this method will be called once in the lifetime of a query for every new method seen while traversing the objects. Nevertheless, the implementation should be lighting fast as it will be called by the OQL engine in runtime during the query execution.
- Specified by:
authorize
in interfaceMethodInvocationAuthorizer
- Parameters:
method
- theMethod
that should be authorized.target
- theObject
on which theMethod
will be executed.- Returns:
true
if the method is annotated withExampleAnnotationBasedMethodInvocationAuthorizer.Authorized
and not permanently forbidden,false
otherwise
-
-