com.monica.javacom.interfaces
Interface MJCReader

All Known Subinterfaces:
MJCCiphering, MJCProtocol, MJCTerminal
All Known Implementing Classes:
MJCReaderIsAIS, MJCReaderHasAOS, MJCLoopBackProtocol, MJCManager

public interface MJCReader

Implements the destination part of the read functionality in the MJC layer hierarchy. MJCReader is always the destination of data from an MJCReadable. Reading in the MJC layer hierarchy is asynchronous. If there is data available from the MJCReadable, the readEvent of the MJCReader is called. Which then can read through the getInput method of the MJCReadable. Data during the time between the readEvent and getInput will be buffered in the MJCReadable.


Method Summary
 void connectionClosedEvent(MJCReadable readable)
          Indicates that the source connection of the specified MJCReadable has been closed.
 void errorEvent(java.lang.String errorDescription, MJCReadable readable)
          Indicates that there was an error in the source connection of the specified MJCReadable.
 MJCReadable getReadable()
          Returns the MJCReadable from which data will be read.
 java.lang.String getReaderName()
          Returns the MJC name of the MJCReader.
 java.lang.String getReaderVersion()
          Returns the MJC version of the MJCReader.
 void readEvent(MJCReadable readable)
          Indicates that there is data available from the specified MJCReadable.
 void setReadable(MJCReadable readable)
          Sets the MJCReadable from which data has to be read.
 

Method Detail

getReaderName

public java.lang.String getReaderName()
Returns the MJC name of the MJCReader.
Returns:
String: the MJC name of the MJCReader

getReaderVersion

public java.lang.String getReaderVersion()
Returns the MJC version of the MJCReader.
Returns:
String: the MJC version of the MJCReader

readEvent

public void readEvent(MJCReadable readable)
Indicates that there is data available from the specified MJCReadable.
Parameters:
MJCReadable - readable: there is data available from the readable

connectionClosedEvent

public void connectionClosedEvent(MJCReadable readable)
Indicates that the source connection of the specified MJCReadable has been closed.
Parameters:
MJCReadable - readable: the MJCReadable whose source connection has been closed

errorEvent

public void errorEvent(java.lang.String errorDescription,
                       MJCReadable readable)
Indicates that there was an error in the source connection of the specified MJCReadable.
Parameters:
String - errorDescription: the error message
MJCReadable - readable: the MJCReadable where the error occured

setReadable

public void setReadable(MJCReadable readable)
Sets the MJCReadable from which data has to be read.
Parameters:
MJCReadable - readable: the MJCReadable from which data has to be read

getReadable

public MJCReadable getReadable()
Returns the MJCReadable from which data will be read.
Returns:
MJCReadable: the MJCReadable from which data will be read