Class EventHandler

java.lang.Object
com.azure.communication.callautomation.EventHandler

public final class EventHandler extends Object
Event handler for taking care of event related tasks.
  • Constructor Details

    • EventHandler

      public EventHandler()
  • Method Details

    • parseEventList

      public static List<CallAutomationEventBase> parseEventList(String requestBody)
      Returns a list of events from request's body.
      Parameters:
      requestBody - Body of the event request.
      Returns:
      a list of CallAutomationEventBase
      Throws:
      RuntimeException - Any exceptions occurs at runtime.
    • parseEvent

      public static CallAutomationEventBase parseEvent(String requestBody)
      Returns the first(or the only) event of request's body.
      Parameters:
      requestBody - Body of the event request.
      Returns:
      the first(or the only) event if request is not empty, otherwise null is returned.
      Throws:
      RuntimeException - Any exceptions occurs at runtime.