C# Class TrainNotifier.Common.NMS.NMSConnector

manages connection to the Network Rail Data Feeds
Inheritance: INMSConnector
Afficher le fichier Open project: blueghostuk/trainnotifier-server

Méthodes publiques

Méthode Description
NMSConnector ( CancellationTokenSource cancellationTokenSource ) : System
Quit ( ) : void
SubscribeToFeeds ( ) : void

Subscribes to the data feeds. This method will not return until the connection is dropped or quit

Private Methods

Méthode Description
CreateConsumer ( ISession session, ITopic destination, string appendedText = null ) : IMessageConsumer

Create a message consumer to the given destination

GetConnection ( ) : IConnection

Get a connection to the data source

GetRtPPMData ( IConnection connection, CancellationToken cancellationToken, NMSConnectionMonitor connectionMonitor ) : void
GetTrainDescriberData ( IConnection connection, CancellationToken ct, NMSConnectionMonitor connectionMonitor ) : void
GetTrainMovementData ( IConnection connection, CancellationToken ct, NMSConnectionMonitor connectionMonitor ) : void
GetVSTPData ( IConnection connection, CancellationToken ct, NMSConnectionMonitor connectionMonitor ) : void
OpenAndWaitConsumer ( ISession session, ITopic topic, string appendedText, NMSConnectionMonitor connectionMonitor, MessageListener listener, CancellationToken ct ) : void

open a consumer to the given endpoint. this method wont return until the cancellation token is cancelled

ParseData ( IMessage message ) : string

attemps to read the text from a message

RaiseDataRecd ( Feed source, string text ) : void

Raise the TrainDataRecieved event

ResubscribeMechanism ( ) : void

tries to resubscribe to the data feed on error or connection dropping out

Subscribe ( ) : void

subscribes to each feed

rtppm_Listener ( IMessage message ) : void

handle a new message from the PPM Feed

tdConsumer_Listener ( IMessage message ) : void

handle a new message from the TD Feed

tmConsumer_Listener ( IMessage message ) : void

handle a new message from the TM Feed

vstpConsumer_Listener ( IMessage message ) : void

handle a new message from the VSTP Feed

Method Details

NMSConnector() public méthode

public NMSConnector ( CancellationTokenSource cancellationTokenSource ) : System
cancellationTokenSource System.Threading.CancellationTokenSource /// cancellation token to cancel on error ///
Résultat System

Quit() public méthode

public Quit ( ) : void
Résultat void

SubscribeToFeeds() public méthode

Subscribes to the data feeds. This method will not return until the connection is dropped or quit
public SubscribeToFeeds ( ) : void
Résultat void