Interface IQuery<TValue>
- Assembly
- Diffusion.Client.dll
The configured query.
public interface IQuery<TValue>
Type Parameters
TValueThe query value type.
Remarks
A default query that performs a value range query of an entire time series can be obtained using RangeQuery and further configured using methods of the IRangeQuery<TValue> interface.
Added in version 6.1.
Methods
SelectFromAsync(string)
Evaluates this query for a time series topic.
Task<IQueryResult<TValue>> SelectFromAsync(string topicPath)
Parameters
topicPathstringThe path of the time series topic to query.
Returns
- Task<IQueryResult<TValue>>
The
Taskrepresenting the current operation.
Remarks
The calling session must have the READ_TOPIC
topic permission for topicPath to evaluate the query.
The QUERY_OBSOLETE_TIME_SERIES_EVENTS
topic permission is also required if this is a ForEdits()
range query, or a ForValues() range query
with an EditRange().
If the operation completes successfully, the Task result
will be the IQueryResult<TValue> of the requested selection.
This method is the same as calling SelectFromAsync(string, CancellationToken)
with System.Threading.CancellationToken.None.
Exceptions
- ArgumentNullException
topicPathisnull.- NoSuchTopicException
There is no topic bound to
topicPath. Thrown by the returnedTask.- IncompatibleTopicException
The
TValuetype does not match the event data type of the time series topic bound totopicPath, or the topic bound totopicPathis not a time series topic. Thrown by the returnedTask.- InvalidQueryException
The range query is not valid for the time series. Thrown by the returned
Task.- SessionSecurityException
The calling session does not have READ_TOPIC permission for
topicPath. The calling session does not have QUERY_OBSOLETE_TIME_SERIES_EVENTS permission fortopicPathand this is a ForEdits() range query, or a ForValues() range query with an EditRange(). Thrown by the returnedTask.- SessionClosedException
The calling session is closed. Thrown by the returned
Task.
- See Also
SelectFromAsync(string, CancellationToken)
Evaluates this query for a time series topic.
Task<IQueryResult<TValue>> SelectFromAsync(string topicPath, CancellationToken cancellationToken)
Parameters
topicPathstringThe path of the time series topic to query.
cancellationTokenCancellationTokenThe cancellation token used to cancel the current operation.
Returns
- Task<IQueryResult<TValue>>
The
Taskrepresenting the current operation.
Remarks
The calling session must have the READ_TOPIC
topic permission for topicPath to evaluate the query.
The QUERY_OBSOLETE_TIME_SERIES_EVENTS
topic permission is also required if this is a ForEdits()
range query, or a ForValues() range query
with an EditRange().
If the operation completes successfully, the Task result
will be the IQueryResult<TValue> of the requested selection.
Exceptions
- ArgumentNullException
topicPathisnull.- NoSuchTopicException
There is no topic bound to
topicPath. Thrown by the returnedTask.- IncompatibleTopicException
The
TValuetype does not match the event data type of the time series topic bound totopicPath, or the topic bound totopicPathis not a time series topic. Thrown by the returnedTask.- InvalidQueryException
The range query is not valid for the time series. Thrown by the returned
Task.- SessionSecurityException
The calling session does not have READ_TOPIC permission for
topicPath. The calling session does not have QUERY_OBSOLETE_TIME_SERIES_EVENTS permission fortopicPathand this is a ForEdits() range query, or a ForValues() range query with an EditRange(). Thrown by the returnedTask.- SessionClosedException
The calling session is closed. Thrown by the returned
Task.