|
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.SessionedServerConnector
Low level communication with GJSA server Keeps connection to server one way or the other. Gets all data from server and passes it to the appropriate SessionConnector object. All ServerConnectors are connected to this one and send and receive data from here. SessionedServerConnector tells interested party through PropertyChangeEvents what is happening with the connection. The following property names and values can be sent during normal operation:
Nested Class Summary | |
private class |
SessionedServerConnector.BackgroundConnectionOpener
Seperate thread for connection opening in the background. |
Field Summary | |
private SessionedServerConnector.BackgroundConnectionOpener |
bco
|
protected boolean |
connected
|
protected int |
connectionport
|
protected int |
encodingmode
|
protected boolean |
encrypted
|
private java.util.List |
freefloatingreceivers
|
protected Logger |
mess
|
protected int |
myscno
|
protected java.beans.PropertyChangeSupport |
pcs
|
private static int |
sccount
|
private java.util.Map |
serverconnectors
For passing free floating information. |
protected java.lang.String |
serverseenclientip
|
protected java.lang.String |
serverseenclientname
|
private SessionConnector |
session0
|
static int |
SOCKET_SO_TIME
Timeout for the socket in initialisation phase. |
private static boolean |
sslavailable
|
protected java.lang.String[] |
sslciphers
|
protected javax.net.ssl.SSLSocketFactory |
sslfactory
|
protected boolean |
transmitting
|
Constructor Summary | |
SessionedServerConnector()
|
Method Summary | |
void |
addFreeFloatingReceiver(ThreadInterface ti)
Add a new receiver for free floating messages. |
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
|
void |
addPropertyChangeListener(java.lang.String propertyname,
java.beans.PropertyChangeListener listener)
|
void |
closeConnection()
Close the connection. |
protected abstract void |
doCloseConnection()
Perform necessary operations to actually close the connection. |
protected abstract void |
doOpenConnection()
Perform necessary operations to actually open the connection. |
protected void |
fireDesaster()
|
protected void |
fireFreeFloatingMessage(ServerEnvelope se)
Fires a free floating message. |
int |
getEncodingMode()
|
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)
Puts first and second part of a multipart version number into a list. |
java.lang.String |
getServerSeenClientIP()
|
java.lang.String |
getServerSeenClientName()
|
SessionConnector |
getSession0()
|
static SessionedServerConnector |
getSessionedServerConnector(java.lang.String host,
int port)
|
static SessionedServerConnector |
getSessionedServerConnector(java.lang.String host,
int port,
java.util.List params)
|
static SessionedServerConnector |
getSessionedServerConnector(java.lang.String host,
int port,
java.util.Map params)
|
boolean |
isConnected()
|
boolean |
isEncrypted()
|
boolean |
isTransmitting()
|
SessionConnector |
openConnection()
Opens the connection to the server. |
void |
openConnectionAsynchronously()
Opens a connection asynchronously without waiting at the beginning. |
void |
openConnectionAsynchronously(long initialwaittime)
Starts a seperate thread which tries to open the connection asynchronously. |
java.lang.Object |
queryOrBranch(ServerEnvelope se)
|
protected abstract ServerEnvelope |
readEnvelope()
Read a reply from the server. |
void |
removeFreeFloatingReceiver(ThreadInterface ti)
Removes a receiver for free floating messages from the internal list. |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
|
void |
removePropertyChangeListener(java.lang.String propertyname,
java.beans.PropertyChangeListener listener)
|
protected void |
setConnected(boolean newconnected)
|
protected void |
setEncodingMode(int newencodingmode)
|
protected void |
setEncrypted(boolean newencrypted)
|
void |
setMessageLogger(Logger mx)
|
abstract void |
setSendKeepAlive(boolean b)
Enables and disables the session connector to/from sending keep alive packets to the server. |
protected void |
setTransmission(boolean newtransmitting)
|
protected void |
setupConnectionParameters(boolean forcestring,
java.util.List clientprotocolversion,
int clientencstrategy,
java.util.Map serverparams)
|
void |
stopOpenConnectionAsynchronously(boolean waitforstop)
Stops an asynchronous connection opening. |
void |
unregisterServerConnector(SessionConnector sc)
|
protected abstract void |
writeEnvelope(ServerEnvelope se)
Write an envelope to the server. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static boolean sslavailable
public static final int SOCKET_SO_TIME
private static int sccount
protected int myscno
private java.util.Map serverconnectors
protected int encodingmode
protected boolean encrypted
protected boolean connected
protected boolean transmitting
protected javax.net.ssl.SSLSocketFactory sslfactory
protected java.lang.String[] sslciphers
protected int connectionport
protected Logger mess
protected java.lang.String serverseenclientip
protected java.lang.String serverseenclientname
protected java.beans.PropertyChangeSupport pcs
private java.util.List freefloatingreceivers
private SessionedServerConnector.BackgroundConnectionOpener bco
private SessionConnector session0
Constructor Detail |
public SessionedServerConnector()
Method Detail |
public java.lang.Object queryOrBranch(ServerEnvelope se) throws java.io.IOException
java.io.IOException
public void unregisterServerConnector(SessionConnector sc)
public java.lang.String getServerSeenClientIP()
public java.lang.String getServerSeenClientName()
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
public void addPropertyChangeListener(java.lang.String propertyname, java.beans.PropertyChangeListener listener)
public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
public void removePropertyChangeListener(java.lang.String propertyname, java.beans.PropertyChangeListener listener)
public int getEncodingMode()
public boolean isEncrypted()
public boolean isConnected()
public boolean isTransmitting()
protected void setEncodingMode(int newencodingmode)
protected void setEncrypted(boolean newencrypted)
protected void setConnected(boolean newconnected)
protected void setTransmission(boolean newtransmitting)
public void setMessageLogger(Logger mx)
protected void fireDesaster()
public SessionConnector openConnection() throws java.io.IOException
java.io.IOException
- If something goes wrong with opening the connection.public SessionConnector getSession0()
public void closeConnection()
protected abstract void doOpenConnection() throws java.io.IOException
java.io.IOException
protected abstract void doCloseConnection()
protected abstract void writeEnvelope(ServerEnvelope se) throws java.io.IOException
java.io.IOException
protected abstract ServerEnvelope readEnvelope() throws java.io.IOException
java.io.IOException
public abstract void setSendKeepAlive(boolean b)
public void addFreeFloatingReceiver(ThreadInterface ti)
ti
- The ThreadInterface to be removedpublic void removeFreeFloatingReceiver(ThreadInterface ti)
ti
- The ThreadInterface to be removedprotected void fireFreeFloatingMessage(ServerEnvelope se)
se
- The message to be sentpublic void openConnectionAsynchronously(long initialwaittime)
initialwaittime
- Milliseconds to wait before the first connection attempt is done.public void openConnectionAsynchronously()
public void stopOpenConnectionAsynchronously(boolean waitforstop)
waitforstop
- If true, method does not return before asynchronous thread has finished.private java.util.List getFirstAndSecondVersionPart(java.lang.String vers)
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
- encryption strategy of the clientserverwish
- encryption wish of the server
protected void setupConnectionParameters(boolean forcestring, java.util.List clientprotocolversion, int clientencstrategy, java.util.Map serverparams)
public static SessionedServerConnector getSessionedServerConnector(java.lang.String host, int port, java.util.Map params)
public static SessionedServerConnector getSessionedServerConnector(java.lang.String host, int port, java.util.List params)
public static SessionedServerConnector getSessionedServerConnector(java.lang.String host, int port)
|
QJCC homepage | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |