public class DummyAuthorization extends java.lang.Object implements AccessControl
AccessControl interface that allows authorization depending
on the format of the Principal string.| Modifier and Type | Field and Description |
|---|---|
static OperationContext.OperationCode[] |
READER_OPS |
static OperationContext.OperationCode[] |
WRITER_OPS |
| Constructor and Description |
|---|
DummyAuthorization() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
authorizeOperation(java.lang.String regionName,
OperationContext context)
Check if the given operation is allowed for the cache/region.
|
void |
close()
Called when the region containing this callback is closed or destroyed, when the cache is
closed, or when a callback is removed from a region using an
AttributesMutator. |
static AccessControl |
create() |
void |
init(java.security.Principal principal,
DistributedMember remoteMember,
Cache cache)
Initialize the callback for a client/peer having the given principal.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitinit, initinit, initializepublic static final OperationContext.OperationCode[] READER_OPS
public static final OperationContext.OperationCode[] WRITER_OPS
public static AccessControl create()
public void init(java.security.Principal principal,
DistributedMember remoteMember,
Cache cache)
throws NotAuthorizedException
AccessControlauthorizeOperation in each operation.init in interface AccessControlprincipal - the principal associated with the authenticated client or peer; a null
principal implies an unauthenticated client which should be handled properly by
implementationsremoteMember - the DistributedMember object for the remote authenticated client or
peercache - reference to the cache objectNotAuthorizedException - if some exception condition happens during the initialization;
in such a case all subsequent client operations on that connection will throw
NotAuthorizedExceptionpublic boolean authorizeOperation(java.lang.String regionName,
OperationContext context)
AccessControlinit call made
when the connection was established so that this call is as quick as possible.authorizeOperation in interface AccessControlregionName - When null then it indicates a cache-level operation (i.e. one of
OperationContext.OperationCode.REGION_DESTROY
or OperationContext.OperationCode.QUERY, else
the name of the region for the operation.context - When invoked before the operation then the data required by the operation. When
invoked as a post-process filter then it contains the result of the operation. The data
in the context can be possibly modified by the method.public void close()
CacheCallbackAttributesMutator.
Implementations should cleanup any external resources such as database connections. Any runtime exceptions this method throws will be logged.
It is possible for this method to be called multiple times on a single callback instance, so implementations must be tolerant of this.
close in interface CacheCallbackRegionService.close(),
Region.close(),
Region.localDestroyRegion(),
Region.destroyRegion(),
AttributesMutator