DataSource.NET  6.2.20.310828
Caplin.DataSource.DataSource Class Reference

This is the main class in Datasource.NET. Your application must create an instance of this class to use the functionality provided by DataSource More...

Inheritance diagram for Caplin.DataSource.DataSource:
Caplin.DataSource.IDataSource

Public Member Functions

void AddChannelListener (INamespace nspace, Caplin.DataSource.Channel.IChannelListener listener)
 Registers an IChannelListener for the specified namespace. More...
 
void AddConnectionListener (IConnectionListener listener)
 Adds a connection listener that receives status events about the state of the DataSource application's connection to other peers. More...
 
void AddGenericChannelListener (INamespace nspace, Caplin.DataSource.Channel.IChannelListener listener)
 Registers an IChannelListener for the specified namespace. Use for Generic Messages More...
 
IActivePublisher CreateActivePublisher (INamespace nameSpace, IDataProvider provider)
 Creates a multiple request single discard publisher for the specified namespace. More...
 
IActiveSubscription CreateActiveSubscription (string subject, ISubscriptionListener listener)
 Creates an active subscription to an individual subject. More...
 
IBroadcastPublisher CreateBroadcastPublisher (INamespace nameSpace)
 Creates a broadcast publisher for the specified namespace. More...
 
IBroadcastSubscription CreateBroadcastSubscription (INamespace nspace, ISubscriptionListener listener)
 Creates a subscription to many subjects. The scope of the subscription is defined by a namespace. More...
 
ICompatibilityPublisher CreateCompatibilityPublisher (INamespace nameSpace, IDataProvider provider)
 Creates a multiple request and multiple discard publisher for the specified namespace. More...
 
 DataSource (string configFile)
 Initializes a new instance of the DataSource class that logs events to a configurable log file. More...
 
 DataSource (string configFile, string[] arguments)
 Initializes a new instance of the DataSource class that logs events to a configurable log file. More...
 
 DataSource (string configFile, ILogger logger)
 Initializes a new instance of the DataSource class that logs events to an implementation of the ILogger class. More...
 
 DataSource (string configFile, string[] arguments, ILogger logger)
 Initializes a new instance of the DataSource class that logs events to an implementation of the ILogger class. More...
 
void RemoveConnectionListener (IConnectionListener listener)
 Removes a previously registered connection listener. More...
 
void SetStatusDown ()
 Sets the status of this DataSource application to down. More...
 
void SetStatusUp ()
 Sets the status of this DataSource application to up. More...
 
void Start ()
 Starts this DataSource. More...
 
void Stop ()
 Stops this DataSource. More...
 
- Public Member Functions inherited from Caplin.DataSource.IDataSource
void AddChannelListener (INamespace nspace, IChannelListener listener)
 Registers an IChannelListener for the specified namespace. More...
 

Properties

IFieldManager FieldManager [get]
 Provides access to the Field Manager associated with this DataSource. More...
 
ILogger Logger [get, set]
 Gets or sets the logger used by DataSource.NET More...
 
IMonitoringServer MonitoringServer [get]
 Gets the monitoring server for this DataSource. More...
 
IList< IPeerPeers [get]
 Gets a list of all the configured DataSource peers. More...
 
- Properties inherited from Caplin.DataSource.IDataSource
IFieldManager FieldManager [get]
 Provides access to the Field Manager associated with this DataSource. More...
 
ILogger Logger [get, set]
 Gets or sets the logger used by DataSource.NET More...
 
IMonitoringServer MonitoringServer [get]
 Gets the monitoring server for this DataSource. More...
 
IList< IPeerPeers [get]
 Gets a list of all the configured DataSource peers. More...
 

Detailed Description

This is the main class in Datasource.NET. Your application must create an instance of this class to use the functionality provided by DataSource

Your DataSource application must create just a single instance of this class. An attempt to create a second instance within the application will result in an Exception being raised.

If your application is running within the Deployment Framework then you should construct this object using a constructor which takes an arguments parameter: The Deployment Framework may call into your application to obtain configuration properties appropriate for the environment.

Note:The current (execution) directory must contain a subdirectory called var. If this subdirectory does not exist when the DataSource is constructed DataSource.NET will exit.

Constructor & Destructor Documentation

Caplin.DataSource.DataSource.DataSource ( string  configFile)
inline

Initializes a new instance of the DataSource class that logs events to a configurable log file.

Parameters
configFileThe configuration file for this DataSource application.

Only a single instance of Caplin.DataSource.DataSource can be created.

The configuration file defines the configuration of the DataSource library. Its contents must be in the standard DataSource "conf" file format; see Configuration. This constructor instantiates a DataSource with a logger that will direct all log messages to the log file belonging to DataSource.NET.

