QJCC homepage

biz.chitec.quarterback.gjsa
Class QueryOnlyServerConnectorWrapper

java.lang.Object
  extended bybiz.chitec.quarterback.gjsa.ServerConnector
      extended bybiz.chitec.quarterback.gjsa.QueryOnlyServerConnectorWrapper

public class QueryOnlyServerConnectorWrapper
extends ServerConnector

Wrapper around another ServerConnector which only allows to send and receive queries. All methods apart from query(ServerEnvelope) are grounded, i.e. they do nothing and throw an exception.

Version:
$Id: c6612604e03a65464f84d614d0a8b69848b70031 $
Author:
cantamen/Dirk Hillbrecht 2007

Field Summary
private  ServerConnector wrapped
           
 
Constructor Summary
QueryOnlyServerConnectorWrapper(ServerConnector wrappedx)
           
 
Method Summary
 void addConnectionDesasterListener(ConnectionDesasterListener cdl)
          Add listener for connection desasterts
 void addConnectionEncryptionPresentor(ConnectionEncryptionPresentor ccep)
          Adds a presentor for the encryption state
 void addConnectionStatePresentor(ConnectionStatePresentor ccsp)
          Adds a connection state presentor.
 void attachSyncBurstReceiver(SyncBurstReceiver sbr)
          Attaches and starts a SyncBurstReceiver to this ServerConnector.
 void close()
          Closes connection, does nothing if a desaster occured before
 void connDesaster()
          Raises a connection desaster
 void connectionOnHold(ServerEnvelope reest)
          Closes the connection to the server transparently for higher layers.
 void disableErrorMsgs()
           
 int getEncodingMode()
          Return encoding of the connection
 boolean isBackgroundSession()
          Return whether the connector is throttling.
 boolean isEncrypting()
          Gets the encrypting attribute of the ServerConnector object
 ServerEnvelope query(ServerEnvelope se)
          Low level query The ServerEnvelope may contain multiple queries.
 void removeConnectionDesasterListener(ConnectionDesasterListener cdl)
          Remove listener for connection desasters
 void removeConnectionStatePresentor()
          Removes the presentor for the connection state
 void setBackgroundSession(boolean b)
          Set the connector to "throttling" mode => if someone else is sending, wait for that one to finish.
 void setFreeFloatingInterface(ThreadInterface ti)
          Set the interface where free floating messages are sent to.
 void setMessageLogger(Logger mx)
          Sets the messageLogger attribute of the ServerConnector object
 void setReaderPriority(int newprio)
          Set priority of the reader thread.
 void startLineWakeupToggler()
           
 void stopSyncBurstReceiver()
          Stops a currently running SyncBurstReceiver.
 
Methods inherited from class biz.chitec.quarterback.gjsa.ServerConnector
openLegacyServerConnector, openLegacyServerConnector, openLegacyServerConnector, openLegacyServerConnector, openLegacyServerConnector, openLegacyServerConnector, openLegacyServerConnector, query, query, query, query, query, query, query, query, query, query, queryNE, queryNE, queryNE, queryNE, queryNE, queryNE, queryNE, queryNE, queryNE, queryNE, queryNE
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

wrapped

private ServerConnector wrapped
Constructor Detail

QueryOnlyServerConnectorWrapper

public QueryOnlyServerConnectorWrapper(ServerConnector wrappedx)
Method Detail

query

public ServerEnvelope query(ServerEnvelope se)
                     throws java.io.IOException
Description copied from class: ServerConnector
Low level query The ServerEnvelope may contain multiple queries. On return, it will contain the replies to these queries. If the reply to one of these queries is ERROR, NO, or DENIED, the further queries will not be processed any more.

This method is the one which actually communicates with the server. All other query methods finally call this one.

Specified by:
query in class ServerConnector
Parameters:
se - ServerEnvelope with one or more queries set
Returns:
ServerEnvelope with one or more reples set
Throws:
java.io.IOException - If something goes wrong in the communication between client and server
See Also:
ServerEnvelope

getEncodingMode

public int getEncodingMode()
Description copied from class: ServerConnector
Return encoding of the connection

Specified by:
getEncodingMode in class ServerConnector

isBackgroundSession

public boolean isBackgroundSession()
Description copied from class: ServerConnector
Return whether the connector is throttling.

