Class EventCallbackProxy

Object
com.tailf.ncs.annotations.EventCallbackProxy
All Implemented Interfaces:
NavuEventCallback

public class EventCallbackProxy extends Object implements NavuEventCallback
Callback proxy for annotated NavuEventCallback methods This class is used internally be the NavuEventHandler.registerAnnotatedCallbacks to be able to invoke (by reflection) the annotated callback method
  • Constructor Details

    • EventCallbackProxy

      public EventCallbackProxy(Object backupObject, String deviceName, String subscriptionName)
      Constructor for Callback proxys. Used internally.
      Parameters:
      backupObject - registered callback POJO
      deviceName -
      subscriptionName -
  • Method Details

    • getBackupObject

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

      public String getDeviceName()
      Retrieve the callback deviceName
      Returns:
      deviceName string
    • getSubscriptionName

      public String getSubscriptionName()
      Retrieve the callback deviceName
      Returns:
      deviceName string
    • 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(EventCBType eventCBType)
      Add action capability from annotated callType used to register capabilities on the server
      Parameters:
      eventCBType - action type
    • notifReceived

      public void notifReceived(NavuContainer event) throws NcsException
      Description copied from interface: NavuEventCallback
      This callback method is received to each cdb notification that correspond to the annotated deviceName and subscription name. Note, that a "*" as name implies wildcard - that any name will match. The method get as parameter the event in a NavuContainer
      Specified by:
      notifReceived in interface NavuEventCallback
      Throws:
      NcsException
    • getEventCallbackProxys

      public static EventCallbackProxy[] getEventCallbackProxys(Object obj) throws NcsException
      Get array of proxy objects from registered POJO callback. Used internally at callback registration
      Parameters:
      obj - registered Callback POJO
      Returns:
      array of EventCallbackProxy
      Throws:
      NcsException