Class ActionEventQueue

java.lang.Object
org.deltafi.common.action.ActionEventQueue

public class ActionEventQueue extends Object
Service for pushing and popping action events to a redis queue.
  • Constructor Details

  • Method Details

    • putActions

      public void putActions(List<ActionInput> actionInputs, boolean checkUnique)
      Puts the given action inputs into the appropriate Redis queue(s). If the checkUnique parameter is set to true, this method will ensure that no other item with the same 'did' field value already exists in the queue before adding an action input. Note that checking for uniqueness is an expensive operation as it involves scanning the Redis set, which can be slow and resource-intensive, particularly for larger sets. Therefore, it's recommended to use this option only in requeue scenarios. If the conversion of an action input to JSON fails, the method will log an error and skip that input.
      Parameters:
      actionInputs - a list of action inputs to be queued
      checkUnique - if true, the method will check for uniqueness of 'did' field values before queuing an action input; if false, the method will queue all action inputs without checking for uniqueness
    • takeAction

      public ActionInput takeAction(String actionClassName) throws com.fasterxml.jackson.core.JsonProcessingException
      Request an ActionInput object from the ActionEvent queue for the specified action
      Parameters:
      actionClassName - Name of action for Action event request
      Returns:
      next Action on the queue for the given action name
      Throws:
      com.fasterxml.jackson.core.JsonProcessingException - if the incoming event cannot be serialized
    • putResult

      public void putResult(ActionEvent result, String returnAddress) throws com.fasterxml.jackson.core.JsonProcessingException
      Submit a result object for action processing
      Parameters:
      result - ActionEventInput object for the result to be posted to the action queue
      Throws:
      com.fasterxml.jackson.core.JsonProcessingException - if the outgoing event cannot be deserialized
    • takeResult

      public ActionEvent takeResult(String returnAddress) throws com.fasterxml.jackson.core.JsonProcessingException
      Throws:
      com.fasterxml.jackson.core.JsonProcessingException
    • convertEvent

      public static ActionEvent convertEvent(String element) throws com.fasterxml.jackson.core.JsonProcessingException
      Throws:
      com.fasterxml.jackson.core.JsonProcessingException
    • convertInput

      public static ActionInput convertInput(String element) throws com.fasterxml.jackson.core.JsonProcessingException
      Throws:
      com.fasterxml.jackson.core.JsonProcessingException
    • setHeartbeat

      public void setHeartbeat(String key)
    • drop

      public void drop(List<String> actionNames)