org.quickfixj.jmx.mbean.session
Class SessionAdmin

java.lang.Object
  extended by javax.management.NotificationBroadcasterSupport
      extended by org.quickfixj.jmx.mbean.session.SessionAdmin
All Implemented Interfaces:
javax.management.MBeanRegistration, javax.management.NotificationBroadcaster, javax.management.NotificationEmitter, SessionAdminMBean, SessionStateListener

public class SessionAdmin
extends javax.management.NotificationBroadcasterSupport
implements SessionAdminMBean, javax.management.MBeanRegistration, SessionStateListener


Constructor Summary
SessionAdmin(Session session, javax.management.ObjectName connnectorName)
           
 
Method Summary
 void disconnect()
          Tell the session to disconnect (implies logoff)
protected  void doSend(Message message, SessionID sessionID)
          Helper method to be overridden by tests that handles sending out the message
 java.lang.String getBeginString()
          Get the begin string (FIX version) for the session
 boolean getCheckCompID()
           
 java.lang.String getConnectionRole()
           
 javax.management.ObjectName getConnectorName()
           
 boolean getEnabled()
           
 java.lang.String getHost()
           
 java.lang.String getID()
           
 java.lang.String getLogClassName()
           
 int getLogonTimeout()
           
 int getLogoutTimeout()
           
 java.lang.String getMessageFactoryClassName()
           
 java.lang.String[] getMessages(int startSequence, int endSequence)
           
 java.lang.String getMessageStoreClassName()
           
 int getNextSenderMsgSeqNum()
          Get the next sender message sequence number.
 int getNextTargetMsgSeqNum()
          Get the next target message sequence number.
 java.lang.String getProcessID()
           
 boolean getRedundantResendRequestsAllowed()
           
 boolean getRefreshOnLogon()
           
 java.lang.String getRemoteIPAddress()
           
 boolean getResetOnDisconnect()
           
 boolean getResetOnLogout()
           
 java.lang.String getSenderCompID()
          Get the sender company ID for the session.
 java.lang.String getSenderLocationID()
          Get the sender company location ID for the session.
 java.lang.String getSenderSubID()
          Get the sender company subID for the session.
 java.lang.String getSessionID()
          Get the session ID.
 java.lang.String getStartTime()
           
 java.lang.String getTargetCompID()
          Get the target company ID for the session.
 java.lang.String getTargetLocationID()
          Get the target location ID for the session.
 java.lang.String getTargetSubID()
          Get the target subID for the session.
 boolean isLoggedOn()
           
 boolean isLogonAlreadySent()
           
 boolean isLogonReceived()
           
 boolean isLogonSendNeeded()
           
 boolean isLogonSent()
           
 boolean isLogonTimedOut()
           
 boolean isLogoutReceived()
           
 boolean isLogoutSent()
           
 boolean isLogoutTimedOut()
           
 boolean isReconnectEnabled()
           
 boolean isUsingDataDictionary()
           
 void logoff()
          Tell the session to logoff.
 void logon()
          Tell the session to logon.
 void onConnect()
           
 void onDisconnect()
           
 void onHeartBeatTimeout()
           
 void onLogon()
           
 void onLogout()
           
 void onMissedHeartBeat()
           
 void onRefresh()
           
 void onReset()
           
 void postDeregister()
           
 void postRegister(java.lang.Boolean registrationDone)
           
 void preDeregister()
           
 javax.management.ObjectName preRegister(javax.management.MBeanServer server, javax.management.ObjectName name)
           
 void reset()
          Reset the session's sequence numbers and clear it's resend log.
 void resetSequence(int nextSeqNum)
          Reset current sequence number
 void setLogonTimeout(int seconds)
           
 void setLogoutTimeout(int seconds)
           
 void setNextSenderMsgSeqNum(int next)
          Set the next sender message sequence number.
 void setNextTargetMsgSeqNum(int next)
          Set the next target message sequence number.
 
Methods inherited from class javax.management.NotificationBroadcasterSupport
addNotificationListener, getNotificationInfo, handleNotification, removeNotificationListener, removeNotificationListener, sendNotification
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SessionAdmin

public SessionAdmin(Session session,
                    javax.management.ObjectName connnectorName)
Method Detail

getID

public java.lang.String getID()

getTargetCompID

public java.lang.String getTargetCompID()
Description copied from interface: SessionAdminMBean
Get the target company ID for the session.

Specified by:
getTargetCompID in interface SessionAdminMBean
Returns:
the target company ID

getTargetSubID

public java.lang.String getTargetSubID()
Description copied from interface: SessionAdminMBean
Get the target subID for the session.

Specified by:
getTargetSubID in interface SessionAdminMBean
Returns:
the target subID

