Klasse DUUIPipelineController

java.lang.Object
org.texttechnologylab.duui.api.controllers.pipelines.DUUIPipelineController

public class DUUIPipelineController extends Object
A Controller for database operations related to the pipelines collection.
Autor:
Cedric Borkowski
  • Konstruktorübersicht

    Konstruktoren
    Konstruktor
    Beschreibung
     
  • Methodenübersicht

    Modifizierer und Typ
    Methode
    Beschreibung
    static void
    cascade(String userId)
    Delete all pipelines associated with a user when that user account is deleted.
    static boolean
    Delete one pipeline and return if the deletion succeeded.
    static org.bson.Document
    findMany(MongoDBFilters filters, boolean getComponents)
    Retrieve one or more pipelines from the database given a MongoDBFilters object.
    static org.bson.Document
    Retrieve one pipeline given its id.
    static org.bson.Document
    findOneById(String id, boolean getComponents)
    Retrieve one pipeline given its id.
    static org.texttechnologylab.DockerUnifiedUIMAInterface.driver.DUUIPipelineComponent
    getComponent(org.bson.Document component)
    Creates a DUUIPipelineComponent from a settings Document
    static org.texttechnologylab.DockerUnifiedUIMAInterface.driver.IDUUIDriverInterface
    Construct a IDUUIDriverInterface from a string holding its name.
    static org.bson.Document
    This function performs a set of Aggregations to generate statistics for the usage of a pipeline.
    static Map<String,org.texttechnologylab.DockerUnifiedUIMAInterface.DUUIComposer>
    Get the map of reusable/instantiated pipelines.
    static boolean
    Instantiate a pipeline and store it as a reusable one.
    static org.texttechnologylab.DockerUnifiedUIMAInterface.DUUIComposer
    instantiatePipeline(org.bson.Document pipeline)
    Instantiate a pipeline from a Document.
    static void
    Cancel all active processes using the pipeline with the given id.
    static void
    setStatus(String id, String status)
    Set the status of a pipeline given an id and the status name.
    static void
    setupComponents(org.texttechnologylab.DockerUnifiedUIMAInterface.DUUIComposer composer, org.bson.Document pipeline)
    Set up the components for a pipeline in a composer.
    static void
    setupDrivers(org.texttechnologylab.DockerUnifiedUIMAInterface.DUUIComposer composer, org.bson.Document pipeline)
    Loops over all components in the pipeline and add their respective driver to the composer.
    static boolean
    Shut down a pipeline and remove it from the map of reusable pipelines.
    static void
    Shutdown a reusable pipeline and cancel all active processes using the pipeline.
    static void
    updateOne(String id, org.bson.Document updates)
    Update a pipeline given its id and a Document of updates.
    static void
    Increment the times_used property of a pipeline and update the last_used time.

    Von Klasse geerbte Methoden java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Konstruktordetails

    • DUUIPipelineController

      public DUUIPipelineController()
  • Methodendetails

    • findOneById

      public static org.bson.Document findOneById(String id)
      Retrieve one pipeline given its id.
      Parameter:
      id - A unique 24 character identifier generated by MongoDB.
      Gibt zurück:
      A Document containing the pipeline data or null if nothing matched.
    • findOneById

      public static org.bson.Document findOneById(String id, boolean getComponents)
      Retrieve one pipeline given its id.
      Parameter:
      id - A unique 24 character identifier generated by MongoDB.
      getComponents - Wether to include the pipeline's components or not.
      Gibt zurück:
      A document containing the pipeline data or null if nothing matched.
    • findMany

      public static org.bson.Document findMany(MongoDBFilters filters, boolean getComponents)
      Retrieve one or more pipelines from the database given a MongoDBFilters object.
      Parameter:
      filters - A MongoDBFilters object that contains filter options.
      getComponents - Wether to include components in the pipeline data.
      Gibt zurück:
      A Document containing a list of matched pipelines.
    • updateOne

      public static void updateOne(String id, org.bson.Document updates)
      Update a pipeline given its id and a Document of updates.
      Parameter:
      id - The id of the pipeline to update.
      updates - A Document of key value pairs that define updates.
    • instantiate

      public static boolean instantiate(String id)
      Instantiate a pipeline and store it as a reusable one. This pipeline can be passed to a composer to skip the instantiation for every process.
      Parameter:
      id - The id of the pipeline to instantiate.
      Gibt zurück:
      if the instantiation was successfull.
    • shutdown

      public static boolean shutdown(String id)
      Shut down a pipeline and remove it from the map of reusable pipelines.
      Parameter:
      id - The id of the pipeline to shut down.
      Gibt zurück:
      if the shut-down was successfull
    • updateTimesUsed

      public static void updateTimesUsed(String id)
      Increment the times_used property of a pipeline and update the last_used time.
      Parameter:
      id - The pipeline id.
    • getReusablePipelines

      public static Map<String,org.texttechnologylab.DockerUnifiedUIMAInterface.DUUIComposer> getReusablePipelines()
      Get the map of reusable/instantiated pipelines.
      Gibt zurück:
      the map of pipelines that are reusable.
    • deleteOne

      public static boolean deleteOne(String id)
      Delete one pipeline and return if the deletion succeeded. Also delete all components and processes referencing the pipeline.
      Parameter:
      id - The id of the pipeline to delete
      Gibt zurück:
      if the number of deleted pipelines is greater than 0.
    • interruptIfRunning

      public static void interruptIfRunning(String id)
      Cancel all active processes using the pipeline with the given id.
      Parameter:
      id - The id of the pipeline.
    • shutdownPipeline

      public static void shutdownPipeline(String pipelineId)
      Shutdown a reusable pipeline and cancel all active processes using the pipeline.
      Parameter:
      pipelineId - The id of the pipeline to shut down.
    • setStatus

      public static void setStatus(String id, String status)
      Set the status of a pipeline given an id and the status name.
      Parameter:
      id - The pipeline's id.
      status - The status to set. See DUUIStatus
    • getPipelineStatistics

      public static org.bson.Document getPipelineStatistics(String pipelineId)
      This function performs a set of Aggregations to generate statistics for the usage of a pipeline. These Aggregations include - a grouping by status (Completed, Failed, etc.) - a grouping by errors - a grouping by input provider - a grouping by output provider - a grouping by usage per month - a sum of the total number documents procesed.
      Parameter:
      pipelineId - The identifier for the pipeline
      Gibt zurück:
      A BSON Document with the aggregation result.
    • instantiatePipeline

      public static org.texttechnologylab.DockerUnifiedUIMAInterface.DUUIComposer instantiatePipeline(org.bson.Document pipeline) throws Exception
      Instantiate a pipeline from a Document. This function is used to instantiate a pipeline and return its composer for future use.
      Parameter:
      pipeline - The pipeline to instantiate (MongoDB Document).
      Gibt zurück:
      the composer containing the instantiated pipeline.
      Löst aus:
      Exception
    • setupComponents

      public static void setupComponents(org.texttechnologylab.DockerUnifiedUIMAInterface.DUUIComposer composer, org.bson.Document pipeline) throws IOException, org.apache.uima.UIMAException, SAXException, URISyntaxException, org.apache.commons.compress.compressors.CompressorException
      Set up the components for a pipeline in a composer.
      Parameter:
      composer - The composer to add components to.
      pipeline - A Document containing all component settings.
      Löst aus:
      IOException
      org.apache.uima.UIMAException
      SAXException
      URISyntaxException
      org.apache.commons.compress.compressors.CompressorException
    • setupDrivers

      public static void setupDrivers(org.texttechnologylab.DockerUnifiedUIMAInterface.DUUIComposer composer, org.bson.Document pipeline)
      Loops over all components in the pipeline and add their respective driver to the composer.
      Parameter:
      composer - The composer that is being setup.
      pipeline - The pipeline (MongoDB Document) containing all relevant components.
    • getDriverFromString

      public static org.texttechnologylab.DockerUnifiedUIMAInterface.driver.IDUUIDriverInterface getDriverFromString(String driver) throws IOException, org.apache.uima.UIMAException, SAXException
      Construct a IDUUIDriverInterface from a string holding its name.
      Parameter:
      driver - The name of the driver to construct.
      Gibt zurück:
      A driver object or null if no driver matched the name.
      Löst aus:
      IOException
      org.apache.uima.UIMAException
      SAXException
    • getComponent

      public static org.texttechnologylab.DockerUnifiedUIMAInterface.driver.DUUIPipelineComponent getComponent(org.bson.Document component) throws URISyntaxException, IOException, org.apache.uima.util.InvalidXMLException, SAXException
      Creates a DUUIPipelineComponent from a settings Document
      Parameter:
      component - the settings for the component.
      Gibt zurück:
      the new pipeline component.
      Löst aus:
      URISyntaxException
      IOException
      org.apache.uima.util.InvalidXMLException
      SAXException
    • cascade

      public static void cascade(String userId)
      Delete all pipelines associated with a user when that user account is deleted.
      Parameter:
      userId - the id of the user that has been deleted.