Class AuthCallbackProxy

Object
com.tailf.dp.annotations.AuthCallbackProxy
All Implemented Interfaces:
DpAuthCallback

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

    • AuthCallbackProxy

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

    • getBackupObject

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

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

      public void addActionCapability(AuthCBType authCBType)
      Add action capability from annotated callType used to register capabilities on the server
      Parameters:
      authCBType - the authentication callback type to add
    • auth

      public boolean auth(DpAuthContext atx) throws DpCallbackException
      Delegates authentication callback to the registered POJO method.
      Specified by:
      auth in interface DpAuthCallback
      Parameters:
      atx - the authentication context
      Returns:
      true if authentication should succeed, false otherwise
      Throws:
      DpCallbackException - if the callback fails or is not implemented
    • getAuthCallbackProxys

      public static AuthCallbackProxy[] getAuthCallbackProxys(Object obj) throws DpCallbackException
      Get array of proxy objects from registered POJO callback. Used internally at callback registration
      Parameters:
      obj - the registered callback POJO
      Returns:
      array of authentication callback proxies
      Throws:
      DpCallbackException - if method signatures don't match or annotation is invalid