C# Class Wombat.MamdaSubscription

A MamdaSubscription is used to register interest in a particular symbol and source. A MamaTransport is required to actually activate the subscription. Multiple listeners can be added to the MamdaSubscription. In this way, an application can make use of more than one of the specialized value added MAMDA listeners, such as MamdaTradeListener and MamdaQuoteListener.
Inheritance: Wombat.MamdaResourceContainer
Datei anzeigen Open project: OpenMAMA/OpenMAMA Class Usage Examples

Public Methods

Method Description
MamdaSubscription ( ) : System

Default constructor. The subscription is not created until either create() or activate() is called.

activate ( ) : void

Activate the subscription. Until this method is invoked, no updates will be received.

addErrorListener ( MamdaErrorListener listener ) : void

Add a listener for error events.

addMsgListener ( MamdaMsgListener listener ) : void

Add a listener for regular messages.

addStaleListener ( MamdaStaleListener listener ) : void

Add a listener for changes in stale status.

create ( MamaTransport transport, Wombat.MamaQueue queue, string source, string symbol, object closure ) : void

Create and activate a subscription. Any properties for the subscription should be set prior to calling this method.

deactivate ( ) : void

Deactivate the subscription. No more updates will be received for this subscription (unless activate() is invoked again). This function must be called from the same thread dispatching on the associated event queue unless both the default queue and dispatch queue are not actively dispatching.

getClosure ( ) : Object

Get the additional object passed as the closure to the create() method.

getMamaSubscription ( ) : Wombat.MamaSubscription
getMsgListeners ( ) : ArrayList

get a listener for regular messages.

getQueue ( ) : Wombat.MamaQueue

getRetries ( ) : int

getSource ( ) : string

getSymbol ( ) : string

getTimout ( ) : double

getTransport ( ) : MamaTransport

requestRecap ( ) : void

Force a recap request to be sent for this subscription.

Note: there is still a possibility that the feed handler will reject such recap requests (based on configurable feature(s) of a feed handler).

setClosure ( Object closure ) : void

Set the closure. Do this before calling activate().

setQueue ( Wombat.MamaQueue queue ) : void

Set the MAMA queue. Do this before calling activate().

setRequireInitial ( bool require ) : void

Set whether an initial value is required. Do this before calling activate(). Default is true

setRetries ( int retries ) : void

Set the retries for this subscription. Do this before calling activate(). Default is 10 seconds.

setServiceLevel ( mamaServiceLevel serviceLevel, int serviceLevelOpt ) : void

Set the MAMA service level. In the future, certain service levels may have an optional argument (e.g., an interval for conflated data). Do this before calling activate(). Default value is MamaServiceLevel.MAMA_SERVICE_LEVEL_REAL_TIME and 0

setSource ( string source ) : void

Set the data source name. Do this before calling activate().

setSymbol ( string symbol ) : void

Set the symbol. Do this before calling activate().

setTimeout ( double timeout ) : void

Set the timeout (in seconds) for this subscription. Do this before calling activate(). Default is 10 seconds.

setTransport ( MamaTransport transport ) : void

Set the MAMA transport. Do this before calling activate().

setType ( mamaSubscriptionType type ) : void

Set the subscrption type. Do this before calling activate() Default is mamaSubscriptionType.MAMA_SUBSC_TYPE_NORMAL

Method Details

MamdaSubscription() public method

Default constructor. The subscription is not created until either create() or activate() is called.
public MamdaSubscription ( ) : System
return System

activate() public method

Activate the subscription. Until this method is invoked, no updates will be received.
public activate ( ) : void
return void

addErrorListener() public method

Add a listener for error events.
public addErrorListener ( MamdaErrorListener listener ) : void
listener MamdaErrorListener
return void

addMsgListener() public method

Add a listener for regular messages.
public addMsgListener ( MamdaMsgListener listener ) : void
listener MamdaMsgListener
return void

addStaleListener() public method

Add a listener for changes in stale status.
public addStaleListener ( MamdaStaleListener listener ) : void
listener MamdaStaleListener
return void

create() public method

Create and activate a subscription. Any properties for the subscription should be set prior to calling this method.
public create ( MamaTransport transport, Wombat.MamaQueue queue, string source, string symbol, object closure ) : void
transport MamaTransport
queue Wombat.MamaQueue
source string
symbol string
closure object
return void

deactivate() public method

Deactivate the subscription. No more updates will be received for this subscription (unless activate() is invoked again). This function must be called from the same thread dispatching on the associated event queue unless both the default queue and dispatch queue are not actively dispatching.
public deactivate ( ) : void
return void

getClosure() public method

Get the additional object passed as the closure to the create() method.
public getClosure ( ) : Object
return Object

getMamaSubscription() public method

public getMamaSubscription ( ) : Wombat.MamaSubscription
return Wombat.MamaSubscription

getMsgListeners() public method

get a listener for regular messages.
public getMsgListeners ( ) : ArrayList
return System.Collections.ArrayList

getQueue() public method

public getQueue ( ) : Wombat.MamaQueue
return Wombat.MamaQueue

getRetries() public method

public getRetries ( ) : int
return int

getSource() public method

public getSource ( ) : string
return string

getSymbol() public method

public getSymbol ( ) : string
return string

getTimout() public method

public getTimout ( ) : double
return double

getTransport() public method

public getTransport ( ) : MamaTransport
return MamaTransport

requestRecap() public method

Force a recap request to be sent for this subscription.
Note: there is still a possibility that the feed handler will reject such recap requests (based on configurable feature(s) of a feed handler).
public requestRecap ( ) : void
return void

setClosure() public method

Set the closure. Do this before calling activate().
public setClosure ( Object closure ) : void
closure Object
return void

setQueue() public method

Set the MAMA queue. Do this before calling activate().
public setQueue ( Wombat.MamaQueue queue ) : void
queue Wombat.MamaQueue
return void

setRequireInitial() public method

Set whether an initial value is required. Do this before calling activate(). Default is true
public setRequireInitial ( bool require ) : void
require bool
return void

setRetries() public method

Set the retries for this subscription. Do this before calling activate(). Default is 10 seconds.
public setRetries ( int retries ) : void
retries int
return void

setServiceLevel() public method

Set the MAMA service level. In the future, certain service levels may have an optional argument (e.g., an interval for conflated data). Do this before calling activate(). Default value is MamaServiceLevel.MAMA_SERVICE_LEVEL_REAL_TIME and 0
public setServiceLevel ( mamaServiceLevel serviceLevel, int serviceLevelOpt ) : void
serviceLevel mamaServiceLevel
serviceLevelOpt int
return void

setSource() public method

Set the data source name. Do this before calling activate().
public setSource ( string source ) : void
source string
return void

setSymbol() public method

Set the symbol. Do this before calling activate().
public setSymbol ( string symbol ) : void
symbol string
return void

setTimeout() public method

Set the timeout (in seconds) for this subscription. Do this before calling activate(). Default is 10 seconds.
public setTimeout ( double timeout ) : void
timeout double
return void

setTransport() public method

Set the MAMA transport. Do this before calling activate().
public setTransport ( MamaTransport transport ) : void
transport MamaTransport
return void

setType() public method

Set the subscrption type. Do this before calling activate() Default is mamaSubscriptionType.MAMA_SUBSC_TYPE_NORMAL
public setType ( mamaSubscriptionType type ) : void
type mamaSubscriptionType
return void