|
QJCC homepage | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object biz.chitec.quarterback.gjsa.ServerConnector biz.chitec.quarterback.gjsa.LegacyServerConnector
Class to connect a Java client to a GJSA server. Connects to a server with a Client. Sets server immideately in object connective mode if protocol families are equal and then holds the connection open.
A connection desaster listener can be hooked on, whose method connectionDesaster() is called if the connection breaks down.
For now, there are two ways to interact with the server. The simple one is to call the query() method with a query, which will return with the server's reply. The is a so-called "synchronous message".
Furthermore, it is possible to register a FreeFloatingHandler. This one gets every message that comes from the server without a special query (a free floating message).
Nested Class Summary | |
private class |
LegacyServerConnector.LineWakeupToggler
sends from time to time empty request to server to prevent it from closing the connection. |
(package private) static class |
LegacyServerConnector.Reader
reader thread for a server connector. |
Field Summary | |
protected boolean |
backgroundsession
|
protected java.io.BufferedWriter |
bos
Description of the Field |
protected ConnectionEncryptionPresentor |
cep
Description of the Field |
protected java.util.List |
conndeslist
Description of the Field |
protected boolean |
connectionclosed
Description of the Field |
protected ConnectionStatePresentor |
csp
Description of the Field |
protected boolean |
desasteroccured
Description of the Field |
protected boolean |
emptyafter
Description of the Field |
protected boolean |
encmode
Description of the Field |
protected java.lang.String |
encryptionstrategy
Description of the Field |
protected static EncryptionRulesSymbols |
ers
Description of the Field |
protected static EncryptionStrategySymbols |
ess
Description of the Field |
protected ThreadInterface |
ffi
Description of the Field |
static int |
FLOODTIME
Description of the Field |
protected boolean |
forcestring
Description of the Field |
protected java.lang.String |
host
Description of the Field |
protected static long |
LINETOGGLETIME
Description of the Field |
protected LegacyServerConnector.LineWakeupToggler |
lwt
Description of the Field |
static int |
MAXFLOODCOUNT
Description of the Field |
protected Logger |
mess
Description of the Field |
protected boolean |
mustbereestablished
Description of the Field |
int |
myscnum
Description of the Field |
protected boolean |
objmode
Description of the Field |
protected java.io.ObjectOutputStream |
oos
Description of the Field |
protected java.lang.String |
pname
Description of the Field |
protected int |
port
Description of the Field |
protected boolean |
printerr
Description of the Field |
protected java.util.List |
pvp
Description of the Field |
protected LegacyServerConnector.Reader |
reader
Description of the Field |
protected ServerEnvelope |
reestablishcommands
Description of the Field |
private static int |
sbrcounter
Counter for attached SyncBurstReceivers |
static int |
SLEEPTIME
Description of the Field |
protected java.net.Socket |
socket
Description of the Field |
static int |
SOCKET_SO_TIME
Timeout for the socket in initialisation phase. |
protected ServerRequest |
sr
Description of the Field |
protected boolean |
sslmode
Description of the Field |
protected static int |
staticlwtnum
Description of the Field |
protected static int |
staticnum
Description of the Field |
protected static int |
staticreadernum
Description of the Field |
protected SyncBurstReceiver |
syncburstreceiver
Description of the Field |
protected java.lang.Thread |
syncburstreceiverthread
Description of the Field |
protected ThreadInterface |
ti
Description of the Field |
Constructor Summary | |
LegacyServerConnector(int port)
Constructor for the ServerConnector object |
|
LegacyServerConnector(java.lang.String host,
int port)
Constructor for the ServerConnector object |
|
LegacyServerConnector(java.lang.String host,
int port,
java.lang.String encstrat)
Constructor for the ServerConnector object |
|
LegacyServerConnector(java.lang.String host,
int port,
java.lang.String pname,
java.util.List pvp)
Constructor for the ServerConnector object |
|
LegacyServerConnector(java.lang.String host,
int port,
java.lang.String pname,
java.util.List pvp,
boolean forcestring,
boolean emptyafter)
Constructor for the ServerConnector object |
|
LegacyServerConnector(java.lang.String xhost,
int xport,
java.lang.String xpname,
java.util.List xpvp,
boolean xforcestring,
boolean xemptyafter,
java.lang.String xencstrat)
tries to open a connection to the given host/port-pair. |
|
LegacyServerConnector(java.lang.String host,
int port,
java.lang.String pname,
java.util.List pvp,
java.lang.String encstrat)
Constructor for the ServerConnector object |
Method Summary | |
void |
addConnectionDesasterListener(ConnectionDesasterListener cdl)
Adds a feature to the ConnectionDesasterListener attribute of the ServerConnector object |
void |
addConnectionEncryptionPresentor(ConnectionEncryptionPresentor ccep)
Adds a feature to the ConnectionEncryptionPresentor attribute of the ServerConnector object |
void |
addConnectionStatePresentor(ConnectionStatePresentor ccsp)
Adds a feature to the ConnectionStatePresentor attribute of the ServerConnector object |
void |
attachSyncBurstReceiver(SyncBurstReceiver sbr)
Attaches and starts a SyncBurstReceiver to this ServerConnector. |
void |
close()
Description of the Method |
protected void |
closeConnection()
Description of the Method |
void |
connDesaster()
Description of the Method |
void |
connectionOnHold(ServerEnvelope reest)
Closes the connection to the server transparently for higher layers. |
void |
disableErrorMsgs()
Description of the Method |
int |
getEncodingMode()
Return encoding of the connection |
protected boolean |
getEncryptionAdvice(int clientstrategy,
int serverwish)
Determines whether the connection should be encrypted or not. |
private java.util.List |
getFirstAndSecondVersionPart(java.lang.String vers)
Gets the firstAndSecondVersionPart attribute of the ServerConnector object |
boolean |
isBackgroundSession()
Return whether the connector is throttling. |
boolean |
isEncrypting()
Gets the encrypting attribute of the ServerConnector object |
boolean |
isObjectConnection()
Gets the objectConnection attribute of the ServerConnector object |
private void |
keepLine()
Description of the Method |
protected void |
openConnection()
opens the connection to the server. |
ServerEnvelope |
query(ServerEnvelope se)
low level query routine with IOException |
void |
removeConnectionDesasterListener(ConnectionDesasterListener cdl)
Description of the Method |
void |
removeConnectionStatePresentor()
Description of the Method |
void |
setBackgroundSession(boolean t)
Set the connector to "throttling" mode => if someone else is sending, wait for that one to finish. |
void |
setFreeFloatingInterface(ThreadInterface ti)
Sets the freeFloatingInterface attribute of the ServerConnector object |
void |
setMessageLogger(Logger mx)
Sets the messageLogger attribute of the ServerConnector object |
void |
setReaderPriority(int newprio)
Sets the readerPriority attribute of the ServerConnector object |
void |
startLineWakeupToggler()
Description of the Method |
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 |
protected static final EncryptionRulesSymbols ers
protected static final EncryptionStrategySymbols ess
private static int sbrcounter
public static final int SOCKET_SO_TIME
public static final int FLOODTIME
public static final int MAXFLOODCOUNT
public static final int SLEEPTIME
protected static final long LINETOGGLETIME
protected static int staticnum
protected static int staticreadernum
protected static int staticlwtnum
public int myscnum
protected java.net.Socket socket
protected LegacyServerConnector.Reader reader
protected java.io.ObjectOutputStream oos
protected java.io.BufferedWriter bos
protected boolean objmode
protected boolean encmode
protected boolean sslmode
protected boolean desasteroccured
protected boolean connectionclosed
protected java.util.List conndeslist
protected ConnectionStatePresentor csp
protected ConnectionEncryptionPresentor cep
protected ThreadInterface ti
protected ServerRequest sr
protected Logger mess
protected java.lang.String host
protected int port
protected java.lang.String pname
protected java.util.List pvp
protected boolean forcestring
protected boolean emptyafter
protected boolean printerr
protected LegacyServerConnector.LineWakeupToggler lwt
protected ServerEnvelope reestablishcommands
protected boolean mustbereestablished
protected ThreadInterface ffi
protected java.lang.String encryptionstrategy
protected java.lang.Thread syncburstreceiverthread
protected SyncBurstReceiver syncburstreceiver
protected boolean backgroundsession
Constructor Detail |
public LegacyServerConnector(java.lang.String xhost, int xport, java.lang.String xpname, java.util.List xpvp, boolean xforcestring, boolean xemptyafter, java.lang.String xencstrat) throws java.io.IOException
xhost
- Description of the Parameterxport
- Description of the Parameterxpname
- Description of the Parameterxpvp
- Description of the Parameterxforcestring
- Description of the Parameterxemptyafter
- Description of the Parameterxencstrat
- Description of the Parameter
java.io.IOException
- Description of the Exceptionpublic LegacyServerConnector(java.lang.String host, int port, java.lang.String pname, java.util.List pvp, boolean forcestring, boolean emptyafter) throws java.io.IOException
host
- Description of the Parameterport
- Description of the Parameterpname
- Description of the Parameterpvp
- Description of the Parameterforcestring
- Description of the Parameteremptyafter
- Description of the Parameter
java.io.IOException
- Description of the Exceptionpublic LegacyServerConnector(java.lang.String host, int port, java.lang.String pname, java.util.List pvp, java.lang.String encstrat) throws java.io.IOException
host
- Description of the Parameterport
- Description of the Parameterpname
- Description of the Parameterpvp
- Description of the Parameterencstrat
- Description of the Parameter
java.io.IOException
- Description of the Exceptionpublic LegacyServerConnector(java.lang.String host, int port, java.lang.String pname, java.util.List pvp) throws java.io.IOException
host
- Description of the Parameterport
- Description of the Parameterpname
- Description of the Parameterpvp
- Description of the Parameter
java.io.IOException
- Description of the Exceptionpublic LegacyServerConnector(java.lang.String host, int port, java.lang.String encstrat) throws java.io.IOException
host
- Description of the Parameterport
- Description of the Parameterencstrat
- Description of the Parameter
java.io.IOException
- Description of the Exceptionpublic LegacyServerConnector(java.lang.String host, int port) throws java.io.IOException
host
- Description of the Parameterport
- Description of the Parameter
java.io.IOException
- Description of the Exceptionpublic LegacyServerConnector(int port) throws java.io.IOException
port
- Description of the Parameter
java.io.IOException
- Description of the ExceptionMethod Detail |
private java.util.List getFirstAndSecondVersionPart(java.lang.String vers)
vers
- Description of the Parameter
protected boolean getEncryptionAdvice(int clientstrategy, int serverwish)
Client\Server | no encryption | FORBIDDEN | NOTNEEDED | WANTED | REQUIRED |
---|---|---|---|---|---|
never | clear | clear | clear | clear | fail |
onrequire | clear | clear | clear | clear | encrypted |
onwanted | clear | clear | clear | encrypted | encrypted |
always | clear | clear | encrypted | encrypted | encrypted |
alwaysforced | fail | fail | encrypted | encrypted | encrypted |
clientstrategy
- Description of the Parameterserverwish
- Description of the Parameter
protected void openConnection() throws java.io.IOException
java.io.IOException
- Description of the Exceptionpublic boolean isEncrypting()
isEncrypting
in class ServerConnector
public void connectionOnHold(ServerEnvelope reest) throws java.io.IOException
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.
connectionOnHold
in class ServerConnector
reest
- Description of the Parameter
java.io.IOException
- Description of the Exceptionpublic void setMessageLogger(Logger mx)
setMessageLogger
in class ServerConnector
mx
- The new messageLogger valuepublic void disableErrorMsgs()
disableErrorMsgs
in class ServerConnector
public void startLineWakeupToggler()
startLineWakeupToggler
in class ServerConnector
public void stopSyncBurstReceiver()
stopSyncBurstReceiver
in class ServerConnector
public void attachSyncBurstReceiver(SyncBurstReceiver sbr)
attachSyncBurstReceiver
in class ServerConnector
sbr
- Description of the Parameterprotected void closeConnection()
public void close()
close
in class ServerConnector
public void connDesaster()
connDesaster
in class ServerConnector
public void addConnectionStatePresentor(ConnectionStatePresentor ccsp)
addConnectionStatePresentor
in class ServerConnector
ccsp
- The feature to be added to the ConnectionStatePresentor attributepublic void addConnectionEncryptionPresentor(ConnectionEncryptionPresentor ccep)
addConnectionEncryptionPresentor
in class ServerConnector
ccep
- The feature to be added to the ConnectionEncryptionPresentor attributepublic void removeConnectionStatePresentor()
removeConnectionStatePresentor
in class ServerConnector
public void setBackgroundSession(boolean t)
ServerConnector
setBackgroundSession
in class ServerConnector
public boolean isBackgroundSession()
ServerConnector
isBackgroundSession
in class ServerConnector
public boolean isObjectConnection()
public int getEncodingMode()
ServerConnector
getEncodingMode
in class ServerConnector
public void addConnectionDesasterListener(ConnectionDesasterListener cdl)
addConnectionDesasterListener
in class ServerConnector
cdl
- The feature to be added to the ConnectionDesasterListener attributepublic void removeConnectionDesasterListener(ConnectionDesasterListener cdl)
removeConnectionDesasterListener
in class ServerConnector
cdl
- Description of the Parameterpublic void setFreeFloatingInterface(ThreadInterface ti)
setFreeFloatingInterface
in class ServerConnector
ti
- The new freeFloatingInterface valuepublic void setReaderPriority(int newprio)
setReaderPriority
in class ServerConnector
newprio
- The new readerPriority valueprivate void keepLine() throws java.io.IOException
java.io.IOException
- Description of the Exceptionpublic ServerEnvelope query(ServerEnvelope se) throws java.io.IOException
query
in class ServerConnector
se
- Description of the Parameter
java.io.IOException
- Description of the ExceptionServerEnvelope
|
QJCC homepage | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |