org.PingOO.DLAI.lib.io
Interface ConnectionManager

All Known Implementing Classes:
MasterConnectionManager

public abstract interface ConnectionManager

The interface wich describs the needed functions for a Java client.

Since:
PingOO 2.0
Version:
2.0
Author:
Fabrice Bouyé (bouye@cur-archamps.fr)

Method Summary
 void disconnect()
          Cuts the connection with the server.
 byte[] get()
          Gets a message from the server..
 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.
 

Method Detail

send

public void send(byte[] data)
          throws java.io.IOException,
                 java.lang.NullPointerException
Sends a byte array to the server.
Parameters:
data - The byte array to send.
Throws:
java.io.IOException - If an I/O error occurs.
java.lang.NullPointerException - if data is null.

send

public void send(java.lang.String message)
          throws java.io.IOException,
                 java.lang.NullPointerException
Sends a String message to the server.
Parameters:
message - The byte array to send.
Throws:
java.io.IOException - If an I/O error occurs.
java.lang.NullPointerException - if data is null.

sendCrypted

public void sendCrypted(java.lang.String message)
                 throws java.io.IOException,
                        java.lang.NullPointerException
Sends an encrypted String message to the server.
Parameters:
message - The message to send.
Throws:
java.io.IOException - If an I/O error occurs.
java.lang.NullPointerException - if message is null.

sendCrypted

public void sendCrypted(byte[] data)
                 throws java.io.IOException,
                        java.lang.NullPointerException
Sends an encrypted byte array to the server.
Parameters:
message - The byte array to send.
Throws:
java.io.IOException - If an I/O error occurs.
java.lang.NullPointerException - if data is null.

get

public byte[] get()
           throws java.io.IOException
Gets a message from the server..
Returns:
The incoming message from the server.
Throws:
java.io.IOException - If an I/O error occurs.

disconnect

public void disconnect()
                throws java.io.IOException
Cuts the connection with the server.
Throws:
java.io.IOException - If an I/O error occurs.