|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--org.PingOO.DLAI.PPM.io.MasterConnectionManager
This is the client side of PingOO.
It manages all readings and writings on the socket connection.
Using this gateway the PPM will send and receive datas to and from the PERL Server.
ConnectionManager| Field Summary | |
private static int |
BUFFER_SIZE
Determines the common maximum size of a buffer. |
private ExtendedDataInputStream |
dataInputStream
The InputStream reader needed to receive datas from the server. |
private java.io.DataOutputStream |
dataOutputStream
The OutputStream writer needed to emit data towards the server. |
private java.lang.String |
hostName
The name of the PERL Server's host. |
private int |
hostPort
The port of the PERL Server on the host. |
private static java.lang.String |
LINE_TAG
Marks the end of the line. |
private static java.lang.String |
MESSAGE_CRYPTED
The tag which indicates the end of a line buffer. |
private static java.lang.String |
MESSAGE_NORMAL
The tag which indicates the end of a line buffer. |
private java.net.Socket |
socket
The socket for the connection. |
| Constructor Summary | |
MasterConnectionManager()
Constructs a new ConnectionManager. |
|
| Method Summary | |
void |
connect(java.lang.String hostName,
int hostPort)
Connects to the defined server's host and port. |
void |
disconnect()
Cuts the connection with the server. |
byte[] |
get()
Gets a message from the server complete without the encapsulating tags. |
byte[] |
get(int size)
Gets a message from the server complete without the end tag. |
int |
getBuffer(byte[] message)
Gets a binary buffer from the server. |
java.lang.String |
getLine()
Gets a message line from the server. |
void |
reconnect()
Reconnects to the server's host. |
void |
send(byte[] data)
Sends a byte array to the server. |
void |
send(java.lang.String message)
Sends a String message to the server. |
void |
sendCrypted(byte[] data)
Sends an encrypted byte array to the server. |
void |
sendCrypted(java.lang.String message)
Sends an encrypted String message to the server. |
void |
sendLine(java.lang.String message)
Sends a String message to the server. |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
private java.lang.String hostName
private int hostPort
private java.net.Socket socket
private java.io.DataOutputStream dataOutputStream
private ExtendedDataInputStream dataInputStream
private static final java.lang.String MESSAGE_NORMAL
private static final java.lang.String MESSAGE_CRYPTED
private static final java.lang.String LINE_TAG
private static final int BUFFER_SIZE
| Constructor Detail |
public MasterConnectionManager()
| Method Detail |
public final void sendLine(java.lang.String message)
throws java.io.IOException,
java.lang.NullPointerException
BEGIN_CRYPTED
...
SIZE
message - The message to send.null.
public final void send(byte[] data)
throws java.io.IOException,
java.lang.NullPointerException
BEGIN_CRYPTED
...
SIZE
message - The byte array to send.null.
public final void send(java.lang.String message)
throws java.io.IOException,
java.lang.NullPointerException
BEGIN_CRYPTED
...
SIZE
message - The message to send.null.
public final void sendCrypted(java.lang.String message)
throws java.io.IOException,
java.lang.NullPointerException
BEGIN_CRYPTED
...
SIZE
message - The message to send.null.
public final void sendCrypted(byte[] data)
throws java.io.IOException,
java.lang.NullPointerException
BEGIN_CRYPTED
...
SIZE
message - The byte array to send.null.
public final byte[] get()
throws java.io.IOException
public final byte[] get(int size)
throws java.io.IOException
size - the size of the message we want to get.
public final int getBuffer(byte[] message)
throws java.io.IOException
public final java.lang.String getLine()
throws java.io.IOException
public final void connect(java.lang.String hostName,
int hostPort)
throws java.io.IOException,
java.lang.SecurityException,
NotConnectedException
hostName - The name of the server's host.hostPort - The port of the server on its host.checkConnect method doesn't allow the operation.
public final void reconnect()
throws java.io.IOException,
java.lang.SecurityException,
NotConnectedException
checkConnect method doesn't allow the operation.
public final void disconnect()
throws java.io.IOException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||