C# Class GSF.TimeSeries.Transport.DataSubscriber

Inheritance: GSF.TimeSeries.Adapters.InputAdapterBase
Afficher le fichier Open project: GridProtectionAlliance/gsf Class Usage Examples

Private Properties

Свойство Type Description
DataSubscriber_ConnectionAuthenticated void
DataSubscriber_MetaDataReceived void
DeserializeMetadata System.Data.DataSet
DeserializeSignalIndexCache SignalIndexCache
DisconnectClient void
FixExpectedMeasurementCounts void
FromLocallySynchronizedInfo GSF.TimeSeries.Transport.UnsynchronizedSubscriptionInfo
GetAuthorizedSignalIDs System.Guid[]
GetCharacterEncoding System.Text.Encoding
GetDataGapRecoverySubscriptionStatus string
GetFramesPerSecond int
GetLocalCertificate string
GetUnauthorizedSignalIDs System.Guid[]
HandleDeviceStatisticsRegistration void
HandleSocketException bool
InitSyncProgress void
IsUserCommand bool
LocallySynchronizedSubscribe bool
OnExceededParsingExceptionThreshold void
ParseTSSCMeasurements void
ProcessServerResponse void
RefreshMetadata void
RegisterDeviceStatistics void
RemoteCertificateExists bool
RemotelySynchronizedSubscribe bool
ResetLifetimeCounters void
ResetMeasurementsPerSecondCounters void
Restart void
StartSubscription void
SubscribeToOutputMeasurements void
SubscribedDevicesTimer_Elapsed void
SynchronizedMetadataChanged bool
TryFilterOutputMeasurements void
UnregisterDeviceStatistics void
UnsynchronizedSubscribe bool
UpdateMeasurementsPerSecond void
UpdateOutputMeasurements bool
UpdateStatisticsHelpers void
UpdateSyncProgress void
m_commandChannel_ConnectionAttempt void
m_commandChannel_ConnectionEstablished void
m_commandChannel_ConnectionException void
m_commandChannel_ConnectionTerminated void
m_commandChannel_ReceiveData void
m_commandChannel_ReceiveDataException void
m_commandChannel_SendDataException void
m_dataChannel_ConnectionAttempt void
m_dataChannel_ConnectionException void
m_dataChannel_ReceiveData void
m_dataChannel_ReceiveDataException void
m_dataGapRecoverer_ProcessException void
m_dataGapRecoverer_RecoveredMeasurements void
m_dataGapRecoverer_StatusMessage void
m_dataStreamMonitor_Elapsed void
m_localConcentrator_ProcessException void
m_runTimeLog_ProcessException void

Méthodes publiques

Méthode Description
Authenticate ( string sharedSecret, string authenticationID ) : bool

Authenticates subscriber to a data publisher.

DataSubscriber ( ) : System

Creates a new DataSubscriber.

GetShortStatus ( int maxLength ) : string

Gets a short one-line status of this DataSubscriber.

Initialize ( ) : void

Initializes DataSubscriber.

SendServerCommand ( ServerCommand commandCode, byte data = null ) : bool

Sends a server command to the publisher connection.

SendServerCommand ( ServerCommand commandCode, string message ) : bool

Sends a server command to the publisher connection with associated message data.

Subscribe ( GSF.TimeSeries.Transport.SubscriptionInfo info ) : bool

Subscribes (or re-subscribes) to a data publisher for a set of data points.

Subscribe ( bool remotelySynchronized, bool compactFormat, string connectionString ) : bool

Subscribes (or re-subscribes) to a data publisher for a set of data points.

SynchronizeMetadata ( DataSet metadata ) : void

Spawn meta-data synchronization.

This method makes sure only one meta-data synchronization happens at a time.

SynchronizedSubscribe ( GSF.TimeSeries.Transport.SynchronizedSubscriptionInfo info ) : bool

Subscribes (or re-subscribes) to a data publisher for a synchronized set of data points.

Unsubscribe ( ) : bool

Unsubscribes from a data publisher.

UnsynchronizedSubscribe ( GSF.TimeSeries.Transport.UnsynchronizedSubscriptionInfo info ) : bool

Subscribes (or re-subscribes) to a data publisher for an unsynchronized set of data points.

Méthodes protégées

Méthode Description
AttemptConnection ( ) : void

Attempts to connect to this DataSubscriber.

AttemptDisconnection ( ) : void

Attempts to disconnect from this DataSubscriber.

Dispose ( bool disposing ) : void

Releases the unmanaged resources used by the DataSubscriber object and optionally releases the managed resources.

DisposeLocalConcentrator ( ) : void

Disposes of any previously defined local concentrator.

GetLoggingPath ( string filePath ) : string

Gets file path for any defined logging path.

InterpretResponseMessage ( byte buffer, int startIndex, int length ) : string

Get message from string based response.

OnConnectionAuthenticated ( ) : void

Raises the ConnectionAuthenticated event.

OnConnectionEstablished ( ) : void

Raises the ConnectionEstablished event.

OnConnectionTerminated ( ) : void

Raises the ConnectionTerminated event.

OnDataStartTime ( Ticks startTime ) : void

Raises the DataStartTime event.

OnMetaDataReceived ( DataSet metadata ) : void

Raises the MetaDataReceived event.

OnNotificationReceived ( string message ) : void

Raises the NotificationReceived event.

OnProcessException ( MessageLevel level, Exception exception, string eventName = null, MessageFlags flags = MessageFlags.None ) : void

Raises AdapterBase.ProcessException event.

OnProcessingComplete ( string source ) : void

Raises the ProcessingComplete event.

OnReceivedServerResponse ( ServerResponse responseCode, ServerCommand commandCode ) : void

Raises the ReceivedServerResponse event.

OnReceivedUserCommandResponse ( ServerCommand command, ServerResponse response, byte buffer, int startIndex, int length ) : void

Raises the ReceivedUserCommandResponse event.

OnServerConfigurationChanged ( ) : void

Raises the ServerConfigurationChanged event.

SynchronizeMetadata ( ) : void

Handles meta-data synchronization to local system.

This function should only be initiated from call to SynchronizeMetadata(DataSet) to make sure only one meta-data synchronization happens at once. Users can override this method to customize process of meta-data synchronization.

Private Methods

Méthode Description
DataSubscriber_ConnectionAuthenticated ( object sender, EventArgs e ) : void
DataSubscriber_MetaDataReceived ( object sender, EventArgs e ) : void
DeserializeMetadata ( byte buffer ) : DataSet
DeserializeSignalIndexCache ( byte buffer ) : SignalIndexCache
DisconnectClient ( ) : void
FixExpectedMeasurementCounts ( ) : void
FromLocallySynchronizedInfo ( GSF.TimeSeries.Transport.SynchronizedSubscriptionInfo info ) : GSF.TimeSeries.Transport.UnsynchronizedSubscriptionInfo
GetAuthorizedSignalIDs ( ) : System.Guid[]
GetCharacterEncoding ( OperationalEncoding operationalEncoding ) : Encoding
GetDataGapRecoverySubscriptionStatus ( ) : string
GetFramesPerSecond ( DataTable measurementTable, System.Guid signalID ) : int
GetLocalCertificate ( ) : string
GetUnauthorizedSignalIDs ( ) : System.Guid[]
HandleDeviceStatisticsRegistration ( ) : void
HandleSocketException ( Exception ex ) : bool
InitSyncProgress ( long totalActions ) : void
IsUserCommand ( ServerCommand command ) : bool
LocallySynchronizedSubscribe ( bool compactFormat, int framesPerSecond, double lagTime, double leadTime, string filterExpression, string dataChannel = null, bool useLocalClockAsRealTime = false, bool ignoreBadTimestamps = false, bool allowSortsByArrival = true, long timeResolution = Ticks.PerMillisecond, bool allowPreemptivePublishing = true, DownsamplingMethod downsamplingMethod = DownsamplingMethod.LastReceived, string startTime = null, string stopTime = null, string constraintParameters = null, int processingInterval = -1, string waitHandleNames = null, int waitHandleTimeout ) : bool
OnExceededParsingExceptionThreshold ( ) : void

Raises the ExceededParsingExceptionThreshold event.

