|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.isti.quakewatch.util.QWAbstractConnector
com.isti.quakewatch.util.QWWebSvcsConnector
public class QWWebSvcsConnector
Class QWWebSvcsConnector manages a connection to a QuakeWatch Web Services Server.
Nested Class Summary | |
---|---|
protected class |
QWWebSvcsConnector.MessageFetchingThread
Class MessageFetchingThread defines a thread used to continuously fetch messages from a QuakeWatch Web Services Server. |
protected class |
QWWebSvcsConnector.WebServicesConnectThread
Class WebServicesConnectThread defines a thread used to connect to a QuakeWatch Web Services Server. |
protected class |
QWWebSvcsConnector.WebServicesDisconnectThread
Class WebServicesDisconnectThread defines a thread used to disconnect from a QuakeWatch Web Services Server. |
Nested classes/interfaces inherited from class com.isti.quakewatch.util.QWAbstractConnector |
---|
QWAbstractConnector.ServerHostInfo, QWAbstractConnector.StatusCheckFailedException |
Constructor Summary | |
---|---|
QWWebSvcsConnector(ConnLoginRejectCallBack connLoginRejectCallBackObj,
QWMessageHandler msgHandlerObj,
CfgPropItem maxServerAliveSecProp,
AddrPortListMgr altServersListMgr,
ConnStatusInterface connStatusObj,
LogFile logObj)
Creates a QW Web Services Server connector object. |
|
QWWebSvcsConnector(QWWebSvcsInterface webSvcsManagerObj,
ConnLoginRejectCallBack connLoginRejectCallBackObj,
QWMessageHandler msgHandlerObj,
CfgPropItem maxServerAliveSecProp,
AddrPortListMgr altServersListMgr,
ConnStatusInterface connStatusObj,
LogFile logObj)
Creates a QW Web Services Server connector object. |
Method Summary | |
---|---|
protected boolean |
doDisconnectClientServices()
Performs the work of disconnecting this client from the server services. |
void |
enterConnectionInfo(java.lang.String userNameStr,
java.lang.String passwordStr,
java.lang.String connPropsStr)
Enters the connection-information values to be sent when the client connects to the server. |
java.lang.String |
fetchClientUpgradeInfoFromServer()
Returns information about available client-program upgrades via the server 'getClientUpgradeInfo()' method. |
java.lang.String |
fetchRedirectedServerLoc()
Returns the location of the server that the client is being redirected to. |
boolean |
getConnectedFlag()
Returns the connection status. |
boolean |
getInitializedFlag()
Returns the "initialized" status of the connection. |
java.lang.String |
getServerIDNameStr()
Returns the server ID name string (defined in the QWServer's configuration file). |
java.lang.String |
getServerRepHostAddrStr()
Returns the host address reported by the server. |
java.lang.String |
getServerRevisionStr()
Returns the server revision string. |
java.lang.String |
getStatusReportData()
Fetches the latest status-report data from the server. |
long |
getStatusReportTime()
Fetches the timestamp value for the latest status report from the server. |
void |
invalidateConnection()
Marks the connection as "invalidated", causing the 'getConnectedFlag()' method to return 'false'. |
boolean |
isReqServerMsgsAvailable()
Returns an indicator of whether or not the 'requestMessages()' method is available on the current server. |
boolean |
isStatusReportDataAvail()
Determines if get-status-report methods are available on the server. |
static boolean |
loadQWWebSvcsManagerClassObj()
Loads the class object for the 'QWWebSvcsManager' class. |
protected void |
notifyConnLoginAttemptRejected(java.lang.String connStatusStr)
Method called when a connect-to-server login attempt was rejected. |
boolean |
performClientStatusCheck()
Calls the server 'clientStatusCheck()' method. |
void |
requestServerAliveMsg()
Requests that the server send an 'Alive' message immediately. |
java.lang.String |
requestServerMessages(long timeVal,
long msgNum,
java.lang.String hostMsgNumListStr)
Requests that messages newer or equal to the specified time value or later than the specified message number be returned from the server. |
void |
shutdownConnection(boolean showPopupFlag)
Shuts down the connection and waits for the disconnect to complete or timeout. |
void |
startConnectViaHostInfo(java.lang.String serverHostAddrStr,
int serverHostPortNum,
boolean showPopupFlag)
Starts a new thread that establishes a connection to a QWServer. |
void |
startDisconnectThread()
Starts a new thread that disconnects the QW web services connection. |
void |
terminateConnectThread(int numWaitSecs)
Terminates and disposes any event channel connect thread that is running. |
void |
terminateDisconnectThread(int numWaitSecs)
Terminates and disposes any event channel disconnect thread that is running. |
void |
updateConnectParams(java.lang.String clientHostAddress,
int clientPortNum)
Updates the connection parameters to be used on the next initialization. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final int DEF_POLLINGITVL_MS
protected final QWWebSvcsInterface webSvcsManagerObj
protected final QWMessageHandler msgHandlerObj
protected final CfgPropItem maxServerAliveSecProp
protected final AddrPortListMgr altServersListMgr
protected static java.lang.Class webSvcsManagerClassObj
protected static java.lang.String webSvcsMgrClassErrMsgStr
protected java.lang.String webSvcsInitErrorMsgStr
protected boolean connectedToServerFlag
protected ConnLoginRejectCallBack connLoginRejectCallBackObj
protected QWWebSvcsConnector.WebServicesConnectThread webSvcsConnectThreadObj
protected final java.lang.Object webSvcsConnThreadSyncObj
protected QWWebSvcsConnector.WebServicesDisconnectThread webSvcsDisconnectThreadObj
protected final java.lang.Object webSvcsDisconnThreadSyncObj
protected QWWebSvcsConnector.MessageFetchingThread messageFetchingThreadObj
protected final java.lang.Object msgFetchingThreadSyncObj
protected int messagePollingIntervalMS
protected boolean aliveMessageRequestedFlag
Constructor Detail |
---|
public QWWebSvcsConnector(QWWebSvcsInterface webSvcsManagerObj, ConnLoginRejectCallBack connLoginRejectCallBackObj, QWMessageHandler msgHandlerObj, CfgPropItem maxServerAliveSecProp, AddrPortListMgr altServersListMgr, ConnStatusInterface connStatusObj, LogFile logObj)
webSvcsManagerObj
- QW Web Services Server manager to use, or
null to dynamically instantiate 'QWWebSvcsManager'.connLoginRejectCallBackObj
- call-back object whose method is
invoked when a connect-login-attempt cannot be completed, or null for
none.msgHandlerObj
- 'QWMessageHandler' object to use, or null for
none.maxServerAliveSecProp
- configuration property object specifying
maximum # of seconds between server-alive messages, or null to have
default value used.altServersListMgr
- alternate servers list manager object, or
null for none.connStatusObj
- connection-status panel object, or null for none.logObj
- log-file object to be used, or null for none.public QWWebSvcsConnector(ConnLoginRejectCallBack connLoginRejectCallBackObj, QWMessageHandler msgHandlerObj, CfgPropItem maxServerAliveSecProp, AddrPortListMgr altServersListMgr, ConnStatusInterface connStatusObj, LogFile logObj)
connLoginRejectCallBackObj
- call-back object whose method is
invoked when a connect-login-attempt cannot be completed, or null for
none.msgHandlerObj
- 'QWMessageHandler' object to use, or null for
none.maxServerAliveSecProp
- configuration property object specifying
maximum # of seconds between server-alive messages, or null to have
default value used.altServersListMgr
- alternate servers list manager object, or
null for none.connStatusObj
- connection-status panel object, or null for none.logObj
- log-file object to be used, or null for none.Method Detail |
---|
public static boolean loadQWWebSvcsManagerClassObj()
public void updateConnectParams(java.lang.String clientHostAddress, int clientPortNum)
updateConnectParams
in class QWAbstractConnector
clientHostAddress
- an IP address to be associated with this
client, or null to have the address auto-determined.clientPortNum
- a port address value to be associated with this
client, or 0 to have the port address auto-determined.public void enterConnectionInfo(java.lang.String userNameStr, java.lang.String passwordStr, java.lang.String connPropsStr)
enterConnectionInfo
in class QWAbstractConnector
userNameStr
- the user name string to use.passwordStr
- the password string to use.connPropsStr
- the connection-information properties string to
use.public void startConnectViaHostInfo(java.lang.String serverHostAddrStr, int serverHostPortNum, boolean showPopupFlag)
startConnectViaHostInfo
in class QWAbstractConnector
serverHostAddrStr
- the host address used to locate the server.serverHostPortNum
- the port number used to locate the server.showPopupFlag
- true to force the connection status popup
dialog to be shown.public void terminateConnectThread(int numWaitSecs)
numWaitSecs
- number of seconds to wait for thread to finish
terminating.public void shutdownConnection(boolean showPopupFlag)
shutdownConnection
in class QWAbstractConnector
showPopupFlag
- true to force the connection status popup
dialog to be shown.public void startDisconnectThread()
public void terminateDisconnectThread(int numWaitSecs)
numWaitSecs
- number of seconds to wait for thread to finish
terminating.protected boolean doDisconnectClientServices()
doDisconnectClientServices
in class QWAbstractConnector
public java.lang.String getServerIDNameStr()
getServerIDNameStr
in class QWAbstractConnector
public java.lang.String getServerRepHostAddrStr()
getServerRepHostAddrStr
in class QWAbstractConnector
public java.lang.String getServerRevisionStr()
getServerRevisionStr
in class QWAbstractConnector
public void requestServerAliveMsg()
requestServerAliveMsg
in class QWAbstractConnector
public boolean isReqServerMsgsAvailable()
isReqServerMsgsAvailable
in class QWAbstractConnector
public java.lang.String requestServerMessages(long timeVal, long msgNum, java.lang.String hostMsgNumListStr)
[QWresend NumRequested="10"] [QWmessage ...] [/QWmessage] [QWmessage ...] [/QWmessage] ... [/QWresend](Substitute angle brackets for square brackets.) The number of messages that would be required to fill the request is returned in the "NumRequested" attribute. However, no more than the oldest 'maxResendNumMsgs' number of messages will be returned in any single call to this method (additional calls may be needed to fetch all of the desired messages).
requestServerMessages
in class QWAbstractConnector
timeVal
- the time-generated value for message associated with
the given message number, or the requested time value to be used
(milliseconds since 1/1/1970).msgNum
- the message number to use, or 0 or none.hostMsgNumListStr
- a list of feeder-data-source
host-name/message-number entries, or null or empty string
if the "requestSourced...()" methods should not be used.
public boolean performClientStatusCheck() throws java.lang.NoSuchMethodException, QWAbstractConnector.StatusCheckFailedException
performClientStatusCheck
in class QWAbstractConnector
java.lang.NoSuchMethodException
- if the 'clientStatusCheck()' method
is not implemented on the server.
StatusCheckFailedException
- if the call to 'clientStatusCheck()'
failed with an exception other than 'NoSuchMethodException'.
QWAbstractConnector.StatusCheckFailedException
public java.lang.String fetchClientUpgradeInfoFromServer()
fetchClientUpgradeInfoFromServer
in class QWAbstractConnector
public java.lang.String fetchRedirectedServerLoc()
fetchRedirectedServerLoc
in class QWAbstractConnector
public boolean isStatusReportDataAvail()
isStatusReportDataAvail
in class QWAbstractConnector
public long getStatusReportTime()
getStatusReportTime
in class QWAbstractConnector
public java.lang.String getStatusReportData()
getStatusReportData
in class QWAbstractConnector
protected void notifyConnLoginAttemptRejected(java.lang.String connStatusStr)
connStatusStr
- a message-string describing the status of
the current connection to the server.public boolean getInitializedFlag()
getInitializedFlag
in class QWAbstractConnector
public boolean getConnectedFlag()
getConnectedFlag
in class QWAbstractConnector
public void invalidateConnection()
invalidateConnection
in class QWAbstractConnector
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |