com.epam.cmemdp.impl
Class ApplicationImpl

java.lang.Object
  extended by com.epam.cmemdp.impl.ApplicationImpl
All Implemented Interfaces:
Application, FastChannelReaderListener

public class ApplicationImpl
extends java.lang.Object
implements Application, FastChannelReaderListener


Field Summary
protected  ApplicationListener applicationListener
           
protected  java.util.Map<java.lang.String,java.util.List<Instrument>> channelInstruments
           
protected static java.lang.String DOUBLESUBSCRIBE
           
protected  java.util.List<Instrument> instruments
           
protected  java.util.Map<java.lang.String,Instrument> instrumentsBySecDesc
           
protected  java.util.Map<java.lang.Long,Instrument> instrumentsBySecID
           
static int MAX_REVISION_DELTA
           
static int MAX_UDP_MIX_DELTA
           
 
Constructor Summary
ApplicationImpl(ApplicationParams params, ApplicationListener applicationListener)
           
ApplicationImpl(ApplicationParams params, ApplicationListener applicationListener, FastChannelReader reader)
           
 
Method Summary
 MDChannel findChannelByID(java.lang.String channelID)
           
 ChannelContext getChannelContext(java.lang.String channelID)
           
 java.util.List<MDChannel> getChannels()
           
 void onMessage(FIXFieldList message, java.lang.String channelID, long firstSeqNumOfQueue34)
          Invoked when fast channel received message.
 void onMessage(java.lang.String securityDesc, long securityID, FIXFieldList message, MDChannel channel)
           
 void resolveInstrumentBySecID(long securityID, SecurityDefinitionListener listener)
          Subscribes to instrument replay by security ID
 void resolveInstrumentBySecurityDescription(java.lang.String securityDescription, SecurityDefinitionListener listener)
          Subscribes to instrument replay by security description
 void resolveInstrumentBySecurityGroup(java.lang.String securityGroup, SecurityDefinitionListener listener)
          Subscribes to instrument replay by security group
 void resolveInstrumentBySymbol(java.lang.String symbol, SecurityDefinitionListener listener)
          Subscribes to instrument replay by symbol
 boolean resolveInstrumentsByChannelID(java.lang.String channelID, SecurityDefinitionListener listener)
          Subscribes to instrument replay by channel ID
 void riseOnRecoveryStopped(Instrument instrument, RecoveryReason recoveryReason)
           
 void start()
          Starts application.
 void stop()
          Stops application.
 void stopChannelListener(java.lang.String channelID, SecurityDefinitionListener listener)
          Unsubscribe from instrument replay by channel
 void stopSecGroupListener(java.lang.String securityGroup, SecurityDefinitionListener listener)
          Unsubscribe from instrument replay by security group
 void stopSecIDListener(long securityID, SecurityDefinitionListener listener)
          Unsubscribe from instrument replay by security ID
 void stopSecurityDescriptionListener(java.lang.String securityDesc, SecurityDefinitionListener listener)
          Unsubscribe from instrument replay by security description
 void stopSymbolListener(java.lang.String symbol, SecurityDefinitionListener listener)
          Unsubscribe from instrument replay by String
 void subscribe(java.lang.String symbol, InstrumentListener listener, RecoveryOptions recovery)
           
 boolean subscribeAll(InstrumentListener listener, RecoveryOptions recoveryOptions)
          Subscribes to the market data for all instruments on market
 void subscribeAll(RecoveryOptions recoveryOptions)
          Deprecated. 
 boolean subscribeByChannelID(MDChannel channel, InstrumentListener listener, RecoveryOptions recoveryOptions)
           
 boolean subscribeByChannelID(java.lang.String channelID, InstrumentListener listener, RecoveryOptions recoveryOptions)
          Subscribes to market data for instrument by security ID and channel info
 void subscribeBySecurityDesc(java.lang.String secDesc, InstrumentListener instrumentListener, RecoveryOptions recoveryOptions)
          Subscribes to market data for instrument by security description
 void subscribeBySecurityID(long secID, InstrumentListener listener, RecoveryOptions recovery)
           
 boolean subscribeBySecurityID(long secID, java.lang.String secDesc, java.lang.String channelID, InstrumentListener listener, RecoveryOptions recoveryOptions)
          Subscribes to market data for instrument by security ID and channel info
 void unsubscribe(java.lang.String symbol)
           
 void unsubscribeAll()
          Unsubscribe from all instruments
 void unsubscribeByChannelID(java.lang.String channelID, InstrumentListener listener)
          Unsubscribes from market data on channel.
 void unsubscribeBySecDesc(java.lang.String securityDesc)
          Unsubscribes from instrument by security description
 void unsubscribeBySecurityID(long securityID)
          Unsubscribes from instrument by security ID
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_UDP_MIX_DELTA

public static final int MAX_UDP_MIX_DELTA
See Also:
Constant Field Values

MAX_REVISION_DELTA

public static final int MAX_REVISION_DELTA
See Also:
Constant Field Values

DOUBLESUBSCRIBE

protected static final java.lang.String DOUBLESUBSCRIBE
See Also:
Constant Field Values

instruments

protected final java.util.List<Instrument> instruments

channelInstruments

protected final java.util.Map<java.lang.String,java.util.List<Instrument>> channelInstruments

instrumentsBySecID

protected final java.util.Map<java.lang.Long,Instrument> instrumentsBySecID

instrumentsBySecDesc

protected final java.util.Map<java.lang.String,Instrument> instrumentsBySecDesc

applicationListener

protected ApplicationListener applicationListener
Constructor Detail

ApplicationImpl

public ApplicationImpl(ApplicationParams params,
                       ApplicationListener applicationListener)

ApplicationImpl

public ApplicationImpl(ApplicationParams params,
                       ApplicationListener applicationListener,
                       FastChannelReader reader)
Method Detail

getChannelContext

public ChannelContext getChannelContext(java.lang.String channelID)

getChannels

public java.util.List<MDChannel> getChannels()

start

public void start()
Description copied from interface: Application
Starts application.

Specified by:
start in interface Application

subscribe

public void subscribe(java.lang.String symbol,
                      InstrumentListener listener,
                      RecoveryOptions recovery)
Specified by:
subscribe in interface Application

unsubscribe

public void unsubscribe(java.lang.String symbol)
Specified by:
unsubscribe in interface Application

subscribeBySecurityDesc

public void subscribeBySecurityDesc(java.lang.String secDesc,
                                    InstrumentListener instrumentListener,
                                    RecoveryOptions recoveryOptions)
Description copied from interface: Application
Subscribes to market data for instrument by security description

Specified by:
subscribeBySecurityDesc in interface Application

unsubscribeBySecDesc

public void unsubscribeBySecDesc(java.lang.String securityDesc)
Description copied from interface: Application
Unsubscribes from instrument by security description

Specified by:
unsubscribeBySecDesc in interface Application

unsubscribeBySecurityID

public void unsubscribeBySecurityID(long securityID)
Description copied from interface: Application
Unsubscribes from instrument by security ID

Specified by:
unsubscribeBySecurityID in interface Application

subscribeBySecurityID

public void subscribeBySecurityID(long secID,
                                  InstrumentListener listener,
                                  RecoveryOptions recovery)

subscribeBySecurityID

public boolean subscribeBySecurityID(long secID,
                                     java.lang.String secDesc,
                                     java.lang.String channelID,
                                     InstrumentListener listener,
                                     RecoveryOptions recoveryOptions)
Description copied from interface: Application
Subscribes to market data for instrument by security ID and channel info

Specified by:
subscribeBySecurityID in interface Application

subscribeByChannelID

public boolean subscribeByChannelID(java.lang.String channelID,
                                    InstrumentListener listener,
                                    RecoveryOptions recoveryOptions)
Description copied from interface: Application
Subscribes to market data for instrument by security ID and channel info

Specified by:
subscribeByChannelID in interface Application

subscribeByChannelID

public boolean subscribeByChannelID(MDChannel channel,
                                    InstrumentListener listener,
                                    RecoveryOptions recoveryOptions)

unsubscribeByChannelID

public void unsubscribeByChannelID(java.lang.String channelID,
                                   InstrumentListener listener)
Description copied from interface: Application
Unsubscribes from market data on channel.

Specified by:
unsubscribeByChannelID in interface Application
See Also:
Application.subscribeByChannelID(String, InstrumentListener, RecoveryOptions)

findChannelByID

public MDChannel findChannelByID(java.lang.String channelID)

resolveInstrumentBySymbol

public void resolveInstrumentBySymbol(java.lang.String symbol,
                                      SecurityDefinitionListener listener)
Description copied from interface: Application
Subscribes to instrument replay by symbol

Specified by:
resolveInstrumentBySymbol in interface Application

resolveInstrumentBySecurityDescription

public void resolveInstrumentBySecurityDescription(java.lang.String securityDescription,
                                                   SecurityDefinitionListener listener)
Description copied from interface: Application
Subscribes to instrument replay by security description

Specified by:
resolveInstrumentBySecurityDescription in interface Application

resolveInstrumentBySecID

public void resolveInstrumentBySecID(long securityID,
                                     SecurityDefinitionListener listener)
Description copied from interface: Application
Subscribes to instrument replay by security ID

Specified by:
resolveInstrumentBySecID in interface Application

resolveInstrumentBySecurityGroup

public void resolveInstrumentBySecurityGroup(java.lang.String securityGroup,
                                             SecurityDefinitionListener listener)
Description copied from interface: Application
Subscribes to instrument replay by security group

Specified by:
resolveInstrumentBySecurityGroup in interface Application

resolveInstrumentsByChannelID

public boolean resolveInstrumentsByChannelID(java.lang.String channelID,
                                             SecurityDefinitionListener listener)
Description copied from interface: Application
Subscribes to instrument replay by channel ID

Specified by:
resolveInstrumentsByChannelID in interface Application

stopSymbolListener

public void stopSymbolListener(java.lang.String symbol,
                               SecurityDefinitionListener listener)
Description copied from interface: Application
Unsubscribe from instrument replay by String

Specified by:
stopSymbolListener in interface Application

stopSecurityDescriptionListener

public void stopSecurityDescriptionListener(java.lang.String securityDesc,
                                            SecurityDefinitionListener listener)
Description copied from interface: Application
Unsubscribe from instrument replay by security description

Specified by:
stopSecurityDescriptionListener in interface Application

stopSecIDListener

public void stopSecIDListener(long securityID,
                              SecurityDefinitionListener listener)
Description copied from interface: Application
Unsubscribe from instrument replay by security ID

Specified by:
stopSecIDListener in interface Application

stopSecGroupListener

public void stopSecGroupListener(java.lang.String securityGroup,
                                 SecurityDefinitionListener listener)
Description copied from interface: Application
Unsubscribe from instrument replay by security group

Specified by:
stopSecGroupListener in interface Application

stopChannelListener

public void stopChannelListener(java.lang.String channelID,
                                SecurityDefinitionListener listener)
Description copied from interface: Application
Unsubscribe from instrument replay by channel

Specified by:
stopChannelListener in interface Application

subscribeAll

public boolean subscribeAll(InstrumentListener listener,
                            RecoveryOptions recoveryOptions)
Description copied from interface: Application
Subscribes to the market data for all instruments on market

Specified by:
subscribeAll in interface Application

subscribeAll

@Deprecated
public void subscribeAll(RecoveryOptions recoveryOptions)
Deprecated. 

Specified by:
subscribeAll in interface Application

unsubscribeAll

public void unsubscribeAll()
Description copied from interface: Application
Unsubscribe from all instruments

Specified by:
unsubscribeAll in interface Application

onMessage

public void onMessage(java.lang.String securityDesc,
                      long securityID,
                      FIXFieldList message,
                      MDChannel channel)

onMessage

public void onMessage(FIXFieldList message,
                      java.lang.String channelID,
                      long firstSeqNumOfQueue34)
Description copied from interface: FastChannelReaderListener
Invoked when fast channel received message.

Specified by:
onMessage in interface FastChannelReaderListener
Parameters:
message - the message
channelID - the channel id witch received message
firstSeqNumOfQueue34 - the first sequence in queue

stop

public void stop()
Description copied from interface: Application
Stops application. Method is blocked.

Specified by:
stop in interface Application

riseOnRecoveryStopped

public void riseOnRecoveryStopped(Instrument instrument,
                                  RecoveryReason recoveryReason)


Copyright © 2000-2014 EPAM Systems. All Rights Reserved.