Table of Contents

Class SmartDataDistribution

Namespace
MASES.DataDistributionManager.Bindings
Assembly
DataDistributionManagerNet.dll

Main class to activate Data Distribution Manager

public class SmartDataDistribution : ISmartDataDistribution, ISmartDataDistributionMastership
Inheritance
SmartDataDistribution
Implements
Inherited Members

Constructors

SmartDataDistribution()

Initialize a new SmartDataDistribution

public SmartDataDistribution()

Properties

MastershipLib

Return the mastership library in use

public string MastershipLib { get; }

Property Value

string

MastershipManager

public ISmartDataDistributionMastership MastershipManager { get; }

Property Value

ISmartDataDistributionMastership

Protocol

Return the protocol in use

public string Protocol { get; }

Property Value

string

ProtocolLib

Return the protocol library in use

public string ProtocolLib { get; }

Property Value

string

Methods

CreateSmartChannel<T>(string, IConfiguration, DDM_CHANNEL_DIRECTION)

Creates a channel with IConfiguration

public T CreateSmartChannel<T>(string channelName, IConfiguration configuration = null, DDM_CHANNEL_DIRECTION direction = DDM_CHANNEL_DIRECTION.ALL) where T : SmartDataDistributionChannel

Parameters

channelName string

The channel name

configuration IConfiguration

The configuration coming from an instance of IConfiguration

direction DDM_CHANNEL_DIRECTION

The DDM_CHANNEL_DIRECTION. Default is ALL

Returns

T

An allocated instance of T

Type Parameters

T

A Type which inherits SmartDataDistributionChannel

CreateSmartChannel<T>(string, string[], DDM_CHANNEL_DIRECTION)

Creates a channel

public T CreateSmartChannel<T>(string channelName, string[] arrayParams, DDM_CHANNEL_DIRECTION direction = DDM_CHANNEL_DIRECTION.ALL) where T : SmartDataDistributionChannel

Parameters

channelName string

The channel name

arrayParams string[]

Specific parameters which override main parameters

direction DDM_CHANNEL_DIRECTION

The DDM_CHANNEL_DIRECTION. Default is ALL

Returns

T

An allocated instance of T

Type Parameters

T

A Type which inherits SmartDataDistributionChannel

~SmartDataDistribution()

Finalizer

protected ~SmartDataDistribution()

GetParameter(DDM_GENERAL_PARAMETER)

Get global parameter

public string GetParameter(DDM_GENERAL_PARAMETER paramId)

Parameters

paramId DDM_GENERAL_PARAMETER

DDM_GENERAL_PARAMETER parameter to get

Returns

string

Parameter value

GetParameter(string)

Get global parameter

public string GetParameter(string paramName)

Parameters

paramName string

Parameter to get

Returns

string

Parameter value

Initialize(IConfiguration, string, string)

Initialize the instance using a configuration instance

public OPERATION_RESULT Initialize(IConfiguration configuration, string szMyAddress = null, string channelTrailer = null)

Parameters

configuration IConfiguration

The configuration coming from an instance of IConfiguration

szMyAddress string

The name of the server hosting the process

channelTrailer string

Trailer string to append on channel names

Returns

OPERATION_RESULT

OPERATION_RESULT

Initialize(string, string, string)

Initialize the instance using configuration file

public OPERATION_RESULT Initialize(string conf_file, string szMyAddress = null, string channelTrailer = null)

Parameters

conf_file string

Configuration file to use

szMyAddress string

The name of the server hosting the process

channelTrailer string

Trailer string to append on channel names

Returns

OPERATION_RESULT

OPERATION_RESULT

Initialize(string[], string, string)

Initialize the instance using a set of key=value pairs

public OPERATION_RESULT Initialize(string[] arrayParams, string szMyAddress = null, string channelTrailer = null)

Parameters

arrayParams string[]

array of key=value parameters

szMyAddress string

The name of the server hosting the process

channelTrailer string

Trailer string to append on channel names

Returns

OPERATION_RESULT

OPERATION_RESULT

OnChangedState(DDM_INSTANCE_STATE)

The state has changed

public virtual void OnChangedState(DDM_INSTANCE_STATE newState)

Parameters

newState DDM_INSTANCE_STATE

New state

OnChangingState(DDM_INSTANCE_STATE, DDM_INSTANCE_STATE)

The state is starting to change

public virtual void OnChangingState(DDM_INSTANCE_STATE oldState, DDM_INSTANCE_STATE newState)

Parameters

oldState DDM_INSTANCE_STATE

Old state

newState DDM_INSTANCE_STATE

New state

OnClusterStateChange(DDM_CLUSTEREVENT, long)

The cluster has changed its state

public virtual void OnClusterStateChange(DDM_CLUSTEREVENT change, long serverid)

Parameters

change DDM_CLUSTEREVENT

New state

serverid long

Server has changed state

OnCompletelyDisconnected(string, string)

Called when a critical condition disconnects the instance from the server

public virtual void OnCompletelyDisconnected(string channelName, string reason)

Parameters

channelName string

The channel name

reason string

Disconnection reason

OnConfiguration(string, string, string)

Called when a configuration parameter shall be checked

public virtual string OnConfiguration(string channelName, string key, string value)

Parameters

channelName string

The channel requesting. null for global parameters

key string

The parameter key

value string

The parameter value

Returns

string

