com.epam.fixengine.session
Class BackupFIXSession

java.lang.Object
  extended by com.epam.fixengine.session.AbstractFIXSession
      extended by com.epam.fixengine.session.InitiatorFIXSession
          extended by com.epam.fixengine.session.BackupFIXSession
All Implemented Interfaces:
FIXSession, ExtendedFIXSession, com.epam.fixengine.session.SessionStateListenSupport

public abstract class BackupFIXSession
extends InitiatorFIXSession

The BackupFIXSession provides ability to switch the connection from the primary host to backup and vice versa.
The backup session should configured by engine.properties and default.properties configuration files.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.epam.fixengine.session.AbstractFIXSession
AbstractFIXSession.SessionParametersProxyAdaptorListener
 
Field Summary
 
Fields inherited from class com.epam.fixengine.session.AbstractFIXSession
configuration, DEBUG_ENABLED, graceful, listener, log, messageFactory, queue, sessionLock, sessionParameters, TRACE_ENABLED, transport
 
Fields inherited from interface com.epam.fixengine.FIXSession
DEFAULT_SENDING_OPTIONS, SEND_ASYNC, SEND_SYNC
 
Constructor Summary
BackupFIXSession(FIXMessageFactory factory, SessionParameters sessionParameters, HandlerChain fixSessionListener)
           
 
Method Summary
 void connect()
          Connects to remote counterparty,
if initiator or accepts incoming connection if acceptor.
protected  int getAttempt()
          Gets current connection attempts.
protected  void incrementAttempt()
          The synchronized method to increment attempt.
protected  void initSession()
          Initializes the resources and sends a logon message.
protected  boolean isBackupInitiator()
           
 boolean isRunningOnBackup()
          Returns true, if session connected to backup host.
protected  void setAttempt(int attempt)
          Sets current connection attempts.
protected  void setBackupInitiator(boolean backupInitiator)
           
 void setFIXSessionListener(FIXSessionListener listener)
          Sets FIXSession listener to monitor session status and receive incoming messages.
protected  void setRunningOnBackup(Boolean value)
          Sets the connection state.
 void switchToBackUp()
          The method, switch current connection to backup.
 void switchToPrimary()
          The method, switch current connection to primary.
 
Methods inherited from class com.epam.fixengine.session.InitiatorFIXSession
connectInternal, disconnect, dispose, getTransport, reject, setSessionState
 
Methods inherited from class com.epam.fixengine.session.AbstractFIXSession
addSessionStateListener, checkHasSessionSendOrReceivedTestRequest, clearQueue, configureStateBeforeReset, disconnect, disconnect, disconnect, disconnectTestRequestIsLost, equals, forcedDisconnect, getAttribute, getAttributeAsBool, getAttributeAsLong, getBytesRead, getBytesSent, getEncryption, getErrorHandler, getEstablished, getExtendedFIXSessionListener, getIncomingMessageStorage, getLastDisconnectReason, getLastInMessageTimestamp, getLastOutMessageTimestamp, getMessageFactory, getMessageHandlers, getMessageValidator, getNoOfInMessages, getNoOfOutMessages, getOutgoingMessageStorage, getQueuedMessagesCount, getRejectMessageListener, getSequenceManager, getSessionParameters, getSessionParametersInstance, getSessionState, getStorageFactory, hashCode, initSessionInternal, isResetSeqNumFlagRequiredForInitLogon, isResetTimeMissed, isStatisticEnabled, loadSessionParametersFromFile, markShutdownAsGraceful, prepareMessage, prepareMessage, prepareMessage, prepareMessageFromString, prepareMessageFromString, removeAttribute, removeAttribute, removeLongAttribute, removeSessionStateListener, resetSeqNumIfConfigured, resetSequenceNumbers, resetSequenceNumbers, resetTestRequestFlags, restoreSessionAfterReceivedTestRequest, restoreSessionParameters, saveSessionParameters, sendAsIs, sendAsIs, sendMessage, sendMessage, sendMessage, sendMessage, sendMessageAndGetQueueSize, sendMessageAndGetQueueSize, sendMessageOutOfTurn, sendTestRequest, sendWithChanges, sendWithChanges, sendWithChangesAndGetQueueSize, sendWithChangesAndGetQueueSize, setAttribute, setAttribute, setAttribute, setErrorHandler, setLastDisconnectReason, setOutOfTurnMode, setPreLoggofSessionState, setRejectMessageListener, setSequenceNumbers, shutdown, shutdown, startSession, storeProcessedSeqNumber, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BackupFIXSession

public BackupFIXSession(FIXMessageFactory factory,
                        SessionParameters sessionParameters,
                        HandlerChain fixSessionListener)
Method Detail

connect

public void connect()
             throws IOException
Description copied from interface: FIXSession
Connects to remote counterparty,
if initiator or accepts incoming connection if acceptor.

Specified by:
connect in interface FIXSession
Overrides:
connect in class InitiatorFIXSession
Throws:
IOException - I/O exception if error occurred
See Also:
FIXSession.reject(String)

getAttempt

protected int getAttempt()
Gets current connection attempts.


setAttempt

protected void setAttempt(int attempt)
Sets current connection attempts.

Parameters:
attempt - the current connection attempt

incrementAttempt

protected void incrementAttempt()
The synchronized method to increment attempt.


isBackupInitiator

protected boolean isBackupInitiator()

setBackupInitiator

protected void setBackupInitiator(boolean backupInitiator)

setFIXSessionListener

public void setFIXSessionListener(FIXSessionListener listener)
Description copied from interface: FIXSession
Sets FIXSession listener to monitor session status and receive incoming messages.

Specified by:
setFIXSessionListener in interface FIXSession
Overrides:
setFIXSessionListener in class AbstractFIXSession
Parameters:
listener - the user specified listener
See Also:
FIXSession.setFIXSessionListener(FIXSessionListener)

isRunningOnBackup

public boolean isRunningOnBackup()
Returns true, if session connected to backup host.


setRunningOnBackup

protected void setRunningOnBackup(Boolean value)
Sets the connection state.

Parameters:
value - the new value

switchToBackUp

public void switchToBackUp()
The method, switch current connection to backup.


switchToPrimary

public void switchToPrimary()
The method, switch current connection to primary.


initSession

protected void initSession()
                    throws IOException
Description copied from class: AbstractFIXSession
Initializes the resources and sends a logon message.

Overrides:
initSession in class AbstractFIXSession
Throws:
IOException - - if I/O error occurred.


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