VideoOS.Platform.Search.SearchManager Class Reference

A single-entry point for performing searches across the VMS system. The search manager will expose all available searches supplied by loaded search agent plugins. A search can be started across multiple search agents and run simultaneously by the search manager.
More...

Inheritance diagram for VideoOS.Platform.Search.SearchManager:

Public Member Functions

bool CancelSearch (IEnumerable< SearchDefinition > definitions)
 Attempt to cancel the currently running search based on there search criteria. This will only signal the search agent plugin to cancel a search and then return. After calling this, no more results from the cancel search will be returned.
 
SearchDefinition CreateSearchDefinition (SearchFilterCategory searchFilterCategory, SearchScope searchScope)
 Creates a new search definition based on a search category.
 
void DestroySearchDefinition (SearchDefinition searchDefinition)
 Destroys the provided search definition.
 
void Dispose ()
 Dispose the SearchManager, and then signal all running searches to cancel.
 
 SearchManager ()
 Creates a new SearchManager for performing searches across the VMS system.
 
 SearchManager (IEnumerable< SearchAgentPlugin > searchAgentPlugins)
 Creates a new SearchManager for performing searches across the VMS system using the provided search agent plugins.
 
void StartSearch (SearchDefinition definition, DateTime from, DateTime to, IEnumerable< Item > items)
 Starts a new search based on the given search criteria.
Only one search can be started at a time. If a new search is started the previous search is canceled, and any subsequent result is ignored. This is equivalent to calling CancelSearch first.
 
void StartSearch (SearchDefinition definition, DateTime from, DateTime to, IEnumerable< Item > items, SearchSortOrder sortOrder)
 Starts a new search based on the given search criteria.
Only one search can be started at a time. If a new search is started the previous search is canceled, and any subsequent result is ignored. This is equivalent to calling CancelSearch first.
 

Protected Member Functions

virtual void Dispose (bool disposing)
 Override to handle disposing objects in inherited classes.
 
virtual void FireErrorOccurred (SearchError searchError, SearchDefinition searchDefinition, Guid sessionId)
 Fire ErrorOccurred events.
 
virtual void FirePartialResultReady (IEnumerable< SearchResultData > searchResults, SearchDefinition searchDefinition, Guid sessionId)
 Fire SearchResultReady events.
 
virtual void FireSearchDone (SearchDefinition searchDefinition, Guid sessionId)
 Fire SearchDone events.
 

Properties

ReadOnlyCollection< SearchFilterCategorySearchFilterCategories [get]
 Returns all search filter categories from all the loaded search agent plugins.
 

Events

EventHandler< SearchErrorEventArgsErrorOccurred
 An event used to inform the caller about run-time error.
 
EventHandler< SearchDoneEventArgsSearchDone
 An event used to inform the caller that a started search has completed.
 
EventHandler< SearchResultReadyEventArgsSearchResultReady
 An event used to inform that a set of results is ready.
 

Detailed Description

A single-entry point for performing searches across the VMS system. The search manager will expose all available searches supplied by loaded search agent plugins. A search can be started across multiple search agents and run simultaneously by the search manager.

  1. A dedicated thread will run per criteria for a started search.
  2. Only one search per criteria can be performed at a time. (This means that a second search for a criteria will cancel the first search)
  3. The criteriaLimit is per criteria. Meaning that searching for 3 criteria with a limit of 50 will return a maximum of 150 results in total.

Constructor & Destructor Documentation

◆ SearchManager() [1/2]

VideoOS.Platform.Search.SearchManager.SearchManager ( )
inline

Creates a new SearchManager for performing searches across the VMS system.

◆ SearchManager() [2/2]

VideoOS.Platform.Search.SearchManager.SearchManager ( IEnumerable< SearchAgentPlugin > searchAgentPlugins)
inline

Creates a new SearchManager for performing searches across the VMS system using the provided search agent plugins.

Parameters
searchAgentPluginsSearch agent plugins to add to the search manager.

Member Function Documentation

◆ CancelSearch()

bool VideoOS.Platform.Search.SearchManager.CancelSearch ( IEnumerable< SearchDefinition > definitions)
inline

Attempt to cancel the currently running search based on there search criteria. This will only signal the search agent plugin to cancel a search and then return. After calling this, no more results from the cancel search will be returned.

Parameters
definitionsA list of search definitions to cancel.
Returns
True if at least one search was signaled to cancel.

◆ CreateSearchDefinition()