The new value associated to the key

OnFirstStateChange(DDM_INSTANCE_STATE)

Called the first time there is state change

public virtual void OnFirstStateChange(DDM_INSTANCE_STATE newState)

Parameters

newState DDM_INSTANCE_STATE

New state

OnLogging(DDM_LOG_LEVEL, string, string, string)

Called when a log is emitted

public virtual void OnLogging(DDM_LOG_LEVEL level, string source, string function, string errStr)

Parameters

level DDM_LOG_LEVEL

Log level

source string

The source of the log

function string

The function

errStr string

The log string

OnMultiplePrimary(long, long)

There are multiple primary server in the cluster

public virtual void OnMultiplePrimary(long myId, long otherId)

Parameters

myId long

My identifier

otherId long

Other identifier which is primary

OnRequestedState(IntPtr, IntPtr)

Called when a state transfer was requested

public virtual void OnRequestedState(IntPtr buffer, IntPtr len)

Parameters

buffer IntPtr

Pointer to the buffer

len IntPtr

Length of the buffer

OnStateChange(DDM_INSTANCE_STATE, DDM_INSTANCE_STATE)

My state has changed

public virtual void OnStateChange(DDM_INSTANCE_STATE newState, DDM_INSTANCE_STATE oldState)

Parameters

newState DDM_INSTANCE_STATE

New state

oldState DDM_INSTANCE_STATE

Old state

OnStateReady(IntPtr, long)

The state is ready to be used

public virtual void OnStateReady(IntPtr buffer, long len)

Parameters

buffer IntPtr

The buffer receiver

len long

Length of the received buffer

RequestMastershipManager(IConfiguration, string)

Request to allocate mastership manager

public OPERATION_RESULT RequestMastershipManager(IConfiguration parameters = null, string serverName = null)

Parameters

parameters IConfiguration

The configuration coming from an instance of IConfiguration

serverName string

The server name

Returns

OPERATION_RESULT

OPERATION_RESULT

RequestMastershipManager(string[], string)

Request to allocate mastership manager

public OPERATION_RESULT RequestMastershipManager(string[] parameters, string serverName = null)

Parameters

parameters string[]

Paramaters to send to underlying layer

serverName string

The server name

Returns

OPERATION_RESULT

OPERATION_RESULT

SetParameter(DDM_GENERAL_PARAMETER, string)

Set global parameter

public void SetParameter(DDM_GENERAL_PARAMETER paramId, string paramValue)

Parameters

paramId DDM_GENERAL_PARAMETER

DDM_GENERAL_PARAMETER parameter to set

paramValue string

Value to set

SetParameter(string, string)

Set global parameter

public void SetParameter(string paramName, string paramValue)

Parameters

paramName string

Parameter to set

paramValue string

Value to set

Start(uint)

Starts the manager

public OPERATION_RESULT Start(uint timeout)

Parameters

timeout uint

Timeout in ms

Returns

OPERATION_RESULT

OPERATION_RESULT

Stop(uint)

Stops the manager

public OPERATION_RESULT Stop(uint timeout)

Parameters

timeout uint

Timeout in ms

Returns

OPERATION_RESULT

OPERATION_RESULT

Events

ChangedStateEvent

The state has changed

public event EventHandler<ChangedStateEventArgs> ChangedStateEvent

Event Type

EventHandler<ChangedStateEventArgs>

ChangingStateEvent

The state is starting to change

public event EventHandler<ChangingStateEventArgs> ChangingStateEvent

Event Type

EventHandler<ChangingStateEventArgs>

ClusterStateChangeEvent

The cluster has changed its state

public event EventHandler<ClusterStateChangeEventArgs> ClusterStateChangeEvent

Event Type

EventHandler<ClusterStateChangeEventArgs>

CompletelyDisconnectedEvent

Event received when subsystem detects a complete disconnection from central server or other peers

public event EventHandler<CompletelyDisconnectedEventArgs> CompletelyDisconnectedEvent

Event Type

EventHandler<CompletelyDisconnectedEventArgs>

ConfigurationEvent

Event received during configuration parameter load on subsystem

public event EventHandler<ConfigurationEventArgs> ConfigurationEvent

Event Type

EventHandler<ConfigurationEventArgs>

FirstStateChangeEvent

Called the first time there is state change

public event EventHandler<FirstStateChangeEventArgs> FirstStateChangeEvent

Event Type

EventHandler<FirstStateChangeEventArgs>

LoggingEvent

Event received when a log is received from subsystem

public event EventHandler<LoggingEventArgs> LoggingEvent

Event Type

EventHandler<LoggingEventArgs>

MultiplePrimaryEvent

There are multiple primary server in the cluster

public event EventHandler<MultiplePrimaryEventArgs> MultiplePrimaryEvent

Event Type

EventHandler<MultiplePrimaryEventArgs>

RequestedStateEvent

Called when a state transfer was requested

public event EventHandler<RequestedStateEventArgs> RequestedStateEvent

Event Type

EventHandler<RequestedStateEventArgs>

StateChangeEvent

My state has changed

public event EventHandler<StateChangeEventArgs> StateChangeEvent

Event Type

EventHandler<StateChangeEventArgs>

StateReadyEvent

The state is ready to be used

public event EventHandler<StateReadyEventArgs> StateReadyEvent

Event Type

EventHandler<StateReadyEventArgs>