Klasse DUUIComponentController

java.lang.Object
org.texttechnologylab.duui.api.controllers.components.DUUIComponentController

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

    Konstruktoren
    Konstruktor
    Beschreibung
     
  • Methodenübersicht

    Modifizierer und Typ
    Methode
    Beschreibung
    static void
    deleteMany(org.bson.conversions.Bson filter)
    Delete all components matching a given filter
    static boolean
    Attempt to delete a component given its id.
    static List<org.bson.Document>
    Retrieve one or more components from the database given aMongoDBFilters object.
    static org.bson.Document
    Retrieve one component given its id.
    static org.bson.Document
    Create and retrieve a default component.
    static org.bson.Document
    Create and retrieve default options for a component.
    static org.bson.Document
    insertOne(org.bson.Document component)
    Attempt to create and insert a new component into the database.
    static org.bson.Document
    mergeOptions(org.bson.Document options)
    Given a Document of options for a component, compare to the default options by filling out missing values and checking invalid entries.
    static void
    setIndex(String id, int index)
    Sets the index of the component, meaning the position in its pipeline.
    static org.bson.Document
    updateOne(String id, org.bson.Document updates)
    Attempt to update a component given its id and a JSON object with updates.

    Von Klasse geerbte Methoden java.lang.Object

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

    • DUUIComponentController

      public DUUIComponentController()
  • Methodendetails

    • getDefaultComponent

      public static org.bson.Document getDefaultComponent()
      Create and retrieve a default component.
      Gibt zurück:
      a Document with the default properties for a component set.
    • getDefaultOptions

      public static org.bson.Document getDefaultOptions()
      Create and retrieve default options for a component.
      Gibt zurück:
      a Document with the default properties for options of a component set.
    • mergeOptions

      public static org.bson.Document mergeOptions(org.bson.Document options)
      Given a Document of options for a component, compare to the default options by filling out missing values and checking invalid entries.
      Parameter:
      options - the user defined options for a component.
      Gibt zurück:
      the options with added missing entries.
    • findOneById

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

      public static List<org.bson.Document> findMany(MongoDBFilters filters)
      Retrieve one or more components from the database given aMongoDBFilters object.
      Parameter:
      filters - A MongoDBFilters object that contains filter options.
      Gibt zurück:
      A Document containing a list of matched components.
    • insertOne

      public static org.bson.Document insertOne(org.bson.Document component)
      Attempt to create and insert a new component into the database.
      Parameter:
      component - the component to create
      Gibt zurück:
      the inserted component.
    • updateOne

      public static org.bson.Document updateOne(String id, org.bson.Document updates)
      Attempt to update a component given its id and a JSON object with updates.
      Parameter:
      id - the id of the component
      updates - the JSON object with updates to the component
      Gibt zurück:
      the updated component
    • deleteOne

      public static boolean deleteOne(String id)
      Attempt to delete a component given its id.
      Parameter:
      id - the id of the component
      Gibt zurück:
      a confirmation flag.
    • deleteMany

      public static void deleteMany(org.bson.conversions.Bson filter)
      Delete all components matching a given filter
      Parameter:
      filter - A Bson filter to delete only selected components
    • setIndex

      public static void setIndex(String id, int index)
      Sets the index of the component, meaning the position in its pipeline.
      Parameter:
      id - The component's id.
      index - The index in the pipeline.