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 Summary
Modifier and TypeMethodDescriptionvoid
Configures the underlying index engine.int
countTasks
(ITaskSearchQueryExtended searchQuery, SearchContext searchOptions) Counts the matching tasks by a given criteria.void
createIndex
(ITaskDefinition taskDef) Creates a task definition namespace, used by the underlying storage.void
deleteIndex
(ITaskDefinition taskDef) Deletes the task definition namespace, used by the underlying storage.void
deleteTask
(ITask task) Deletes a task instance from the underlying engine storage.void
deleteTasks
(List<ITask> tasks) Deletes list of task instances from the underlying engine storage.getType()
void
Indexes a task instance in the underlying engine storage.void
indexTasks
(Map<ITask, ITaskData> tasks) Indexes multiple task instances in the underlying engine storage.void
Activation of service.boolean
void
reindexTasks
(ITaskDefinition taskDef) 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.void
reindexTasks
(List<ITask> tasks) Deletes the corresponding task instances from the underlying engine storage and synchronizes them with the ones from the TE.searchTasks
(ITaskSearchQueryExtended searchQuery, SearchContext searchOptions) Returns list of tasks matching a given criteria.void
stopReindex
(ITaskDefinition taskDef) Stops the reindexing operation on the underlying engine storage if there is already a running one.void
updateTask
(ITask task) Updates (re-index) a task instance in the underlying engine storage.void
updateTasks
(List<ITask> tasks) Updates (re-index) multiple task instances in the underlying engine storage.
-
Method Details
-
isEnabled
boolean isEnabled()- Returns:
- if the engine is enabled
-
configure
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 querysearchOptions
- - the search option map- Returns:
- the task count
- Throws:
PortalException
- if any problem occurs during the operation execution
-
createIndex
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
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
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
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
Indexes a task instance in the underlying engine storage.- Parameters:
task
- - the task instance to be indexedtaskData
- - the task data of the task instance- Throws:
PortalException
- if any problem occurs during the operation execution
-
indexTasks
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
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
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
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 querysearchOptions
- - the search option map- Returns:
- the task count
- Throws:
PortalException
- if any problem occurs during the operation execution
-
updateTask
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
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
Activation of service.- Throws:
Exception
- - if any exception occurs during service initialization
-