|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--org.PingOO.DLAI.lib.net.UpperProtocol
|
+--org.PingOO.DLAI.PPM.net.MasterProtocol
This is the main PingOO protocol object.
It sends and receives messages to and from the PingOO PERL server conforming to the high-level protocol established for connection with such a server.
It's basically just an automaton which desbribs how the connection work.
| Field Summary | |
private static java.lang.String |
CLIENT_BEGIN
The first message sent to the server. |
private static java.lang.String |
CLIENT_RECONNECT
The first message sent to the server when there is a reconnection. |
private static int |
DIALOG_BEGIN
This is the begin state in the protocol. |
private static int |
DIALOG_END
This is the end state in the protocol. |
private static int |
DIALOG_ERROR
There is a connection error. |
private static int |
DIALOG_LOGIN
The client must now identify itself and provide login name ad password to the server. |
private static int |
DIALOG_LOGIN_FAILED
The login procedure failed. |
private static int |
DIALOG_OK
After all intializations, the client and the server can now dialog. |
private static int |
DIALOG_UPDATE
An update of the client's packages is needed. |
private static java.lang.String |
hostName
|
private static int |
hostPort
|
private static java.lang.String |
ID_SESSION
|
private static java.lang.String |
NO_UPDATE
|
private static java.lang.String |
PASSWORD_SALT
|
private int |
state
Current sate in the PingOO protocol. |
private static java.lang.String |
VERSION
|
| Fields inherited from class org.PingOO.DLAI.lib.net.UpperProtocol |
connectionManager,
formatter |
| Constructor Summary | |
MasterProtocol()
Creates a new protocol. |
|
| Method Summary | |
private void |
connectionLostErrorRaise()
Manages not connected error level. |
private void |
connectionLostErrorRaise(java.io.IOException ioe)
Manages not connected error level. |
MessageHashtable |
getUpdate(MessageHashtable message)
Sends a signed and crypted request to the server and get the answer along the current state in the PingOO protocol |
void |
initialize(java.lang.String hostName,
int hostPort,
java.lang.String loginName,
java.lang.String loginPassword,
java.lang.String PPMVersion)
Initializes a new MasterProtocol and connect to the server. |
private void |
loginErrorRaise()
Manages login error level. |
private void |
loginErrorRaise(java.lang.String msg)
Manages login error level. |
protected MessageHashtable |
makeByeMessage(java.lang.String slaveName)
Creates the message sent to the server for closing the connection. |
MessageHashtable |
makeLanguageMessage(java.util.Locale locale)
Sets the language the server will use with this client and all connection that are in the same session. |
protected MessageHashtable |
makeLoginMessage(java.lang.String loginName)
Creates the message sent to the server for login autentification. |
protected MessageHashtable |
makePasswordMessage(java.lang.String loginPassword)
|
protected MessageHashtable |
makeReconnectMessage(java.lang.String slaveName)
|
protected MessageHashtable |
makeVersionMessage(java.lang.String version)
Creates the message sent to the server for version checking. |
ConnectionManager |
reconnect(java.lang.String slaveName)
Used when the appli manager wants to open a new channel for a new slave. |
MessageHashtable |
request(MessageHashtable message)
Sends an signed but uncrypted request to the server and get the answer along the current state in the PingOO protocol |
MessageHashtable |
requestCrypted(MessageHashtable message)
Sends a signed and crypted request to the server and get the answer along the current state in the PingOO protocol |
void |
terminate()
Disconnect from the server, close the socket and return in initial mode. |
private void |
updateNeededRaise()
Manages login error level. |
| Methods inherited from class org.PingOO.DLAI.lib.net.UpperProtocol |
getConnectionManager,
getMessageFormatter,
request,
request,
requestCrypted,
requestCrypted,
terminate |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
private static final int DIALOG_BEGIN
private static final int DIALOG_LOGIN
private static final int DIALOG_ERROR
private static final int DIALOG_UPDATE
private static final int DIALOG_LOGIN_FAILED
private static final int DIALOG_OK
private static final int DIALOG_END
private int state
private static final java.lang.String CLIENT_BEGIN
private static final java.lang.String CLIENT_RECONNECT
private static final java.lang.String ID_SESSION
private static final java.lang.String VERSION
private static final java.lang.String PASSWORD_SALT
private static final java.lang.String NO_UPDATE
private static java.lang.String hostName
private static int hostPort
| Constructor Detail |
public MasterProtocol()
| Method Detail |
public final void initialize(java.lang.String hostName,
int hostPort,
java.lang.String loginName,
java.lang.String loginPassword,
java.lang.String PPMVersion)
throws NotConnectedException,
ConnectionLostException,
LoginFailedException,
UpdateNeededException
hostName - The name of the server's host.hostPort - The port of the server on its host.loginName - The user's login.loginPassword - The user's password.PPMVersion - the Java PPM's version.
public final ConnectionManager reconnect(java.lang.String slaveName)
throws NotConnectedException,
LoginFailedException
public final MessageHashtable request(MessageHashtable message)
throws java.lang.NullPointerException,
RequestFailedException,
NotConnectedException,
ConnectionLostException
message - The message to send to the server.
public final MessageHashtable requestCrypted(MessageHashtable message)
throws java.lang.NullPointerException,
RequestFailedException,
NotConnectedException,
ConnectionLostException
message - The message to send to the server.
public final MessageHashtable getUpdate(MessageHashtable message)
throws java.lang.NullPointerException,
RequestFailedException,
NotConnectedException,
ConnectionLostException
message - The message to send to the server.public final void terminate()
private final void connectionLostErrorRaise()
throws ConnectionLostException
private final void connectionLostErrorRaise(java.io.IOException ioe)
throws ConnectionLostException
ioe -
private final void loginErrorRaise()
throws LoginFailedException
private final void loginErrorRaise(java.lang.String msg)
throws LoginFailedException
msg - The message to pass to the exception.
private final void updateNeededRaise()
throws UpdateNeededException
protected final MessageHashtable makeLoginMessage(java.lang.String loginName)
loginName - The user's login.loginPassword - The user's password.protected final MessageHashtable makePasswordMessage(java.lang.String loginPassword)
protected final MessageHashtable makeReconnectMessage(java.lang.String slaveName)
protected final MessageHashtable makeVersionMessage(java.lang.String version)
protected final MessageHashtable makeByeMessage(java.lang.String slaveName)
public final MessageHashtable makeLanguageMessage(java.util.Locale locale)
locale - The language to be set.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||