quickfix
Class ApplicationAdapter

java.lang.Object
  extended by quickfix.ApplicationAdapter
All Implemented Interfaces:
Application

public class ApplicationAdapter
extends java.lang.Object
implements Application

Convenience class with default implementation for application methods


Constructor Summary
ApplicationAdapter()
           
 
Method Summary
 void fromAdmin(Message message, SessionID sessionId)
          This callback notifies you when an administrative message is sent from a counterparty to your FIX engine.
 void fromApp(Message message, SessionID sessionId)
          This callback receives messages for the application.
 void onCreate(SessionID sessionId)
          This method is called when quickfix creates a new session.
 void onLogon(SessionID sessionId)
          This callback notifies you when a valid logon has been established with a counter party.
 void onLogout(SessionID sessionId)
          This callback notifies you when an FIX session is no longer online.
 void toAdmin(Message message, SessionID sessionId)
          This callback provides you with a peek at the administrative messages that are being sent from your FIX engine to the counter party.
 void toApp(Message message, SessionID sessionId)
          This is a callback for application messages that you are sending to a counterparty.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ApplicationAdapter

public ApplicationAdapter()
Method Detail

fromAdmin

public void fromAdmin(Message message,
                      SessionID sessionId)
               throws FieldNotFound,
                      IncorrectDataFormat,
                      IncorrectTagValue,
                      RejectLogon
Description copied from interface: Application
This callback notifies you when an administrative message is sent from a counterparty to your FIX engine. This can be usefull for doing extra validation on logon messages such as for checking passwords. Throwing a RejectLogon exception will disconnect the counterparty.

Specified by:
fromAdmin in interface Application
Parameters:
message - QuickFIX message
sessionId - QuickFIX session ID
Throws:
FieldNotFound
IncorrectDataFormat
IncorrectTagValue
RejectLogon - causes a logon reject

fromApp

public void fromApp(Message message,
                    SessionID sessionId)
             throws FieldNotFound,
                    IncorrectDataFormat,
                    IncorrectTagValue,
                    UnsupportedMessageType
Description copied from interface: Application
This callback receives messages for the application. This is one of the core entry points for your FIX application. Every application level request will come through here. If, for example, your application is a sell-side OMS, this is where you will get your new order requests. If you were a buy side, you would get your execution reports here. If a FieldNotFound exception is thrown, the counterparty will receive a reject indicating a conditionally required field is missing. The Message class will throw this exception when trying to retrieve a missing field, so you will rarely need the throw this explicitly. You can also throw an UnsupportedMessageType exception. This will result in the counterparty getting a business reject informing them your application cannot process those types of messages. An IncorrectTagValue can also be thrown if a field contains a value that is out of range or you do not support.

Specified by:
fromApp in interface Application
Parameters:
message - QuickFIX message
sessionId - QuickFIX session ID
Throws:
FieldNotFound
IncorrectDataFormat
IncorrectTagValue
UnsupportedMessageType

onCreate

public void onCreate(SessionID sessionId)
Description copied from interface: Application
This method is called when quickfix creates a new session. A session comes into and remains in existence for the life of the application. Sessions exist whether or not a counter party is connected to it. As soon as a session is created, you can begin sending messages to it. If no one is logged on, the messages will be sent at the time a connection is established with the counterparty.

Specified by:
onCreate in interface Application

onLogon

public void onLogon(SessionID sessionId)
Description copied from interface: Application
This callback notifies you when a valid logon has been established with a counter party. This is called when a connection has been established and the FIX logon process has completed with both parties exchanging valid logon messages.

Specified by:
onLogon in interface Application
Parameters:
sessionId - QuickFIX session ID

onLogout

public void onLogout(SessionID sessionId)
Description copied from interface: Application
This callback notifies you when an FIX session is no longer online. This could happen during a normal logout exchange or because of a forced termination or a loss of network connection.

Specified by:
onLogout in interface Application
Parameters:
sessionId - QuickFIX session ID

toAdmin

public void toAdmin(Message message,
                    SessionID sessionId)
Description copied from interface: Application
This callback provides you with a peek at the administrative messages that are being sent from your FIX engine to the counter party. This is normally not useful for an application however it is provided for any logging you may wish to do. You may add fields in an adminstrative message before it is sent.

Specified by:
toAdmin in interface Application
Parameters:
message - QuickFIX message
sessionId - QuickFIX session ID

toApp

public void toApp(Message message,
                  SessionID sessionId)
           throws DoNotSend
Description copied from interface: Application
This is a callback for application messages that you are sending to a counterparty. If you throw a DoNotSend exception in this function, the application will not send the message. This is mostly useful if the application has been asked to resend a message such as an order that is no longer relevant for the current market. Messages that are being resent are marked with the PossDupFlag in the header set to true; If a DoNotSend exception is thrown and the flag is set to true, a sequence reset will be sent in place of the message. If it is set to false, the message will simply not be sent. You may add fields before an application message before it is sent out.

Specified by:
toApp in interface Application
Parameters:
message - QuickFIX message
sessionId - QuickFIX session ID
Throws:
DoNotSend - -- This exception aborts message transmission