net.sf.freecol.server.ai
Class AIInGameInputHandler

java.lang.Object
  extended by net.sf.freecol.server.ai.AIInGameInputHandler
All Implemented Interfaces:
MessageHandler, StreamedMessageHandler

public final class AIInGameInputHandler
extends java.lang.Object
implements MessageHandler, StreamedMessageHandler

Handles the network messages that arrives while in the game.


Field Summary
static java.lang.String COPYRIGHT
           
static java.lang.String LICENSE
           
static java.lang.String REVISION
           
 
Constructor Summary
AIInGameInputHandler(FreeColServer freeColServer, ServerPlayer me, AIMain aiMain)
          The constructor to use.
 
Method Summary
 boolean accepts(java.lang.String tagName)
          Checks if the message handler support the given message.
 AIPlayer getAIPlayer()
          Gets the AIPlayer using this AIInGameInputHandler.
 org.w3c.dom.Element handle(Connection connection, org.w3c.dom.Element element)
          Deals with incoming messages that have just been received.
 void handle(Connection connection, javax.xml.stream.XMLStreamReader in, javax.xml.stream.XMLStreamWriter out)
          Handles the main element of an XML message.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COPYRIGHT

public static final java.lang.String COPYRIGHT
See Also:
Constant Field Values

LICENSE

public static final java.lang.String LICENSE
See Also:
Constant Field Values

REVISION

public static final java.lang.String REVISION
See Also:
Constant Field Values
Constructor Detail

AIInGameInputHandler

public AIInGameInputHandler(FreeColServer freeColServer,
                            ServerPlayer me,
                            AIMain aiMain)
The constructor to use.

Parameters:
freeColServer - The main server.
me - The AI player that is being managed by this AIInGameInputHandler.
aiMain - The main AI-object.
Method Detail

handle

public org.w3c.dom.Element handle(Connection connection,
                                  org.w3c.dom.Element element)
Deals with incoming messages that have just been received.

Specified by:
handle in interface MessageHandler
Parameters:
connection - The Connection the message was received on.
element - The root element of the message.
Returns:
The reply.

handle

public void handle(Connection connection,
                   javax.xml.stream.XMLStreamReader in,
                   javax.xml.stream.XMLStreamWriter out)
Handles the main element of an XML message.

Specified by:
handle in interface StreamedMessageHandler
Parameters:
connection - The connection the message came from.
in - The stream containing the message.
out - The output stream for the reply.

accepts

public boolean accepts(java.lang.String tagName)
Checks if the message handler support the given message.

Specified by:
accepts in interface StreamedMessageHandler
Parameters:
tagName - The tag name of the message to check.
Returns:
The result (currently always false).

getAIPlayer

public AIPlayer getAIPlayer()
Gets the AIPlayer using this AIInGameInputHandler.

Returns:
The AIPlayer.