Click or drag to resize
OSIsoft, LLC

AFTimeBasedEventSource Class

The AFTimeBasedEventSource is a base class that can be used for data references which do not natively support streaming events for an AFDataPipe but supports RecordedValues(AFTimeRange, AFBoundaryType, UOM, String, Boolean, Int32). AFTimeBasedEventSource periodically polls data from AFAttribute in the pipe and caches the result. When the GetUpdateEvents/GetObserverEvents of the pipe is called, AFTimeBasedEventSource extracts the events up to current time + EventHorizonOffset from its cache to be returned to the caller.
Inheritance Hierarchy

Namespace:  OSIsoft.AF.Data
Assembly:  OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version:
public class AFTimeBasedEventSource : IDisposable

The AFTimeBasedEventSource type exposes the following members.

Public methodAFTimeBasedEventSource
Creates a new event source
Public methodDispose
Cleans up resources
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)

Data Reference needs to provide a static method CreateDataPipe that returns an AFTimeBasedEventSource object. AFTimeBasedEventSource has the following virtual methods that the implementor can override: Dispose(bool), GetDataFromSource and ValidateStream. GetDataFromSource in the base class would enumerate through all the signup attributes and retrieve data into its cache. Implementor can override this method if there are more efficient way to retrieve data (like a list bulk call). After retrieved data for the AFAttributes, the GetDataFromSource method will need to call the protected PublishToCache method to save the result into AFTimeBasedEventSource's data cache. ValidateStream in the base class will check if the passed AFAttribute supports RecordedValues.

User of the AFTimeBasedEventSource can also adjust the data retrieval time span. Default time span is two minutes.

Version Information


Supported in: 2.10.5, 2.10, 2.9.5, 2.9, 2.8.5, 2.8, 2.7.5, 2.7
See Also
Enabling Operational Intelligence