ParseTSSCMeasurements ( byte buffer, int responseLength, int &responseIndex, List measurements ) : void
ProcessServerResponse ( byte buffer, int length ) : void
RefreshMetadata ( ) : void
RegisterDeviceStatistics ( ) : void
RemoteCertificateExists ( ) : bool
RemotelySynchronizedSubscribe ( bool compactFormat, int framesPerSecond, double lagTime, double leadTime, string filterExpression, string dataChannel = null, bool useLocalClockAsRealTime = false, bool ignoreBadTimestamps = false, bool allowSortsByArrival = true, long timeResolution = Ticks.PerMillisecond, bool allowPreemptivePublishing = true, DownsamplingMethod downsamplingMethod = DownsamplingMethod.LastReceived, string startTime = null, string stopTime = null, string constraintParameters = null, int processingInterval = -1, string waitHandleNames = null, int waitHandleTimeout ) : bool
ResetLifetimeCounters ( ) : void
ResetMeasurementsPerSecondCounters ( ) : void
Restart ( ) : void
StartSubscription ( ) : void
SubscribeToOutputMeasurements ( bool metaDataRefreshCompleted ) : void
SubscribedDevicesTimer_Elapsed ( object sender, EventArgs elapsedEventArgs ) : void
SynchronizedMetadataChanged ( DataSet newSynchronizedMetadata ) : bool
TryFilterOutputMeasurements ( ) : void
UnregisterDeviceStatistics ( ) : void
UnsynchronizedSubscribe ( bool compactFormat, bool throttled, string filterExpression, string dataChannel = null, bool includeTime = true, double lagTime = 10.0D, double leadTime = 5.0D, bool useLocalClockAsRealTime = false, string startTime = null, string stopTime = null, string constraintParameters = null, int processingInterval = -1, string waitHandleNames = null, int waitHandleTimeout ) : bool
UpdateMeasurementsPerSecond ( System.DateTime now, int measurementCount ) : void
UpdateOutputMeasurements ( bool initialCall = false ) : bool
UpdateStatisticsHelpers ( ) : void
UpdateSyncProgress ( ) : void
m_commandChannel_ConnectionAttempt ( object sender, EventArgs e ) : void
m_commandChannel_ConnectionEstablished ( object sender, EventArgs e ) : void
m_commandChannel_ConnectionException ( object sender, EventArgs e ) : void
m_commandChannel_ConnectionTerminated ( object sender, EventArgs e ) : void
m_commandChannel_ReceiveData ( object sender, EventArgs e ) : void
m_commandChannel_ReceiveDataException ( object sender, EventArgs e ) : void
m_commandChannel_SendDataException ( object sender, EventArgs e ) : void
m_dataChannel_ConnectionAttempt ( object sender, EventArgs e ) : void
m_dataChannel_ConnectionException ( object sender, EventArgs e ) : void
m_dataChannel_ReceiveData ( object sender, EventArgs e ) : void
m_dataChannel_ReceiveDataException ( object sender, EventArgs e ) : void
m_dataGapRecoverer_ProcessException ( object sender, EventArgs e ) : void
m_dataGapRecoverer_RecoveredMeasurements ( object sender, EventArgs e ) : void
m_dataGapRecoverer_StatusMessage ( object sender, EventArgs e ) : void
m_dataStreamMonitor_Elapsed ( object sender, EventArgs e ) : void
m_localConcentrator_ProcessException ( object sender, EventArgs e ) : void
m_runTimeLog_ProcessException ( object sender, EventArgs e ) : void

Method Details

AttemptConnection() protected méthode

Attempts to connect to this DataSubscriber.
protected AttemptConnection ( ) : void
Résultat void

AttemptDisconnection() protected méthode

Attempts to disconnect from this DataSubscriber.
protected AttemptDisconnection ( ) : void
Résultat void

Authenticate() public méthode

Authenticates subscriber to a data publisher.
public Authenticate ( string sharedSecret, string authenticationID ) : bool
sharedSecret string Shared secret used to look up private crypto key and initialization vector.
authenticationID string Authentication ID that publisher will use to validate subscriber identity.
Résultat bool

DataSubscriber() public méthode

Creates a new DataSubscriber.
public DataSubscriber ( ) : System
Résultat System

Dispose() protected méthode

Releases the unmanaged resources used by the DataSubscriber object and optionally releases the managed resources.
protected Dispose ( bool disposing ) : void
disposing bool true to release both managed and unmanaged resources; false to release only unmanaged resources.
Résultat void

DisposeLocalConcentrator() protected méthode

Disposes of any previously defined local concentrator.
protected DisposeLocalConcentrator ( ) : void
Résultat void

GetLoggingPath() protected méthode

Gets file path for any defined logging path.
protected GetLoggingPath ( string filePath ) : string
filePath string Path to acquire within logging path.
Résultat string

GetShortStatus() public méthode

Gets a short one-line status of this DataSubscriber.
public GetShortStatus ( int maxLength ) : string
maxLength int Maximum length of the status message.
Résultat string

Initialize() public méthode

Initializes DataSubscriber.
public Initialize ( ) : void
Résultat void

InterpretResponseMessage() protected méthode

Get message from string based response.
protected InterpretResponseMessage ( byte buffer, int startIndex, int length ) : string
buffer byte Response buffer.
startIndex int Start index of response message.
length int Length of response message.
Résultat string

OnConnectionAuthenticated() protected méthode

Raises the ConnectionAuthenticated event.
protected OnConnectionAuthenticated ( ) : void
Résultat void

OnConnectionEstablished() protected méthode

Raises the ConnectionEstablished event.
protected OnConnectionEstablished ( ) : void
Résultat void

OnConnectionTerminated() protected méthode

Raises the ConnectionTerminated event.
protected OnConnectionTerminated ( ) : void
Résultat void

OnDataStartTime() protected méthode

Raises the DataStartTime event.
protected OnDataStartTime ( Ticks startTime ) : void
startTime Ticks Start time, in , of first measurement transmitted.
Résultat void

