Class RestMasterPlugin

java.lang.Object
io.vertigo.stella.plugins.work.rest.master.RestMasterPlugin
All Implemented Interfaces:
io.vertigo.core.node.component.Component, io.vertigo.core.node.component.CoreComponent, io.vertigo.core.node.component.Plugin, MasterPlugin, io.vertigo.vega.webservice.WebServices

@PathPrefix("/backend/workQueue") public final class RestMasterPlugin extends Object implements MasterPlugin, io.vertigo.vega.webservice.WebServices
Exécution synchrone et distante des Works avec un transfert par WS REST.
Author:
npiedeloup, pchretien
  • Constructor Details

    • RestMasterPlugin

      @Inject public RestMasterPlugin(Optional<Integer> deadWorkTypeTimeoutSeconds, @Deprecated Optional<Integer> deprecatedTimeoutSeconds, io.vertigo.commons.codec.CodecManager codecManager)
      Constructeur. Same params as the RedisMasterPlugin.
      Parameters:
      deadWorkTypeTimeoutSeconds - Timeout (seconds) of the waiting works without an active node for their type (60s by default)
      deprecatedTimeoutSeconds - ignored (kept for the existing configurations) : use deadWorkTypeTimeoutSeconds
      codecManager - Manager d'encodage/decodage
  • Method Details

    • checkDeadNodesAndWorkItems

      public io.vertigo.core.lang.Tuple<Set<String>,Set<String>> checkDeadNodesAndWorkItems(int maxRetry)
      Description copied from interface: MasterPlugin
      Check for dead nodes and manage (retry) unfinished workItems.
      Specified by:
      checkDeadNodesAndWorkItems in interface MasterPlugin
      Parameters:
      maxRetry - max number of retry
      Returns:
      WorkIds retried, WorkId abandonned
    • pollResult

      public WorkResult pollResult(String callerNodeId, int waitTimeSeconds)
      Wait for next result.
      Specified by:
      pollResult in interface MasterPlugin
      Parameters:
      callerNodeId -
      waitTimeSeconds - wait result for x seconds
      Returns:
      Work result (null if none) : may be any result type
    • putWorkItem

      public <R, W> void putWorkItem(WorkItem<R,W> workItem)
      Add a WorkItem to do
      Specified by:
      putWorkItem in interface MasterPlugin
      Type Parameters:
      R - Result type
      W - Work type
      Parameters:
      workItem - Work item