Classes Files

com::wombat::mamda::MamdaSubscription

More…

Public Functions

  Name
  MamdaSubscription()
void create(MamaTransport transport, MamaQueue queue, String source, String symbol, Object closure)
void setSource(String source)
void setSymbol(String symbol)
void setTransport(MamaTransport transport)
void setQueue(MamaQueue queue)
void setType(MamaSubscriptionType type)
void setServiceLevel(short serviceLevel, short serviceLevelOpt)
void setRequireInitial(boolean require)
void setTimeout(double timeout)
void setRetries(int retries)
void setClosure(Object closure)
void addMsgListener(MamdaMsgListener listener)
Vector getMsgListeners()
void addStaleListener(MamdaStaleListener listener)
void addErrorListener(MamdaErrorListener listener)
synchronized void activate()
void deactivate()
MamaSubscriptionType getSubscriptionType()
short getServiceLevel()
long getServiceLevelOpt()
void setRequiresInitial(boolean requiresInitial)
boolean getRequiresInitial()
void setAppDataType(MamaMdDataType appDataType)
MamaMdDataType getAppDataType()
void setRecoverGaps(boolean doesRecover)
boolean getRecoverGaps()
void setPreInitialCacheSize(int cacheSize)
int getPreInitialCacheSize()
MamaMsgQualifier getMsgQualifier()
void requestRecap()
int getRetries()
double getTimeout()
String getSource()
String getSymbol()
MamaQueue getQueue()
MamaTransport getTransport()
Object getClosure()
long getSeqNum()
MamaSubscription getMamaSubscription()

Detailed Description

class com::wombat::mamda::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.

Public Functions Documentation

function MamdaSubscription

inline MamdaSubscription()

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

function create

inline void create(
    MamaTransport transport,
    MamaQueue queue,
    String source,
    String symbol,
    Object closure
)

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

function setSource

inline void setSource(
    String source
)

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

function setSymbol

inline void setSymbol(
    String symbol
)

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

function setTransport

inline void setTransport(
    MamaTransport transport
)

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

function setQueue

inline void setQueue(
    MamaQueue queue
)

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

function setType

inline void setType(
    MamaSubscriptionType type
)

Set the subscrption type. Do this before calling activate(). Default is MamaSubscriptionType.NORMAL

function setServiceLevel

inline void setServiceLevel(
    short serviceLevel,
    short serviceLevelOpt
)

Set the MAMA service level. Do this before calling activate(). Default value is MamaServiceLevel.REAL_TIME and 0

function setRequireInitial

inline void setRequireInitial(
    boolean require
)

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

function setTimeout

inline void setTimeout(
    double timeout
)

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

function setRetries

inline void setRetries(
    int retries
)

Set the retries for this subscirption. Do this before calling activate. Default is 3

function setClosure

inline void setClosure(
    Object closure
)

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

function addMsgListener

inline void addMsgListener(
    MamdaMsgListener listener
)

Add a listener for regular messages.

function getMsgListeners

inline Vector getMsgListeners()

function addStaleListener

inline void addStaleListener(
    MamdaStaleListener listener
)

Add a listener for changes in stale status.

function addErrorListener

inline void addErrorListener(
    MamdaErrorListener listener
)

Add a listener for error events.

function activate

inline synchronized void activate()

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

function deactivate

inline void deactivate()

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.

function getSubscriptionType

inline MamaSubscriptionType getSubscriptionType()

Returns the underlying MamaSubscriptionType for the specified Subscription.

function getServiceLevel

inline short getServiceLevel()

Get the service level for the specified Subscription.

function getServiceLevelOpt

inline long getServiceLevelOpt()

Return: serviceLevel

Get the service level options for the specified subscription.

function setRequiresInitial

inline void setRequiresInitial(
    boolean requiresInitial
)

Parameters:

  • requiresInitial [true false] Whether to request an initial value or not.

Whether an initial value is required for the specified Subscription. This only applies to market data subscriptions and not to basic subscriptions. Default value of true indicating that initial values are required.

function getRequiresInitial

inline boolean getRequiresInitial()

Return: boolean

Returns a value of true or false indicating whether this Subscription is interested in initial values.

function setAppDataType

inline void setAppDataType(
    MamaMdDataType appDataType
)

Parameters:

  • appDataType The application-specific data type.

Set the application-specific data type.

function getAppDataType

inline MamaMdDataType getAppDataType()

Return: appDataType .

Retrieve the application-specific data type.

function setRecoverGaps

inline void setRecoverGaps(
    boolean doesRecover
)

Parameters:

  • doesRecover indicates not to recover. true The Subscription will attempt to recover via a recap request.

Whether a Subscription should attempt to recover from sequence number gaps.

function getRecoverGaps

inline boolean getRecoverGaps()

Return: boolean - false does not recoever true - does attempt to recover

Whether the specified subscription will attempt to recover from sequence number gaps.

function setPreInitialCacheSize

inline void setPreInitialCacheSize(
    int cacheSize
)

Parameters:

  • cacheSize The size of the cache.

Set the number of messages to cache for each symbol before the initial value arrives. This allows the Subscription to recover when the initial value arrives late (after a subsequent trade or quote already arrived).

For group subscription, a separate cache is used for each group member.

The default is 10.

function getPreInitialCacheSize

inline int getPreInitialCacheSize()

Return: cacheSize

Return the initial value cache size

function getMsgQualifier

inline MamaMsgQualifier getMsgQualifier()

Return: MamaMsgQualifier

Return the MamaMsgQualifier

function requestRecap

inline void requestRecap()

Force a recap request to be sent for this subscription.

function getRetries

inline int getRetries()

function getTimeout

inline double getTimeout()

function getSource

inline String getSource()

function getSymbol

inline String getSymbol()

function getQueue

inline MamaQueue getQueue()

function getTransport

inline MamaTransport getTransport()

function getClosure

inline Object getClosure()

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

function getSeqNum

inline long getSeqNum()

function getMamaSubscription

inline MamaSubscription getMamaSubscription()

Updated on 2023-03-31 at 15:30:35 +0100