Specified by:
isBackgroundSession in class ServerConnector

isEncrypting

public boolean isEncrypting()
Description copied from class: ServerConnector
Gets the encrypting attribute of the ServerConnector object

Specified by:
isEncrypting in class ServerConnector
Returns:
The encrypting value

addConnectionDesasterListener

public void addConnectionDesasterListener(ConnectionDesasterListener cdl)
Description copied from class: ServerConnector
Add listener for connection desasterts

Specified by:
addConnectionDesasterListener in class ServerConnector

addConnectionEncryptionPresentor

public void addConnectionEncryptionPresentor(ConnectionEncryptionPresentor ccep)
Description copied from class: ServerConnector
Adds a presentor for the encryption state

Specified by:
addConnectionEncryptionPresentor in class ServerConnector

addConnectionStatePresentor

public void addConnectionStatePresentor(ConnectionStatePresentor ccsp)
Description copied from class: ServerConnector
Adds a connection state presentor.

Specified by:
addConnectionStatePresentor in class ServerConnector

attachSyncBurstReceiver

public void attachSyncBurstReceiver(SyncBurstReceiver sbr)
Description copied from class: ServerConnector
Attaches and starts a SyncBurstReceiver to this ServerConnector. The SyncBurstReceiver is started in a new Thread object instantiated directly by this ServerConnector.

Specified by:
attachSyncBurstReceiver in class ServerConnector
Parameters:
sbr - Description of the Parameter

close

public void close()
Description copied from class: ServerConnector
Closes connection, does nothing if a desaster occured before

Specified by:
close in class ServerConnector

connDesaster

public void connDesaster()
Description copied from class: ServerConnector
Raises a connection desaster

Specified by:
connDesaster in class ServerConnector

connectionOnHold

public void connectionOnHold(ServerEnvelope reest)
                      throws java.io.IOException
Description copied from class: ServerConnector
Closes the connection to the server transparently for higher layers. The socket holding the connection to the server is closed. From now on, no connection to the server exists any more.

The next query sent to the ServerConnector will reestablish the connection. After opening the ports, the complete reest ServerEnvelope will be sent to the server to reach the state it had on closing.

Specified by:
connectionOnHold in class ServerConnector
Parameters:
reest - Description of the Parameter
Throws:
java.io.IOException - Description of the Exception

disableErrorMsgs

public void disableErrorMsgs()
Specified by:
disableErrorMsgs in class ServerConnector

removeConnectionDesasterListener

public void removeConnectionDesasterListener(ConnectionDesasterListener cdl)
Description copied from class: ServerConnector
Remove listener for connection desasters

Specified by:
removeConnectionDesasterListener in class ServerConnector

removeConnectionStatePresentor

public void removeConnectionStatePresentor()
Description copied from class: ServerConnector
Removes the presentor for the connection state

Specified by:
removeConnectionStatePresentor in class ServerConnector

setBackgroundSession

public void setBackgroundSession(boolean b)
Description copied from class: ServerConnector
Set the connector to "throttling" mode => if someone else is sending, wait for that one to finish.

Specified by:
setBackgroundSession in class ServerConnector

setFreeFloatingInterface

public void setFreeFloatingInterface(ThreadInterface ti)
Description copied from class: ServerConnector
Set the interface where free floating messages are sent to.

Specified by:
setFreeFloatingInterface in class ServerConnector

setMessageLogger

public void setMessageLogger(Logger mx)
Description copied from class: ServerConnector
Sets the messageLogger attribute of the ServerConnector object

Specified by:
setMessageLogger in class ServerConnector
Parameters:
mx - The new messageLogger value

setReaderPriority

public void setReaderPriority(int newprio)
Description copied from class: ServerConnector
Set priority of the reader thread.

Specified by:
setReaderPriority in class ServerConnector

startLineWakeupToggler

public void startLineWakeupToggler()
Specified by:
startLineWakeupToggler in class ServerConnector

stopSyncBurstReceiver

public void stopSyncBurstReceiver()
Description copied from class: ServerConnector
Stops a currently running SyncBurstReceiver. Called internally everytime a sync burst must be stopped. It doesn't hurt to call this method with no sync burst running.

Specified by:
stopSyncBurstReceiver in class ServerConnector

QJCC homepage