The name of the log file can be defined using the event-log configuration item. The log cycle period can be configured using the add-log configuration section. For more information, see the section of the Liberator Administration Guide on “Advanced log file settings”.

namespace DataSourceExamples.Basics
{
public class ConstructDataSource
{
public static void ConstructDataSourceExample()
{
// Construct a DataSource instance using the configuration file "datasource.conf".
DataSource dataSource = new DataSource("datasource.conf");
}
}
}
Caplin.DataSource.DataSource.DataSource ( string  configFile,
string[]  arguments 
)
inline

Initializes a new instance of the DataSource class that logs events to a configurable log file.

Parameters
configFileThe configuration file for this DataSource application.
argumentsAny command line arguments.

Only a single instance of Caplin.DataSource.DataSource can be created.

The configuration file defines the configuration of the DataSource library. Its contents must be in the standard DataSource "conf" file format; see Configuration. This constructor instantiates a DataSource with a logger that will direct all log messages to the log file belonging to DataSource.NET.

The name of the log file can be defined using the event-log configuration item. The log cycle period can be configured using the add-log configuration section. For more information, see the section of the Liberator Administration Guide on “Advanced log file settings”.

namespace DataSourceExamples.Basics
{
public class ConstructDataSource
{
public static void ConstructDataSourceExample()
{
// Construct a DataSource instance using the configuration file "datasource.conf".
DataSource dataSource = new DataSource("datasource.conf");
}
}
}
Caplin.DataSource.DataSource.DataSource ( string  configFile,
ILogger  logger 
)
inline

Initializes a new instance of the DataSource class that logs events to an implementation of the ILogger class.

Parameters
configFileThe configuration file for this DataSource application.
loggerAn implementation of ILogger to which DataSource events will be logged.

Only a single instance of Caplin.DataSource.DataSource can be created.

The configuration file defines the configuration of the DataSource library. Its contents must be in the standard DataSource "conf" file format; see Configuration.

If you want the DataSource to log events to a standard (configurable) DataSource log file, use the DataSource(configFile) constructor instead.

Caplin.DataSource.DataSource.DataSource ( string  configFile,
string[]  arguments,
ILogger  logger 
)
inline

Initializes a new instance of the DataSource class that logs events to an implementation of the ILogger class.

Parameters
configFileThe configuration file for this DataSource application.
argumentsAny command line arguments.
loggerAn implementation of ILogger to which DataSource events will be logged.

Only a single instance of Caplin.DataSource.DataSource can be created.

The configuration file defines the configuration of the DataSource library. Its contents must be in the standard DataSource "conf" file format; see Configuration.

If you want the DataSource to log events to a standard (configurable) DataSource log file, use the DataSource(configFile) constructor instead.

Member Function Documentation

void Caplin.DataSource.DataSource.AddChannelListener ( INamespace  nspace,
Caplin.DataSource.Channel.IChannelListener  listener 
)
inline

Registers an IChannelListener for the specified namespace.

Parameters
nspaceThe namespace defining the subjects within the channel.
listenerA listener to receive events related to the channel.
void Caplin.DataSource.DataSource.AddConnectionListener ( IConnectionListener  listener)
inline

Adds a connection listener that receives status events about the state of the DataSource application's connection to other peers.

Parameters
listenerThe IConnectionListener to be registered

Once registered, the IConnectionListener will receive event updates whenever the connect status has changed (for details see the description of

See also
IConnectionListener

).

You can register more than one IConnectionListener with DataSource. Each registered IConnectionListener will receive events for changes to all peers' connection statuses.

Implements Caplin.DataSource.IDataSource.

void Caplin.DataSource.DataSource.AddGenericChannelListener ( INamespace  nspace,
Caplin.DataSource.Channel.IChannelListener  listener 
)
inline

Registers an IChannelListener for the specified namespace. Use for Generic Messages

Parameters
nspaceThe namespace defining the subjects within the channel.
listenerA listener to receive events related to the channel.

Implements Caplin.DataSource.IDataSource.

IActivePublisher Caplin.DataSource.DataSource.CreateActivePublisher ( INamespace  nameSpace,
IDataProvider  provider 
)
inline

Creates a multiple request single discard publisher for the specified namespace.

Parameters
nameSpaceThe namespace (see remarks).
providerYour implementation of IDataProvider that the publisher will call.
Returns
A multiple request single discard publisher for the supplied namespace.

An IMultipleRequestSingleDiscardPublisher publishes updates that are for subjects within the specified INamespace, to all peers that have subscribed to those subjects. Because it does not maintain a cache, this publisher passes all requests and discards for such subjects on to the IDataProvider.

