Class ExampleAnnotationBasedMethodInvocationAuthorizer
java.lang.Object
org.apache.geode.examples.security.ExampleAnnotationBasedMethodInvocationAuthorizer
- All Implemented Interfaces:
MethodInvocationAuthorizer
public class ExampleAnnotationBasedMethodInvocationAuthorizer
extends Object
implements MethodInvocationAuthorizer
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanExecutes the authorization logic to determine whether themethodis allowed to be executed on thetargetobject instance.voidinitialize(Cache cache, Set<String> parameters)
-
Constructor Details
-
ExampleAnnotationBasedMethodInvocationAuthorizer
public ExampleAnnotationBasedMethodInvocationAuthorizer()
-
-
Method Details
-
initialize
Description copied from interface:MethodInvocationAuthorizerInitializes the MethodInvocationAuthorizer using aCacheand aSetofStringparameters.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:
initializein interfaceMethodInvocationAuthorizer- Parameters:
cache- theCacheto which the MethodInvocationAuthorizer will belongparameters- aSetofStringthat will be used to configure the
-
authorize
Description copied from interface:MethodInvocationAuthorizerExecutes the authorization logic to determine whether themethodis allowed to be executed on thetargetobject 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:
authorizein interfaceMethodInvocationAuthorizer- Parameters:
method- theMethodthat should be authorized.target- theObjecton which theMethodwill be executed.- Returns:
trueif the method is annotated withExampleAnnotationBasedMethodInvocationAuthorizer.Authorizedand not permanently forbidden,falseotherwise
-