OnMetaDataReceived() protected méthode

Raises the MetaDataReceived event.
protected OnMetaDataReceived ( DataSet metadata ) : void
metadata System.Data.DataSet Meta-data instance to send to client subscription.
Résultat void

OnNotificationReceived() protected méthode

Raises the NotificationReceived event.
protected OnNotificationReceived ( string message ) : void
message string Message for the notification.
Résultat void

OnProcessException() protected méthode

Raises AdapterBase.ProcessException event.
protected OnProcessException ( MessageLevel level, Exception exception, string eventName = null, MessageFlags flags = MessageFlags.None ) : void
level MessageLevel The to assign to this message
exception System.Exception Processing .
eventName string A fixed string to classify this event; defaults to null.
flags MessageFlags to use, if any; defaults to .
Résultat void

OnProcessingComplete() protected méthode

Raises the ProcessingComplete event.
protected OnProcessingComplete ( string source ) : void
source string Type name of adapter that sent the processing completed notification.
Résultat void

OnReceivedServerResponse() protected méthode

Raises the ReceivedServerResponse event.
protected OnReceivedServerResponse ( ServerResponse responseCode, ServerCommand commandCode ) : void
responseCode ServerResponse Response received from the server.
commandCode ServerCommand Command that the server responded to.
Résultat void

OnReceivedUserCommandResponse() protected méthode

Raises the ReceivedUserCommandResponse event.
protected OnReceivedUserCommandResponse ( ServerCommand command, ServerResponse response, byte buffer, int startIndex, int length ) : void
command ServerCommand The code for the user command.
response ServerResponse The code for the server's response.
buffer byte Buffer containing the message from the server.
startIndex int Index into the buffer used to skip the header.
length int The length of the message in the buffer, including the header.
Résultat void

OnServerConfigurationChanged() protected méthode

Raises the ServerConfigurationChanged event.
protected OnServerConfigurationChanged ( ) : void
Résultat void

SendServerCommand() public méthode

Sends a server command to the publisher connection.
public SendServerCommand ( ServerCommand commandCode, byte data = null ) : bool
commandCode ServerCommand to send.
data byte Optional command data to send.
Résultat bool

SendServerCommand() public méthode

Sends a server command to the publisher connection with associated message data.
public SendServerCommand ( ServerCommand commandCode, string message ) : bool
commandCode ServerCommand to send.
message string String based command data to send to server.
Résultat bool

Subscribe() public méthode

Subscribes (or re-subscribes) to a data publisher for a set of data points.
public Subscribe ( GSF.TimeSeries.Transport.SubscriptionInfo info ) : bool
info GSF.TimeSeries.Transport.SubscriptionInfo Configuration object that defines the subscription.
Résultat bool

Subscribe() public méthode

Subscribes (or re-subscribes) to a data publisher for a set of data points.
public Subscribe ( bool remotelySynchronized, bool compactFormat, string connectionString ) : bool
remotelySynchronized bool Boolean value that determines if subscription should be remotely synchronized - note that data publisher may not allow remote synchronization.
compactFormat bool Boolean value that determines if the compact measurement format should be used. Set to false for full fidelity measurement serialization; otherwise set to true for bandwidth conservation.
connectionString string Connection string that defines required and optional parameters for the subscription.
Résultat bool

SynchronizeMetadata() protected méthode

Handles meta-data synchronization to local system.
This function should only be initiated from call to SynchronizeMetadata(DataSet) to make sure only one meta-data synchronization happens at once. Users can override this method to customize process of meta-data synchronization.
protected SynchronizeMetadata ( ) : void
Résultat void

SynchronizeMetadata() public méthode

Spawn meta-data synchronization.
This method makes sure only one meta-data synchronization happens at a time.
public SynchronizeMetadata ( DataSet metadata ) : void
metadata System.Data.DataSet to use for synchronization.
Résultat void

SynchronizedSubscribe() public méthode

Subscribes (or re-subscribes) to a data publisher for a synchronized set of data points.
public SynchronizedSubscribe ( GSF.TimeSeries.Transport.SynchronizedSubscriptionInfo info ) : bool
info GSF.TimeSeries.Transport.SynchronizedSubscriptionInfo Configuration object that defines the subscription.
Résultat bool

Unsubscribe() public méthode

Unsubscribes from a data publisher.
public Unsubscribe ( ) : bool
Résultat bool

UnsynchronizedSubscribe() public méthode

Subscribes (or re-subscribes) to a data publisher for an unsynchronized set of data points.
public UnsynchronizedSubscribe ( GSF.TimeSeries.Transport.UnsynchronizedSubscriptionInfo info ) : bool
info GSF.TimeSeries.Transport.UnsynchronizedSubscriptionInfo Configuration object that defines the subscription.
Résultat bool