Package com.tailf.dp.annotations
Class AuthorizationCallbackProxy
Object
com.tailf.dp.annotations.AuthorizationCallbackProxy
- All Implemented Interfaces:
DpAuthorizationCallback
Callback proxy for Authorization Callbacks.
Implements the
DpAuthorizationCallback
interface and delegates calls
to the registered callback POJO with annotated methods-
Field Summary
Fields inherited from interface com.tailf.dp.DpAuthorizationCallback
M_CHECK_CMD_ACCESS, M_CHECK_DATA_ACCESS
-
Constructor Summary
ConstructorDescriptionAuthorizationCallbackProxy
(Object backupObject) Constructor for Callback proxys. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addActionCapability
(AuthorizationCBType authorizationCBType) Add action capability from annotated callType used to register capabilities on the servervoid
addActionMethod
(String name, Method method) Add callback action method to proxycheckCommandAccess
(DpAuthorizationContext context, String[] commandTokens, AuthorizationOperCheck operation) This callback is invoked for command authorization, i.e.checkDataAccess
(DpAuthorizationContext context, ConfObject[] kp, AuthorizationOperCheck operation, AuthorizationOperCheck how) Thus method can be used to prevent access checks from causing invocation of a checkCommandAccess callback even though it is registered.Thus method can be used to prevent access checks from causing invocation of a checkDataAccess callback even though it is registered.static AuthorizationCallbackProxy[]
Get array of proxy objects from registered POJO callback.Retrieve the callback POJOint
mask()
Mask of flags for each method that is supported by this callback:DpAuthorizationCallback.M_CHECK_CMD_ACCESS
DpAuthorizationCallback.M_CHECK_DATA_ACCESS
-
Constructor Details
-
AuthorizationCallbackProxy
Constructor for Callback proxys. Used internally.- Parameters:
backupObject
- registered callback POJO
-
-
Method Details
-
getBackupObject
Retrieve the callback POJO- Returns:
- Object registered callback object
-
addActionMethod
Add callback action method to proxy- Parameters:
name
- canonical action namemethod
- registered callback method
-
addActionCapability
Add action capability from annotated callType used to register capabilities on the server- Parameters:
authorizationCBType
- action type
-
mask
public int mask()Description copied from interface:DpAuthorizationCallback
Mask of flags for each method that is supported by this callback:- Specified by:
mask
in interfaceDpAuthorizationCallback
-
checkCommandAccess
public AuthorizationResult checkCommandAccess(DpAuthorizationContext context, String[] commandTokens, AuthorizationOperCheck operation) throws DpCallbackException Description copied from interface:DpAuthorizationCallback
This callback is invoked for command authorization, i.e. it corresponds to the rules under /aaa/authorization/cmdrules in the AAA data model. commandTokens is an String array of tokens representing the command to be checked, corresponding to the command leaf in the cmdrule list. If The operation parameter gives the operation, corresponding to the ops leaf in the cmdrule list.- Specified by:
checkCommandAccess
in interfaceDpAuthorizationCallback
- Parameters:
context
- the authorization contextcommandTokens
- command represented as a string of tokensoperation
- AuthorizationOperCheck describing the operatopn type- Returns:
- AuthorizationResult
- Throws:
DpCallbackException
-
checkDataAccess
public AuthorizationResult checkDataAccess(DpAuthorizationContext context, ConfObject[] kp, AuthorizationOperCheck operation, AuthorizationOperCheck how) throws DpCallbackException - Specified by:
checkDataAccess
in interfaceDpAuthorizationCallback
- Parameters:
context
- the authorization contextkp
- the data element represented by an array of ConfObjectoperation
- AuthorizationOperCheck describing the operatopn typehow
- checking state INTERMEDIATE or FINAL- Returns:
- AuthorizationResult
- Throws:
DpCallbackException
-
commandFilter
Description copied from interface:DpAuthorizationCallback
Thus method can be used to prevent access checks from causing invocation of a checkCommandAccess callback even though it is registered. If we do not want any filtering this method should not be registered or return null. For checkCommandAccess callback values INTERMEDIATE and FINAL does not contain any meaning.- Specified by:
commandFilter
in interfaceDpAuthorizationCallback
- Returns:
- EnumSet of AuthorizationOperCheck values
-
dataFilter
Description copied from interface:DpAuthorizationCallback
Thus method can be used to prevent access checks from causing invocation of a checkDataAccess callback even though it is registered. If we do not want any filtering this method should not be registered or return null.- Specified by:
dataFilter
in interfaceDpAuthorizationCallback
- Returns:
- EnumSet of AuthorizationOperCheck values
-
getAuthorizationCallbackProxys
public static AuthorizationCallbackProxy[] getAuthorizationCallbackProxys(Object obj) throws DpCallbackException Get array of proxy objects from registered POJO callback. Used internally at callback registration- Parameters:
obj
- registered Callback POJO- Returns:
- array of DBCallbackProxy
- Throws:
DpCallbackException
-