SearchDefinition VideoOS.Platform.Search.SearchManager.CreateSearchDefinition ( SearchFilterCategory searchFilterCategory,
SearchScope searchScope )
inline

Creates a new search definition based on a search category.

Parameters
searchFilterCategoryThe category to base the definition on.
searchScopeThe search scope associated with the definition.
Returns
A new search definition.

◆ DestroySearchDefinition()

void VideoOS.Platform.Search.SearchManager.DestroySearchDefinition ( SearchDefinition searchDefinition)
inline

Destroys the provided search definition.

Parameters
searchDefinitionThe search definition to destroy.

◆ Dispose() [1/2]

void VideoOS.Platform.Search.SearchManager.Dispose ( )
inline

Dispose the SearchManager, and then signal all running searches to cancel.

◆ Dispose() [2/2]

virtual void VideoOS.Platform.Search.SearchManager.Dispose ( bool disposing)
inlineprotectedvirtual

Override to handle disposing objects in inherited classes.

Parameters
disposingIndicate if the method is called from Dispose() or the finalizer.

◆ FireErrorOccurred()

virtual void VideoOS.Platform.Search.SearchManager.FireErrorOccurred ( SearchError searchError,
SearchDefinition searchDefinition,
Guid sessionId )
inlineprotectedvirtual

Fire ErrorOccurred events.

Parameters
searchErrorThe search error that occurred.
searchDefinitionThe Search.SearchDefinition which initiated the search.
sessionIdA unique session id identifing the search where the exception originated from.

◆ FirePartialResultReady()

virtual void VideoOS.Platform.Search.SearchManager.FirePartialResultReady ( IEnumerable< SearchResultData > searchResults,
SearchDefinition searchDefinition,
Guid sessionId )
inlineprotectedvirtual

Fire SearchResultReady events.

Parameters
searchResultsThe enumerable representing a chunk of SearchResultDatas ready to be offloaded.
searchDefinitionThe Search.SearchDefinition which initiated the search.
sessionIdA unique session id identifying the search where the result originated from.

◆ FireSearchDone()

virtual void VideoOS.Platform.Search.SearchManager.FireSearchDone ( SearchDefinition searchDefinition,
Guid sessionId )
inlineprotectedvirtual

Fire SearchDone events.

Parameters
searchDefinitionThe search definition that has completed.
sessionIdThe sessionId firing the search done event.

◆ StartSearch() [1/2]

void VideoOS.Platform.Search.SearchManager.StartSearch ( SearchDefinition definition,
DateTime from,
DateTime to,
IEnumerable< Item > items )
inline

Starts a new search based on the given search criteria.
Only one search can be started at a time. If a new search is started the previous search is canceled, and any subsequent result is ignored. This is equivalent to calling CancelSearch first.

Parameters
definitionA search definition on which to start a search.
fromThe start of the time span in which to search.
toThe end of the time span in which to search.
itemsThe items (i.e. cameras) to include in the search.

◆ StartSearch() [2/2]

void VideoOS.Platform.Search.SearchManager.StartSearch ( SearchDefinition definition,
DateTime from,
DateTime to,
IEnumerable< Item > items,
SearchSortOrder sortOrder )
inline

Starts a new search based on the given search criteria.
Only one search can be started at a time. If a new search is started the previous search is canceled, and any subsequent result is ignored. This is equivalent to calling CancelSearch first.

Parameters
definitionA search definition on which to start a search.
fromThe start of the time span in which to search.
toThe end of the time span in which to search.
itemsThe items (i.e. cameras) to include in the search.
sortOrderThe order in which the results should be delivered.

Property Documentation

◆ SearchFilterCategories

ReadOnlyCollection<SearchFilterCategory> VideoOS.Platform.Search.SearchManager.SearchFilterCategories
get

Returns all search filter categories from all the loaded search agent plugins.

Event Documentation

◆ ErrorOccurred

EventHandler<SearchErrorEventArgs> VideoOS.Platform.Search.SearchManager.ErrorOccurred

An event used to inform the caller about run-time error.

◆ SearchDone

EventHandler<SearchDoneEventArgs> VideoOS.Platform.Search.SearchManager.SearchDone

An event used to inform the caller that a started search has completed.

◆ SearchResultReady

EventHandler<SearchResultReadyEventArgs> VideoOS.Platform.Search.SearchManager.SearchResultReady

An event used to inform that a set of results is ready.