cz.cuni.pogamut.communication
Class RemoteParserForMediator

java.lang.Object
  extended by cz.cuni.pogamut.communication.RemoteParserForMediator
All Implemented Interfaces:
MediatorGBInterface, MediatorParserInterface

public class RemoteParserForMediator
extends java.lang.Object
implements MediatorParserInterface, MediatorGBInterface

This class should connect to remote parser and get messages from it.


Field Summary
private  ParserConnection connection
           
 
Constructor Summary
RemoteParserForMediator(ParserConnection connection)
          Initialize the class.
 
Method Summary
 void closeGB()
          Close the connection to the GameBots, if any exists.
 void closeParser()
          Close the connection to the parser (if any exists).
 MessageObject receiveParsedMessage()
          Get one message from game bots (already parsed via parser) which is needed to deliver to the Client.
 void sendMessageToGB(java.lang.String msg)
          Sends message to the GameBots from the client.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

connection

private ParserConnection connection
Constructor Detail

RemoteParserForMediator

public RemoteParserForMediator(ParserConnection connection)
Initialize the class.

Parameters:
connection - already connected (opened) connection to RemoteParser.
Method Detail

receiveParsedMessage

public MessageObject receiveParsedMessage()
                                   throws CantReadException
Description copied from interface: MediatorParserInterface
Get one message from game bots (already parsed via parser) which is needed to deliver to the Client. May block.

Specified by:
receiveParsedMessage in interface MediatorParserInterface
Throws:
CantReadException - Unable to read from GameBots.

sendMessageToGB

public void sendMessageToGB(java.lang.String msg)
                     throws CantWriteException
Description copied from interface: MediatorGBInterface
Sends message to the GameBots from the client.

Specified by:
sendMessageToGB in interface MediatorGBInterface
Throws:
CantWriteException - Can't send data to GameBot.

closeGB

public void closeGB()
             throws CantCloseConnectionException
Description copied from interface: MediatorGBInterface
Close the connection to the GameBots, if any exists.

Specified by:
closeGB in interface MediatorGBInterface
Throws:
CantCloseConnectionException

closeParser

public void closeParser()
                 throws CantCloseConnectionException
Description copied from interface: MediatorParserInterface
Close the connection to the parser (if any exists).

Specified by:
closeParser in interface MediatorParserInterface
Throws:
CantCloseConnectionException