getTargetLocationID

public java.lang.String getTargetLocationID()
Description copied from interface: SessionAdminMBean
Get the target location ID for the session.

Specified by:
getTargetLocationID in interface SessionAdminMBean
Returns:
the target location ID

getSenderCompID

public java.lang.String getSenderCompID()
Description copied from interface: SessionAdminMBean
Get the sender company ID for the session.

Specified by:
getSenderCompID in interface SessionAdminMBean
Returns:
the sender company ID

getSenderSubID

public java.lang.String getSenderSubID()
Description copied from interface: SessionAdminMBean
Get the sender company subID for the session.

Specified by:
getSenderSubID in interface SessionAdminMBean
Returns:
the sender subID

getSenderLocationID

public java.lang.String getSenderLocationID()
Description copied from interface: SessionAdminMBean
Get the sender company location ID for the session.

Specified by:
getSenderLocationID in interface SessionAdminMBean
Returns:
the sender location ID

getBeginString

public java.lang.String getBeginString()
Description copied from interface: SessionAdminMBean
Get the begin string (FIX version) for the session

Specified by:
getBeginString in interface SessionAdminMBean
Returns:
the begin string for the session

isLoggedOn

public boolean isLoggedOn()
Specified by:
isLoggedOn in interface SessionAdminMBean

getRemoteIPAddress

public java.lang.String getRemoteIPAddress()

reset

public void reset()
           throws java.io.IOException
Description copied from interface: SessionAdminMBean
Reset the session's sequence numbers and clear it's resend log.

Specified by:
reset in interface SessionAdminMBean
Throws:
java.io.IOException

getNextSenderMsgSeqNum

public int getNextSenderMsgSeqNum()
                           throws java.io.IOException
Description copied from interface: SessionAdminMBean
Get the next sender message sequence number.

Specified by:
getNextSenderMsgSeqNum in interface SessionAdminMBean
Returns:
the next sender message sequence number
Throws:
java.io.IOException

setNextSenderMsgSeqNum

public void setNextSenderMsgSeqNum(int next)
                            throws java.io.IOException
Description copied from interface: SessionAdminMBean
Set the next sender message sequence number. It's dangerous to use this operation on an active session.

Specified by:
setNextSenderMsgSeqNum in interface SessionAdminMBean
Parameters:
next - next sender message sequence number
Throws:
java.io.IOException

setNextTargetMsgSeqNum

public void setNextTargetMsgSeqNum(int next)
                            throws java.io.IOException
Description copied from interface: SessionAdminMBean
Set the next target message sequence number. It's dangerous to use this operation on an active session.

Specified by:
setNextTargetMsgSeqNum in interface SessionAdminMBean
Parameters:
next - the next target message sequence number
Throws:
java.io.IOException

getNextTargetMsgSeqNum

public int getNextTargetMsgSeqNum()
                           throws java.io.IOException
Description copied from interface: SessionAdminMBean
Get the next target message sequence number.

Specified by:
getNextTargetMsgSeqNum in interface SessionAdminMBean
Returns:
next target message sequence number
Throws:
java.io.IOException

getMessages

public java.lang.String[] getMessages(int startSequence,
                                      int endSequence)
                               throws java.io.IOException
Throws:
java.io.IOException

disconnect

public void disconnect()
                throws java.io.IOException
Description copied from interface: SessionAdminMBean
Tell the session to disconnect (implies logoff)

Specified by:
disconnect in interface SessionAdminMBean
Throws:
java.io.IOException

resetSequence

public void resetSequence(int nextSeqNum)
                   throws SessionNotFound
Description copied from interface: SessionAdminMBean
Reset current sequence number

Specified by:
resetSequence in interface SessionAdminMBean
Throws:
SessionNotFound

doSend

protected void doSend(Message message,
                      SessionID sessionID)
               throws SessionNotFound
Helper method to be overridden by tests that handles sending out the message

Throws:
SessionNotFound

logon

public void logon()
Description copied from interface: SessionAdminMBean
Tell the session to logon.

Specified by:
logon in interface SessionAdminMBean

logoff

public void logoff()
Description copied from interface: SessionAdminMBean
Tell the session to logoff.

Specified by:
logoff in interface SessionAdminMBean

isReconnectEnabled

public boolean isReconnectEnabled()

getHost

public java.lang.String getHost()

getProcessID

public java.lang.String getProcessID()

getConnectorName

public javax.management.ObjectName getConnectorName()
Specified by:
getConnectorName in interface SessionAdminMBean

getCheckCompID

public boolean getCheckCompID()
Specified by:
getCheckCompID in interface SessionAdminMBean

getLogClassName

