com.monica.javacom.interfaces
Interface MJCTransport

All Superinterfaces:
MJCConfigureable, MJCReadable, MJCWriteable, java.lang.Runnable
All Known Implementing Classes:
MJCTCPTransport

public interface MJCTransport
extends MJCWriteable, MJCReadable, MJCConfigureable, java.lang.Runnable

Bottom level layer in the MJC layer hierarchy responsible for the basic connection between the client and server side. This layer has to ensure the transfer of the streams between the two sides.


Method Summary
 java.lang.String checkSum(java.lang.String s)
          Generates a checksum for a String.
 void closeConnections()
          Closes all connections of the MJCTransport.
 MJCServerManager getServerManager()
          Returns the MJCServerManager which will be notified if a client connects.
 java.lang.String getTransportName()
          Returns the MJC name of the MJCTransport.
 java.lang.String getTransportVersion()
          Returns the MJC version of the MJCTransport.
 void initAsClient(java.lang.String host, int port)
          Initializes the MJCTransport as the client side.
 void initAsServer(int port)
          Initializes the MJCTransport as the server side.
 void setServerManager(MJCServerManager serverManager)
          Sets the MJCServerManager which will be notified if a client connects.
 
Methods inherited from interface com.monica.javacom.interfaces.MJCWriteable
flush, getLastWriteableError, getWriteableName, getWriteableVersion, isWriteableConnected, write, write, write
 
Methods inherited from interface com.monica.javacom.interfaces.MJCReadable
getAvailable, getInput, getReadableName, getReadableVersion, getReader, isReadableConnected, setReader
 
Methods inherited from interface com.monica.javacom.interfaces.MJCConfigureable
getConfiguration, setConfiguration
 
Methods inherited from interface java.lang.Runnable
run
 

Method Detail

getTransportName

public java.lang.String getTransportName()
Returns the MJC name of the MJCTransport.
Returns:
String: the MJC name of the MJCTransport

getTransportVersion

public java.lang.String getTransportVersion()
Returns the MJC version of the MJCTransport.
Returns:
String: the MJC version of the MJCTransport

initAsServer

public void initAsServer(int port)
                  throws java.io.IOException
Initializes the MJCTransport as the server side. Clients can connect to the specified port.
Parameters:
int - port: the port where the clients can connect
Throws:
IOException: - if the server could not be started

initAsClient

public void initAsClient(java.lang.String host,
                         int port)
                  throws java.io.IOException
Initializes the MJCTransport as the client side. This client will try to connect to the specified host and port.
Parameters:
String - host: the destination host
int - port: the destination port
Throws:
IOException: - if the client cannot connect to the specified host and port

closeConnections

public void closeConnections()
Closes all connections of the MJCTransport.

checkSum

public java.lang.String checkSum(java.lang.String s)
Generates a checksum for a String.
Parameters:
String: - the String for which a checksum is needed
Returns:
String: the checksum

setServerManager

public void setServerManager(MJCServerManager serverManager)
Sets the MJCServerManager which will be notified if a client connects.
Parameters:
MJCServerManager - serverManager: the MJCServerManager that has to be notified if a client connects

getServerManager

public MJCServerManager getServerManager()
Returns the MJCServerManager which will be notified if a client connects.
Returns:
MJCServerManager: the MJCServerManager which will be notified if a client connects