com.wombat.mama
public class MamaSubscription extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_RETRIES |
static double |
DEFAULT_TIMEOUT |
Constructor and Description |
---|
MamaSubscription()
The constructor allocates the underlying C subscription.
|
Modifier and Type | Method and Description |
---|---|
void |
activate()
Activate a subscription that has been set up by calling MamaSubscription.setup.
|
MamaDictionary |
createDictionarySubscription(MamaDictionaryCallback callback,
MamaQueue queue,
MamaSource source)
Create a dictionary subscription using default values for the timeout and
number of retries.
|
MamaDictionary |
createDictionarySubscription(MamaDictionaryCallback callback,
MamaQueue queue,
MamaSource source,
double timeout,
int retries)
Create a dictionary subscription using default values for the timeout and
number of retries.
|
void |
createSnapshotSubscription(MamaSubscriptionCallback callback,
MamaQueue queue,
MamaSource source,
java.lang.String symbol,
java.lang.Object closure)
Create a snapshot subscription for initial value only (no updates).
|
void |
createSubscription(MamaSubscriptionCallback callback,
MamaQueue queue,
MamaSource source,
java.lang.String symbol,
java.lang.Object closure)
Create and activate subscription.
|
void |
deactivate()
Deactivate a subscription.
|
void |
deallocate()
De-allocates the underlying C subscription.
|
void |
destroy()
This function will destroy the subscription, it must be called from
the same thread that is processing the queue for the subscription.
|
void |
destroyEx()
This function will destroy the subscription and can be called from
any thread.
|
MamaMdDataType |
getAppDataType() |
java.lang.Object |
getClosure()
This function returns the closure supplied to the createSubscription
function.
|
java.lang.Object |
getItemClosure() |
MamaMsgQualifier |
getMessageQualifierFilter() |
long |
getPointerVal()
This function returns the pointer to the underlying C subscription.
|
int |
getPreInitialCacheSize() |
boolean |
getReceivedInitial()
Get whether we have received an Initial.
|
boolean |
getRecoverGaps() |
boolean |
getRequiresInitital() |
int |
getRetries() |
short |
getServiceLevel() |
long |
getServiceLevelOptions() |
MamaSource |
getSource()
Return the source associated with the subscription.
|
MamaSubscriptionState |
getState()
This function returns the current state of the subscription as one
of the MamaSubscriptionState instances, see this class for more
information.
|
MamaSubscriptionType |
getSubscriptionType() |
java.lang.String |
getSubscSource()
Return the source for this subscription.
|
java.lang.String |
getSymbol()
Return the symbol for this subscription.
|
double |
getTimeout()
To return the subscription timeout.
|
MamaTransport |
getTransport() |
boolean |
isActive()
Returns whether the subscription is valid, note that this function has
been deprecated, use mamaSubscription_getState instead.
|
boolean |
isValid()
Returns whether the subscription is valid, note that this function has
been deprecated, use mamaSubscription_getState instead.
|
void |
setAppDataType(MamaMdDataType type) |
void |
setDebugLevel(java.util.logging.Level level) |
void |
setItemClosure(java.lang.Object closure) |
void |
setMessageQualifierFilter(MamaMsgQualifier qualifier) |
void |
setPreInitialCacheSize(int size) |
void |
setRecoverGaps(boolean recover) |
void |
setRequiresInitial(boolean value)
Set whether subscriptoin requires initial value.
|
void |
setRetries(int retries) |
void |
setServiceLevel(short level,
long options) |
void |
setSubscriptionType(MamaSubscriptionType type) |
void |
setTimeout(double timeout)
Set the timeout for this subscription.
|
void |
setupSubscription(MamaSubscriptionCallback callback,
MamaQueue queue,
MamaSource source,
java.lang.String symbol,
java.lang.Object closure)
Setup a basic subscription without marketdata semantics.
|
public static final int DEFAULT_RETRIES
public static final double DEFAULT_TIMEOUT
public MamaSubscription()
public void createSubscription(MamaSubscriptionCallback callback, MamaQueue queue, MamaSource source, java.lang.String symbol, java.lang.Object closure)
callback
- The object implementing the callback functions.queue
- The MamaQueue.source
- The MamaSource identifying the publisher for this symbol.symbol
- The symbol name.closure
- The closure will be passed to subsequent callback invocations
for this subscription.public MamaDictionary createDictionarySubscription(MamaDictionaryCallback callback, MamaQueue queue, MamaSource source)
callback
- The object implementing the callback functions, this can
also be an instance of MamaSubscriptionCallbackEx to
be notified when the subscription has been destroyed.queue
- The MamaQueue.source
- The MamaSource identifying the publisher for this symbol.public MamaDictionary createDictionarySubscription(MamaDictionaryCallback callback, MamaQueue queue, MamaSource source, double timeout, int retries)
callback
- The object implementing the callback functions.queue
- The MamaQueue.source
- The MamaSource identifying the publisher for this symbol.timeout
- The timeout value in seconds.retries
- The number of retries.public void createSnapshotSubscription(MamaSubscriptionCallback callback, MamaQueue queue, MamaSource source, java.lang.String symbol, java.lang.Object closure)
callback
- The object implementing the callback functions.queue
- The MamaQueue.source
- The MamaSource identifying the publisher for this symbol.symbol
- The symbol name.closure
- The closure will be passed to subsequent callback invocations
for this subscription.public java.lang.Object getClosure()
public long getPointerVal()
public MamaSource getSource()
public MamaSubscriptionState getState()
public void setupSubscription(MamaSubscriptionCallback callback, MamaQueue queue, MamaSource source, java.lang.String symbol, java.lang.Object closure)
callback
- The object implementing the callback functions.queue
- The MamaQueue.source
- The MamaSource identifying the publisher for this symbol.symbol
- The symbol name.closure
- The closure will be passed to subsequent callback invocations
for this subscription.public void setAppDataType(MamaMdDataType type)
public MamaMdDataType getAppDataType()
public void setDebugLevel(java.util.logging.Level level)
public void setMessageQualifierFilter(MamaMsgQualifier qualifier)
public MamaMsgQualifier getMessageQualifierFilter()
public void setSubscriptionType(MamaSubscriptionType type)
public MamaSubscriptionType getSubscriptionType()
public MamaTransport getTransport()
public void activate()
public void deactivate()
public void deallocate()
public void destroy()
public void destroyEx()
public boolean getReceivedInitial()
public java.lang.String getSubscSource()
public java.lang.String getSymbol()
public double getTimeout()
public boolean isActive()
public boolean isValid()
public void setRequiresInitial(boolean value)
value
- True if the subscription needs an initial.public void setTimeout(double timeout)
timeout
- The timeout in seconds.public java.lang.Object getItemClosure()
public int getPreInitialCacheSize()
public boolean getRecoverGaps()
public boolean getRequiresInitital()
public int getRetries()
public short getServiceLevel()
public long getServiceLevelOptions()
public void setPreInitialCacheSize(int size)
public void setItemClosure(java.lang.Object closure)
public void setRecoverGaps(boolean recover)
public void setServiceLevel(short level, long options)
public void setRetries(int retries)
Copyright 2011 NYSE Technologies