public java.lang.String getLogClassName()
Specified by:
getLogClassName in interface SessionAdminMBean

getLogonTimeout

public int getLogonTimeout()
Specified by:
getLogonTimeout in interface SessionAdminMBean

getLogoutTimeout

public int getLogoutTimeout()
Specified by:
getLogoutTimeout in interface SessionAdminMBean

getMessageFactoryClassName

public java.lang.String getMessageFactoryClassName()
Specified by:
getMessageFactoryClassName in interface SessionAdminMBean

getMessageStoreClassName

public java.lang.String getMessageStoreClassName()
Specified by:
getMessageStoreClassName in interface SessionAdminMBean

getRedundantResendRequestsAllowed

public boolean getRedundantResendRequestsAllowed()
Specified by:
getRedundantResendRequestsAllowed in interface SessionAdminMBean

getRefreshOnLogon

public boolean getRefreshOnLogon()
Specified by:
getRefreshOnLogon in interface SessionAdminMBean

getResetOnDisconnect

public boolean getResetOnDisconnect()
Specified by:
getResetOnDisconnect in interface SessionAdminMBean

getResetOnLogout

public boolean getResetOnLogout()
Specified by:
getResetOnLogout in interface SessionAdminMBean

isLogonAlreadySent

public boolean isLogonAlreadySent()
Specified by:
isLogonAlreadySent in interface SessionAdminMBean

isLogonReceived

public boolean isLogonReceived()
Specified by:
isLogonReceived in interface SessionAdminMBean

isLogonSendNeeded

public boolean isLogonSendNeeded()
Specified by:
isLogonSendNeeded in interface SessionAdminMBean

isLogonSent

public boolean isLogonSent()
Specified by:
isLogonSent in interface SessionAdminMBean

isLogonTimedOut

public boolean isLogonTimedOut()
Specified by:
isLogonTimedOut in interface SessionAdminMBean

isLogoutReceived

public boolean isLogoutReceived()
Specified by:
isLogoutReceived in interface SessionAdminMBean

isLogoutSent

public boolean isLogoutSent()
Specified by:
isLogoutSent in interface SessionAdminMBean

isLogoutTimedOut

public boolean isLogoutTimedOut()
Specified by:
isLogoutTimedOut in interface SessionAdminMBean

setLogonTimeout

public void setLogonTimeout(int seconds)
Specified by:
setLogonTimeout in interface SessionAdminMBean

setLogoutTimeout

public void setLogoutTimeout(int seconds)
Specified by:
setLogoutTimeout in interface SessionAdminMBean

isUsingDataDictionary

public boolean isUsingDataDictionary()
Specified by:
isUsingDataDictionary in interface SessionAdminMBean

getSessionID

public java.lang.String getSessionID()
Description copied from interface: SessionAdminMBean
Get the session ID.

Specified by:
getSessionID in interface SessionAdminMBean
Returns:
the session ID

getEnabled

public boolean getEnabled()
Specified by:
getEnabled in interface SessionAdminMBean

getStartTime

public java.lang.String getStartTime()
Specified by:
getStartTime in interface SessionAdminMBean

getConnectionRole

public java.lang.String getConnectionRole()
Specified by:
getConnectionRole in interface SessionAdminMBean

postDeregister

public void postDeregister()
Specified by:
postDeregister in interface javax.management.MBeanRegistration

postRegister

public void postRegister(java.lang.Boolean registrationDone)
Specified by:
postRegister in interface javax.management.MBeanRegistration

preDeregister

public void preDeregister()
                   throws java.lang.Exception
Specified by:
preDeregister in interface javax.management.MBeanRegistration
Throws:
java.lang.Exception

preRegister

public javax.management.ObjectName preRegister(javax.management.MBeanServer server,
                                               javax.management.ObjectName name)
                                        throws java.lang.Exception
Specified by:
preRegister in interface javax.management.MBeanRegistration
Throws:
java.lang.Exception

onConnect

public void onConnect()
Specified by:
onConnect in interface SessionStateListener

onDisconnect

public void onDisconnect()
Specified by:
onDisconnect in interface SessionStateListener

onLogon

public void onLogon()
Specified by:
onLogon in interface SessionStateListener

onLogout

public void onLogout()
Specified by:
onLogout in interface SessionStateListener

onHeartBeatTimeout

public void onHeartBeatTimeout()
Specified by:
onHeartBeatTimeout in interface SessionStateListener

onMissedHeartBeat

public void onMissedHeartBeat()
Specified by:
onMissedHeartBeat in interface SessionStateListener

onRefresh

public void onRefresh()
Specified by:
onRefresh in interface SessionStateListener

onReset

public void onReset()
Specified by:
onReset in interface SessionStateListener