Class AuthorizationCallbackProxy

Object
com.tailf.dp.annotations.AuthorizationCallbackProxy
All Implemented Interfaces:
DpAuthorizationCallback

public class AuthorizationCallbackProxy extends Object implements DpAuthorizationCallback
Callback proxy for Authorization Callbacks. Implements the DpAuthorizationCallback interface and delegates calls to the registered callback POJO with annotated methods
  • Constructor Details

    • AuthorizationCallbackProxy

      public AuthorizationCallbackProxy(Object backupObject)
      Constructor for Callback proxys. Used internally.
      Parameters:
      backupObject - registered callback POJO
  • Method Details

    • getBackupObject

      public Object getBackupObject()
      Retrieve the callback POJO
      Returns:
      Object registered callback object
    • addActionMethod

      public void addActionMethod(String name, Method method)
      Add callback action method to proxy
      Parameters:
      name - canonical action name
      method - registered callback method
    • addActionCapability

      public void addActionCapability(AuthorizationCBType authorizationCBType)
      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 interface DpAuthorizationCallback
      Returns:
      bitmask indicating which callback methods are supported
    • 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 /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:
      checkCommandAccess in interface DpAuthorizationCallback
      Parameters:
      context - the authorization context
      commandTokens - command represented as a string of tokens
      operation - AuthorizationOperCheck describing the operatopn type
      Returns:
      AuthorizationResult the command access result
      Throws:
      DpCallbackException - if an error occurs during the callback
    • checkDataAccess

      Description copied from interface: DpAuthorizationCallback
      This 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:
      checkDataAccess in interface DpAuthorizationCallback
      Parameters:
      context - the authorization context
      kp - the data element represented by an array of ConfObject
      operation - AuthorizationOperCheck describing the operation type
      how - checking state INTERMEDIATE or FINAL
      Returns:
      AuthorizationResult the data access result
      Throws:
      DpCallbackException - if an error occurs during the callback
    • commandFilter

      public EnumSet<AuthorizationOperCheck> 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 interface DpAuthorizationCallback
      Returns:
      EnumSet of AuthorizationOperCheck values
    • dataFilter

      public EnumSet<AuthorizationOperCheck> 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 interface DpAuthorizationCallback
      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