Implements Caplin.DataSource.IDataSource.

IActiveSubscription Caplin.DataSource.DataSource.CreateActiveSubscription ( string  subject,
ISubscriptionListener  listener 
)
inline

Creates an active subscription to an individual subject.

Parameters
subjectThe subject to subscribe to.
listenerA listener to receive events raised for the IBroadcastSubscription.
Returns
An IActiveSubscription that represents the subscription to the subject.

If a data service has been configured that matches the given subject and active peers within that data service are connected, a request will be made to those peers for the specified subject.

Implements Caplin.DataSource.IDataSource.

IBroadcastPublisher Caplin.DataSource.DataSource.CreateBroadcastPublisher ( INamespace  nameSpace)
inline

Creates a broadcast publisher for the specified namespace.

Parameters
nameSpaceThe namespace (see remarks).
Returns
A broadcast publisher

An IBroadcastPublisher permits a DataSource to broadcast, to all connected peers, updates that are for subjects within the specified INamespace

Implements Caplin.DataSource.IDataSource.

IBroadcastSubscription Caplin.DataSource.DataSource.CreateBroadcastSubscription ( INamespace  nspace,
ISubscriptionListener  listener 
)
inline

Creates a subscription to many subjects. The scope of the subscription is defined by a namespace.

Parameters
nspaceThe namespace defining the subjects to subscribe to.
listenerA listener to receive events raised for the IBroadcastSubscription.
Returns
An IBroadcastSubscription

All events whose subjects match the namespace defined by the given INameSpace will be passed to the given ISubscriptionListener.

Implements Caplin.DataSource.IDataSource.

ICompatibilityPublisher Caplin.DataSource.DataSource.CreateCompatibilityPublisher ( INamespace  nameSpace,
IDataProvider  provider 
)
inline

Creates a multiple request and multiple discard publisher for the specified namespace.

Parameters
nameSpaceThe namespace (see remarks).
providerYour implementation of IDataProvider that the publisher will call.
Returns
A simple publisher for the supplied namespace.

An IMultipleRequestMultipleDiscardPublisher publishes updates that are for subjects within the specified INamespace, to all peers that have subscribed to those subjects. Because it does not maintain a cache, this publisher passes all requests and discards for such subjects on to the IDataProvider.

Implements Caplin.DataSource.IDataSource.

void Caplin.DataSource.DataSource.RemoveConnectionListener ( IConnectionListener  listener)
inline

Removes a previously registered connection listener.

Parameters
listenerThe IConnectionListener to be deregistered.

Once removed, the IConnectionListener will no longer receive event updates whenever the connection status has changed.

Implements Caplin.DataSource.IDataSource.

void Caplin.DataSource.DataSource.SetStatusDown ( )
inline

Sets the status of this DataSource application to down.

Calling this method will cause this DataSource to stop connection attempts to other DataSource peers, close any existing connections and reject any connection attempts from DataSource peers.

Implements Caplin.DataSource.IDataSource.

void Caplin.DataSource.DataSource.SetStatusUp ( )
inline

Sets the status of this DataSource application to up.

Calling this method will cause this DataSource to start connection attempts to other DataSource peers and allow connection attempts from remote DataSource peers.

Implements Caplin.DataSource.IDataSource.

void Caplin.DataSource.DataSource.Start ( )
inline

Starts this DataSource.

Following a call to this method, DataSource.NET will start connecting to its peers.

This call will immediately return with DataSource running in a background thread. You should take care to ensure that your application does not exit immediately after calling Start().

Implements Caplin.DataSource.IDataSource.

void Caplin.DataSource.DataSource.Stop ( )
inline

Stops this DataSource.

Following a call to this method, DataSource.NET will disconnect from all of its peers.

Implements Caplin.DataSource.IDataSource.

Property Documentation

IFieldManager Caplin.DataSource.DataSource.FieldManager
get

Provides access to the Field Manager associated with this DataSource.

The returned Field Manager provides access to the field definitions. These are defined in the DataSource configuration file using the format add-field <FieldName> <FieldNumber>.

ILogger Caplin.DataSource.DataSource.Logger
getset

Gets or sets the logger used by DataSource.NET

The logger.

IMonitoringServer Caplin.DataSource.DataSource.MonitoringServer
get

Gets the monitoring server for this DataSource.

Using the monitoring server it is possible to publish attributes and expose operations over, for example, JMX.

IList<IPeer> Caplin.DataSource.DataSource.Peers
get

Gets a list of all the configured DataSource peers.

This method is provided to allow a DataSource application to control the connectivity of individual peers, and for information purposes.

The configured peers.


Generated on Wed Jan 24 2018 12:22:40 for DataSource.NET