AFNotificationRuleTemplateSearch Class
- Last UpdatedSep 18, 2024
- PI System
- AF SDK 2024
- Developer
Inheritance Hierarchy
OSIsoft.AF.Search.AFSearch
OSIsoft.AF.Search.AFSearch<AFNotificationRuleTemplate>
OSIsoft.AF.Search.AFNotificationRuleTemplateSearch
Namespace: OSIsoft.AF.Search
Assembly: OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.0.1156
Syntax
public sealed class AFNotificationRuleTemplateSearch : AFSearch<AFNotificationRuleTemplate>
Public NotInheritable Class AFNotificationRuleTemplateSearch Inherits AFSearch(Of AFNotificationRuleTemplate) Dim instance As AFNotificationRuleTemplateSearch
public ref class AFNotificationRuleTemplateSearch sealed : public AFSearch<AFNotificationRuleTemplate^>
[<SealedAttribute>] type AFNotificationRuleTemplateSearch = class inherit AFSearch<AFNotificationRuleTemplate> end
The AFNotificationRuleTemplateSearch type exposes the following members.
Constructors
Name | Description | |
---|---|---|
![]() | AFNotificationRuleTemplateSearch(AFDatabase, String, IList<AFSearchToken>) | Obsolete.
Creates an instance of an AFNotificationRuleTemplateSearch to search
for AFNotificationRuleTemplate objects using the specified list of
search tokens.
|
![]() | AFNotificationRuleTemplateSearch(AFDatabase, String, IList<AFSearchTokenBase>) |
Creates an instance of an AFNotificationRuleTemplateSearch to search
for AFNotificationRuleTemplate objects using the specified list of
search tokens.
|
![]() | AFNotificationRuleTemplateSearch(AFDatabase, String, String) |
Creates an instance of an AFNotificationRuleTemplateSearch to search
for AFNotificationRuleTemplate objects using the specified search query
string.
|
Properties
Name | Description | |
---|---|---|
![]() | CacheInterval |
The search's cached automatic refresh interval.
(Inherited from AFSearch.) |
![]() | CacheTimeout |
The timeout to clean up the cached search in the server if it has not been used.
(Inherited from AFSearch.) |
![]() | Database |
The AFDatabase to be searched by the query.
(Inherited from AFSearch.) |
![]() | Identity |
This read-only property specifies the identity of the objects returned
from the search.
(Inherited from AFSearch.) |
![]() | PISystem |
The PISystem to be searched by the query.
(Inherited from AFSearch.) |
![]() | SearchName |
The name of the search object.
(Inherited from AFSearch.) |
![]() | ThrowOnError |
Specifies it an exception will be thrown for missing objects or invalid data in the query.
(Inherited from AFSearch.) |
![]() | TokenCollection |
The tokens that represent this search object.
(Inherited from AFSearch.) |
![]() | Tokens | Obsolete.
The tokens that represent this search object.
(Inherited from AFSearch.) |
Methods
Name | Description | |
---|---|---|
![]() ![]() | Aggregate |
Performs all requested aggregates on the objects that match the search criteria.
(Inherited from AFSearch.) |
![]() ![]() | AggregateAsync |
Performs all requested aggregates on the objects that match the search criteria asynchronously.
(Inherited from AFSearch.) |
![]() ![]() | BinnedSummary<TBin> |
Generates a summary broken down by the specified bins for items matching the search criteria.
(Inherited from AFSearch.) |
![]() ![]() | BinnedSummaryAsync<TBin> |
Generates a summary broken down by the specified bins for items matching the search criteria asynchronously.
(Inherited from AFSearch.) |
![]() | Close |
Closes the search that is cached in the server.
(Inherited from AFSearch.) |
![]() | Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) |
![]() | FindNotificationRuleTemplates | Obsolete.
This method will return the AFNotificationRuleTemplate objects that match the
search tokens.
|
![]() ![]() | FindObjectFields(String, Int32, Int32) |
This method will return the values as an IList for the specified fields for each of the objects
that match the search tokens.
(Inherited from AFSearch<T>.) |
![]() ![]() | FindObjectFields<TObject>(Int32, Int32) |
This method will return the values for the fields defined by the user-defined type for each of the objects
that match the search tokens.
(Inherited from AFSearch<T>.) |
![]() ![]() | FindObjectFields<TObject>(String, Func<IList<Object>, TObject>, Int32, Int32) |
This method will return the values as an object for the specified fields for each of the objects
that match the search tokens using the supplied factory delegate.
(Inherited from AFSearch.) |
![]() ![]() | FindObjectFields<TObject>(String, Func<IList<Object>, TObject>, Int32, Int32) |
This method will return the values as an object for the specified fields for each of the objects
that match the search tokens using the supplied factory delegate.
(Inherited from AFSearch<T>.) |
![]() ![]() | FindObjectIds |
This method will return a list of the ID for each object that matches the
search tokens.
(Inherited from AFSearch<T>.) |
![]() ![]() | FindObjects |
This method will return the objects that match the
search tokens.
(Inherited from AFSearch<T>.) |
![]() ![]() | FrequencyDistribution |
Generates a frequency distribution for the specified items.
(Inherited from AFSearch.) |
![]() ![]() | FrequencyDistributionAsync |
Generates a frequency distribution for the specified items asynchronously.
(Inherited from AFSearch.) |
![]() ![]() | GetFilters() |
Get the full list of valid filters for a search query
for all servers.
|
![]() ![]() | GetFilters(PISystem) |
Get the list of valid filters for a search query
for the specified server.
|
![]() | GetHashCode | Serves as the default hash function. (Inherited from Object.) |
![]() ![]() | GetObjectFields |
Get the list of valid object fields that can used for the FindObjectFields(String, Int32, Int32)
search for the specified server.
|
![]() | GetTotalCount |
Returns the total count of the items that could be returned from the search query.
(Inherited from AFSearch<T>.) |
![]() | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() ![]() | GroupedSummary |
Generates summaries broken down by group for items matching the search criteria.
(Inherited from AFSearch.) |
![]() ![]() | GroupedSummaryAsync |
Generates summaries broken down by group for items matching the search criteria asynchronously.
(Inherited from AFSearch.) |
![]() ![]() | Histogram<TBin> |
Generates a histogram using the specified weighting for items matching this search.
(Inherited from AFSearch.) |
![]() ![]() | HistogramAsync<TBin> |
Generates a histogram using the specified weighting for items matching this search asynchronously.
(Inherited from AFSearch.) |
![]() ![]() | IsMatch |
Determines if the specified item matches the search query.
(Inherited from AFSearch<T>.) |
![]() | Refresh |
Refreshes the search that is cached in the server.
(Inherited from AFSearch.) |
![]() ![]() | Summary(String, AFSummaryTypes) |
Summarizes the result of this search.
(Inherited from AFSearch.) |
![]() | Summary(String, AFSummaryTypes, String) |
Summarizes the result of this search with the specified weighting.
(Inherited from AFSearch.) |
![]() ![]() | SummaryAsync(String, AFSummaryTypes, CancellationToken) |
Summarizes the result of this search asynchronously.
(Inherited from AFSearch.) |
![]() | SummaryAsync(String, AFSummaryTypes, String, CancellationToken) |
Summarizes the result of this search with the specified weighting asynchronously.
(Inherited from AFSearch.) |
![]() | ToString |
Returns a String that represents the current object.
(Inherited from AFSearch.) |
![]() | TryFindSearchToken | Obsolete.
Find the AFSearchToken associated with the specified AFSearchFilter.
(Inherited from AFSearch.) |
![]() | TryFindSearchTokens | Obsolete.
Find the AFSearchToken list associated with the specified AFSearchFilter.
(Inherited from AFSearch.) |
Remarks
This class provides support for query based searches for AFNotificationRuleTemplate objects. The QuerySearch feature can be checked to determine if this query search is supported.
A query string is parsed into search tokens which are used to specify the query filters for the search.
To optimize getting items from several pages of search results, a search can be cached by setting the CacheTimeout to a non-zero value. If you will only be getting items from the first page, then it is best to leave the cache disabled. The cache is disabled by default. Call the Refresh() method to refresh the results of a cached search. Use the Close() method to close a cached search when finished using it to free the memory used by the cached results in the server. Since the search implements the IDisposable interface, you can call the cached search in a using statement to automatically call the Close() method when it leaves scope.
![]() |
---|
When a query is too complex for a server, then you will get a NotSupportedException. |
Examples
1// Get the Database 2PISystems myPISystems = new PISystems(); 3PISystem myPISystem = myPISystems.DefaultPISystem; 4if (myPISystem == null) 5 throw new InvalidOperationException("Default PISystem was not found."); 6AFDatabase myDB = myPISystem.Databases[dbName]; 7if (myDB == null) 8 throw new InvalidOperationException("Database was not found."); 9 10// Create notification rule template search to find all notification 11// rule templates that have the name of NotificationRuleTemplate. 12AFNotificationRuleTemplateSearch search = new AFNotificationRuleTemplateSearch(myDB, "MyNotificationRuleTemplateSearch", "Name:'NotificationRuleTemplate'"); 13 14// When the notification rule templates are returned from a find operation, they 15// are only partially loaded into memory, typically enough to display their 16// inherent properties, such as Name, Description, Target, etc. 17// When a piece of information is accessed in the notification rule template that requires 18// more information, an RPC to the server is made to fully load the notification rule template. 19// By having the search do a full load, all information is loaded in bulk and 20// we can reduce the number of RPCs made to retrieve this information. 21int count = search.GetTotalCount(); 22Console.WriteLine("Found {0} Notification Rule Templates", count); 23foreach (var item in search.FindObjects(fullLoad: true)) 24{ 25 Console.Write("Notification Rule Template Name = {0},", item.Name); 26 Console.Write("Notification Rule Template Description = {0},", item.Description); 27 Console.Write("Notification Rule Template Target = {0}", item.Target); 28 Console.WriteLine(); 29}
1' Get the Database 2Dim myPISystems As New PISystems() 3Dim myPISystem As PISystem = myPISystems.DefaultPISystem 4If myPISystem Is Nothing Then 5 Throw New InvalidOperationException("Default PISystem was not found.") 6End If 7Dim myDB As AFDatabase = myPISystem.Databases(dbName) 8If myDB Is Nothing Then 9 Throw New InvalidOperationException("Database was not found.") 10End If 11 12' Create notification rule template search to find all notification 13' rule templates that have the name of NotificationRuleTemplate. 14Dim search As New AFNotificationRuleTemplateSearch(myDB, "MyNotificationRuleTemplateSearch", "Name:'NotificationRuleTemplate'") 15 16' When the notification rule templates are returned from a find operation, they 17' are only partially loaded into memory, typically enough to display their 18' inherent properties, such as Name, Description, Target, etc. 19' When a piece of information is accessed in the notification rule template that requires 20' more information, an RPC to the server is made to fully load the notification rule template. 21' By having the search do a full load, all information is loaded in bulk and 22' we can reduce the number of RPCs made to retrieve this information. 23Dim count As Integer = search.GetTotalCount() 24Console.WriteLine("Found {0} Notification Rule Templates", count) 25For Each item As AFNotificationRuleTemplate In search.FindObjects(fullLoad:=True) 26 Console.Write("Notification Rule Template Name = {0},", item.Name) 27 Console.Write("Notification Rule Template Description = {0},", item.Description) 28 Console.Write("Notification Rule Template Target = {0}", item.Target) 29 Console.WriteLine() 30Next
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.