VMware GemFire Java API Reference
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 booleanauthorize(java.lang.reflect.Method method, java.lang.Object target)Executes the authorization logic to determine whether themethodis allowed to be executed on thetargetobject instance.voidinitialize(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: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
public boolean authorize(java.lang.reflect.Method method, java.lang.Object target)Description copied from interface:MethodInvocationAuthorizerExecutes the authorization logic to determine whether themethodis allowed to be executed on thetargetobject instance.Implementation Note: this method is called for every method invocation reached while traversing query results, for every target object seen, since the verdict may depend on the specific target instance (for example, per-
Regionaccess checks) and not solely on theMethodbeing invoked. The implementation should therefore be lightning fast, as it will be called by the OQL engine at runtime during 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
-
-