Interface ITaskIndexManager<T extends ITaskIndexEngineConfiguration>

Type Parameters:
T - - the type of used configuration

public interface ITaskIndexManager<T extends ITaskIndexEngineConfiguration>
Interface, which provides functionality for CRUD operations with task definitions and task instances. Must be configured properly before usage, and shut down after that, so a resource cleanup can be made. Typically registered and used as an OSGi service.
  • Method Details

    • isEnabled

      boolean isEnabled()
      Returns:
      if the engine is enabled
    • configure

      void configure(T configuration) throws PortalException
      Configures the underlying index engine. It is expected for the engine to be shut down and re-initialized for a short period of time. This could result in an index inconsistency or returned wrong results, if a parallel execution tries to make a CRUD operation, during the execution of this method.
      Parameters:
      configuration - - the provided configuration
      Throws:
      PortalException - if any problem occurs during the operation
    • getConfiguration

      T getConfiguration()
      Returns:
      the engine current configuration
    • countTasks

      int countTasks(ITaskSearchQueryExtended searchQuery, SearchContext searchOptions) throws PortalException
      Counts the matching tasks by a given criteria. Can be used also when aggregation is specified.
      Parameters:
      searchQuery - - the task query
      searchOptions - - the search option map
      Returns:
      the task count
      Throws:
      PortalException - if any problem occurs during the operation execution
    • createIndex

      void createIndex(ITaskDefinition taskDef) throws PortalException
      Creates a task definition namespace, used by the underlying storage.
      Parameters:
      taskDef - - the task definition
      Throws:
      PortalException - if any problem occurs during the operation execution
    • deleteIndex

      void deleteIndex(ITaskDefinition taskDef) throws PortalException
      Deletes the task definition namespace, used by the underlying storage. Deletes all the indexed tasks beforehand.
      Parameters:
      taskDef - - the task definition
      Throws:
      PortalException - if any problem occurs during the operation execution
    • deleteTask

      void deleteTask(ITask task) throws PortalException
      Deletes a task instance from the underlying engine storage.
      Parameters:
      task - - the task instance to be deleted
      Throws:
      PortalException - if any problem occurs during the operation execution
    • deleteTasks

      void deleteTasks(List<ITask> tasks) throws PortalException
      Deletes list of task instances from the underlying engine storage.
      Parameters:
      tasks - - the task instances to be deleted
      Throws:
      PortalException - if any problem occurs during the operation execution
    • indexTask

      void indexTask(ITask task, ITaskData taskData) throws PortalException
      Indexes a task instance in the underlying engine storage.
      Parameters:
      task - - the task instance to be indexed
      taskData - - the task data of the task instance
      Throws:
      PortalException - if any problem occurs during the operation execution
    • indexTasks

      void indexTasks(Map<ITask,ITaskData> tasks) throws PortalException
      Indexes multiple task instances in the underlying engine storage.
      Parameters:
      tasks - - the map, containing the task instances and their corresponding business data
      Throws:
      PortalException - if any problem occurs during the operation execution
    • reindexTasks

      void reindexTasks(ITaskDefinition taskDef) throws PortalException
      By a given task definition, deletes all task instances from the underlying engine storage and synchronizes the existing ones from the TE with the index engine. The operation is asynchronous, since it can last very long.
      Parameters:
      taskDef - - the task definition
      Throws:
      PortalException - if any problem occurs during the operation execution
    • stopReindex

      void stopReindex(ITaskDefinition taskDef) throws PortalException
      Stops the reindexing operation on the underlying engine storage if there is already a running one.
      Parameters:
      taskDef - - the task definition
      Throws:
      PortalException - if any problem occurs during the operation execution
    • reindexTasks

      void reindexTasks(List<ITask> tasks) throws PortalException
      Deletes the corresponding task instances from the underlying engine storage and synchronizes them with the ones from the TE.
      Parameters:
      tasks - - the task instances to be updated
      Throws:
      PortalException - if any problem occurs during the operation execution
    • searchTasks

      List<ITaskSearchRecord> searchTasks(ITaskSearchQueryExtended searchQuery, SearchContext searchOptions) throws PortalException
      Returns list of tasks matching a given criteria.
      Parameters:
      searchQuery - - the task query
      searchOptions - - the search option map
      Returns:
      the task count
      Throws:
      PortalException - if any problem occurs during the operation execution
    • updateTask

      void updateTask(ITask task) throws PortalException
      Updates (re-index) a task instance in the underlying engine storage.
      Parameters:
      task - - the task instance to be updated
      Throws:
      PortalException - if any problem occurs during the operation execution
    • updateTasks

      void updateTasks(List<ITask> tasks) throws PortalException
      Updates (re-index) multiple task instances in the underlying engine storage.
      Parameters:
      tasks - - the task instances to be updated
      Throws:
      PortalException - if any problem occurs during the operation execution
    • getType

      String getType()
      Returns:
      type of the Index Engine (for example - db, hpstra)
    • initialize

      void initialize() throws Exception
      Activation of service.
      Throws:
      Exception - - if any exception occurs during service initialization