VideoOS.Platform.Search.SearchDefinition Class Referenceabstract

Represents an independent search definition. More...

Public Member Functions

virtual void Close ()
 Called when the search definition is no longer needed for searching. After this is called, no searches will be called on this definition.
 
virtual void Init ()
 This method is called when the search definition has been created. This could be used if the search definition need to initialize variables.
 

Protected Member Functions

virtual void FireErrorOccurredEvent (Guid sessionId, SearchError searchError)
 Invoke this method when a run-time error occurred. The search could continue after calling this method.
 
virtual void FireSearchResultsReadyEvent (Guid sessionId, IEnumerable< SearchResultData > searchResults)
 Invoke this method when a partial result is ready to be offloaded.
 
virtual void Search (Guid sessionId, DateTime from, DateTime to, IEnumerable< Item > items, CancellationToken cancellationToken)
 Override this method to implement your search for pre 2020 R1 VMS. To support search in 2020 R1 VMS and newer, please override the overload Search(VideoOS.Platform.Search.SearchInput,System.Threading.CancellationToken). Note: The search is considered finished when this method returns. Use FireSearchResultsReadyEvent when search results are ready.
 
virtual void Search (SearchInput searchInput, CancellationToken cancellationToken)
 Override this method to implement your search. Note: The search is considered finished when this method returns. Use FireSearchResultsReadyEvent when search results are ready.
 
 SearchDefinition (SearchScope searchScope)
 Default constructor invoked by all base classes.
 

Properties

Guid SearchAgentPluginId [get, set]
 The ID of the SearchAgentPlugin which created this search definition.
 
SearchCriteria SearchCriteria [get]
 The search criteria container associated with this search definition. There is always a 1-to-1 relationship between a SearchDefinition and a Platform.Search.SearchCriteria.
 
SearchScope SearchScope [get]
 Gets the search scope associated with the edit control.
 

Detailed Description

Represents an independent search definition.

Constructor & Destructor Documentation

◆ SearchDefinition()

VideoOS.Platform.Search.SearchDefinition.SearchDefinition ( SearchScope searchScope)
inlineprotected

Default constructor invoked by all base classes.

Member Function Documentation

◆ Close()

virtual void VideoOS.Platform.Search.SearchDefinition.Close ( )
inlinevirtual

Called when the search definition is no longer needed for searching. After this is called, no searches will be called on this definition.

◆ FireErrorOccurredEvent()

virtual void VideoOS.Platform.Search.SearchDefinition.FireErrorOccurredEvent ( Guid sessionId,
SearchError searchError )
inlineprotectedvirtual

Invoke this method when a run-time error occurred. The search could continue after calling this method.

Parameters
sessionIdThe session id identifying the current search.
searchErrorThe search error that occurred.

◆ FireSearchResultsReadyEvent()

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

Invoke this method when a partial result is ready to be offloaded.

Parameters
sessionIdThe session id identifying the current search.
searchResultsThe chunk of search results ready to be offloaded.

◆ Init()

virtual void VideoOS.Platform.Search.SearchDefinition.Init ( )
inlinevirtual

This method is called when the search definition has been created. This could be used if the search definition need to initialize variables.

◆ Search() [1/2]

virtual void VideoOS.Platform.Search.SearchDefinition.Search ( Guid sessionId,
DateTime from,
DateTime to,
IEnumerable< Item > items,
CancellationToken cancellationToken )
inlineprotectedvirtual

Override this method to implement your search for pre 2020 R1 VMS. To support search in 2020 R1 VMS and newer, please override the overload Search(VideoOS.Platform.Search.SearchInput,System.Threading.CancellationToken). Note: The search is considered finished when this method returns. Use FireSearchResultsReadyEvent when search results are ready.

Parameters
sessionIdA unique session id identifying the started 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.
cancellationTokenCancellation token which can be used to cancel an ongoing search (if the implementation allows it).

◆ Search() [2/2]

virtual void VideoOS.Platform.Search.SearchDefinition.Search ( SearchInput searchInput,
CancellationToken cancellationToken )
inlineprotectedvirtual

Override this method to implement your search. Note: The search is considered finished when this method returns. Use FireSearchResultsReadyEvent when search results are ready.

Parameters
searchInputInput for the search
cancellationTokenCancellation token which can be used to cancel an ongoing search (if the implementation allows it).

Property Documentation

◆ SearchAgentPluginId

Guid VideoOS.Platform.Search.SearchDefinition.SearchAgentPluginId
getset

The ID of the SearchAgentPlugin which created this search definition.

◆ SearchCriteria

SearchCriteria VideoOS.Platform.Search.SearchDefinition.SearchCriteria
get

The search criteria container associated with this search definition. There is always a 1-to-1 relationship between a SearchDefinition and a Platform.Search.SearchCriteria.

◆ SearchScope

SearchScope VideoOS.Platform.Search.SearchDefinition.SearchScope
get

Gets the search scope associated with the edit control.

Returns