C# Класс GSF.TimeSeries.Transport.DataSubscriber

Наследование: GSF.TimeSeries.Adapters.InputAdapterBase
Показать файл Открыть проект Примеры использования класса

Private Properties

Свойство Тип Описание
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

Открытые методы

Метод Описание
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.

Защищенные методы

Метод Описание
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.

Приватные методы

Метод Описание
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

Описание методов

AttemptConnection() защищенный Метод

Attempts to connect to this DataSubscriber.
protected AttemptConnection ( ) : void
Результат void

AttemptDisconnection() защищенный Метод

Attempts to disconnect from this DataSubscriber.
protected AttemptDisconnection ( ) : void
Результат void

Authenticate() публичный Метод

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.
Результат bool

DataSubscriber() публичный Метод

Creates a new DataSubscriber.
public DataSubscriber ( ) : System
Результат System

Dispose() защищенный Метод

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.
Результат void

DisposeLocalConcentrator() защищенный Метод

Disposes of any previously defined local concentrator.
protected DisposeLocalConcentrator ( ) : void
Результат void

GetLoggingPath() защищенный Метод

Gets file path for any defined logging path.
protected GetLoggingPath ( string filePath ) : string
filePath string Path to acquire within logging path.
Результат string

GetShortStatus() публичный Метод

Gets a short one-line status of this DataSubscriber.
public GetShortStatus ( int maxLength ) : string
maxLength int Maximum length of the status message.
Результат string

Initialize() публичный Метод

Initializes DataSubscriber.
public Initialize ( ) : void
Результат void

InterpretResponseMessage() защищенный Метод

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.
Результат string

OnConnectionAuthenticated() защищенный Метод

Raises the ConnectionAuthenticated event.
protected OnConnectionAuthenticated ( ) : void
Результат void

OnConnectionEstablished() защищенный Метод

Raises the ConnectionEstablished event.
protected OnConnectionEstablished ( ) : void
Результат void

OnConnectionTerminated() защищенный Метод

Raises the ConnectionTerminated event.
protected OnConnectionTerminated ( ) : void
Результат void

OnDataStartTime() защищенный Метод

Raises the DataStartTime event.
protected OnDataStartTime ( Ticks startTime ) : void
startTime Ticks Start time, in , of first measurement transmitted.
Результат void

OnMetaDataReceived() защищенный Метод

Raises the MetaDataReceived event.
protected OnMetaDataReceived ( DataSet metadata ) : void
metadata System.Data.DataSet Meta-data instance to send to client subscription.
Результат void

OnNotificationReceived() защищенный Метод

Raises the NotificationReceived event.
protected OnNotificationReceived ( string message ) : void
message string Message for the notification.
Результат void

OnProcessException() защищенный Метод

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 .
Результат void

OnProcessingComplete() защищенный Метод

Raises the ProcessingComplete event.
protected OnProcessingComplete ( string source ) : void
source string Type name of adapter that sent the processing completed notification.
Результат void

OnReceivedServerResponse() защищенный Метод

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.
Результат void

OnReceivedUserCommandResponse() защищенный Метод

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.
Результат void

OnServerConfigurationChanged() защищенный Метод

Raises the ServerConfigurationChanged event.
protected OnServerConfigurationChanged ( ) : void
Результат void

SendServerCommand() публичный Метод

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.
Результат bool

SendServerCommand() публичный Метод

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.
Результат bool

Subscribe() публичный Метод

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.
Результат bool

Subscribe() публичный Метод

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.
Результат bool

SynchronizeMetadata() защищенный Метод

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
Результат void

SynchronizeMetadata() публичный Метод

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.
Результат void

SynchronizedSubscribe() публичный Метод

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.
Результат bool

Unsubscribe() публичный Метод

Unsubscribes from a data publisher.
public Unsubscribe ( ) : bool
Результат bool

UnsynchronizedSubscribe() публичный Метод

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.
Результат bool