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
ConstructorsConstructorDescriptionAuthorizationCallbackProxy(Object backupObject) Constructor for Callback proxys. - 
Method Summary
Modifier and TypeMethodDescriptionvoidaddActionCapability(AuthorizationCBType authorizationCBType) Add action capability from annotated callType used to register capabilities on the servervoidaddActionMethod(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) This callback is invoked for data authorization, i.e.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 POJOintmask()Mask of flags for each method that is supported by this callback:DpAuthorizationCallback.M_CHECK_CMD_ACCESSDpAuthorizationCallback.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:DpAuthorizationCallbackMask of flags for each method that is supported by this callback:- Specified by:
 maskin interfaceDpAuthorizationCallback- Returns:
 - bitmask indicating which callback methods are supported
 
 - 
checkCommandAccess
public AuthorizationResult checkCommandAccess(DpAuthorizationContext context, String[] commandTokens, AuthorizationOperCheck operation) throws DpCallbackException Description copied from interface:DpAuthorizationCallbackThis callback is invoked for command authorization, i.e. it corresponds to the rules under /nacm/rule-list in the NACM 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:
 checkCommandAccessin interfaceDpAuthorizationCallback- Parameters:
 context- the authorization contextcommandTokens- command represented as a string of tokensoperation- AuthorizationOperCheck describing the operatopn type- Returns:
 - AuthorizationResult the command access result
 - Throws:
 DpCallbackException- if an error occurs during the callback
 - 
checkDataAccess
public AuthorizationResult checkDataAccess(DpAuthorizationContext context, ConfObject[] kp, AuthorizationOperCheck operation, AuthorizationOperCheck how) throws DpCallbackException Description copied from interface:DpAuthorizationCallbackThis callback is invoked for data authorization, i.e. it corresponds to the rules under /nacm/rule-list in the NACM data model. The keypath parameter gives the data element path corresponding to the keypath leaf in the datarule list, and the operation parameter gives the operation type. The how parameter indicates whether the check is an intermediate or final check.- Specified by:
 checkDataAccessin interfaceDpAuthorizationCallback- Parameters:
 context- the authorization contextkp- the data element represented by an array of ConfObjectoperation- AuthorizationOperCheck describing the operation typehow- checking state INTERMEDIATE or FINAL- Returns:
 - AuthorizationResult the data access result
 - Throws:
 DpCallbackException- if an error occurs during the callback
 - 
commandFilter
Description copied from interface:DpAuthorizationCallbackThus 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:
 commandFilterin interfaceDpAuthorizationCallback- Returns:
 - EnumSet of AuthorizationOperCheck values
 
 - 
dataFilter
Description copied from interface:DpAuthorizationCallbackThus 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:
 dataFilterin 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
 
 -