public class AuthorizationCallbackProxy extends Object implements DpAuthorizationCallback
DpAuthorizationCallback
interface and delegates calls
to the registered callback POJO with annotated methodsM_CHECK_CMD_ACCESS, M_CHECK_DATA_ACCESS
Constructor and Description |
---|
AuthorizationCallbackProxy(Object backupObject)
Constructor for Callback proxys.
|
Modifier and Type | Method and Description |
---|---|
void |
addActionCapability(AuthorizationCBType authorizationCBType)
Add action capability from annotated callType used to register
capabilities on the server
|
void |
addActionMethod(String name,
Method method)
Add callback action method to proxy
|
AuthorizationResult |
checkCommandAccess(DpAuthorizationContext context,
String[] commandTokens,
AuthorizationOperCheck operation)
This callback is invoked for command authorization, i.e.
|
AuthorizationResult |
checkDataAccess(DpAuthorizationContext context,
ConfObject[] kp,
AuthorizationOperCheck operation,
AuthorizationOperCheck how) |
EnumSet<AuthorizationOperCheck> |
commandFilter()
Thus method can be used to prevent access checks from causing invocation
of a checkCommandAccess callback even though it is registered.
|
EnumSet<AuthorizationOperCheck> |
dataFilter()
Thus method can be used to prevent access checks from causing invocation
of a checkDataAccess callback even though it is registered.
|
static AuthorizationCallbackProxy[] |
getAuthorizationCallbackProxys(Object obj)
Get array of proxy objects from registered POJO callback.
|
Object |
getBackupObject()
Retrieve the callback POJO
|
int |
mask()
Mask of flags for each method that is supported by this callback:
DpAuthorizationCallback.M_CHECK_CMD_ACCESS
DpAuthorizationCallback.M_CHECK_DATA_ACCESS
|
public AuthorizationCallbackProxy(Object backupObject)
backupObject
- registered callback POJOpublic Object getBackupObject()
public void addActionMethod(String name, Method method)
name
- canonical action namemethod
- registered callback methodpublic void addActionCapability(AuthorizationCBType authorizationCBType)
authorizationCBType
- action typepublic int mask()
DpAuthorizationCallback
mask
in interface DpAuthorizationCallback
public AuthorizationResult checkCommandAccess(DpAuthorizationContext context, String[] commandTokens, AuthorizationOperCheck operation) throws DpCallbackException
DpAuthorizationCallback
checkCommandAccess
in interface DpAuthorizationCallback
context
- the authorization contextcommandTokens
- command represented as a string of tokensoperation
- AuthorizationOperCheck describing the operatopn typeDpCallbackException
public AuthorizationResult checkDataAccess(DpAuthorizationContext context, ConfObject[] kp, AuthorizationOperCheck operation, AuthorizationOperCheck how) throws DpCallbackException
checkDataAccess
in interface DpAuthorizationCallback
context
- the authorization contextkp
- the data element represented by an array of ConfObjectoperation
- AuthorizationOperCheck describing the operatopn typehow
- checking state INTERMEDIATE or FINALDpCallbackException
public EnumSet<AuthorizationOperCheck> commandFilter()
DpAuthorizationCallback
commandFilter
in interface DpAuthorizationCallback
public EnumSet<AuthorizationOperCheck> dataFilter()
DpAuthorizationCallback
dataFilter
in interface DpAuthorizationCallback
public static AuthorizationCallbackProxy[] getAuthorizationCallbackProxys(Object obj) throws DpCallbackException
obj
- registered Callback POJODpCallbackException