ctf.evaluation.simulator
Class ConnectionManager

java.lang.Object
  extended by ctf.evaluation.simulator.ConnectionManager

public class ConnectionManager
extends java.lang.Object

Manages connections for tests. Since connections may be persistent, we need this singleton to ensure that they're open, in the correct STEAL state, etc.


Nested Class Summary
static class ConnectionManager.STEALState
          States the STEAL protocol can be in
 
Constructor Summary
protected ConnectionManager()
          Singleton constructor.
 
Method Summary
 Connection blue()
          Blue team
protected  void closeConnections()
          Close open connections
 void enterState(ConnectionManager.STEALState state)
          Get the controllers into a particular STEAL state.
static ConnectionManager instance()
          Singleton access
protected  void openConnections()
          Open controller connections
 Connection red()
          Red team
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConnectionManager

protected ConnectionManager()
Singleton constructor.

Method Detail

instance

public static ConnectionManager instance()
Singleton access


enterState

public void enterState(ConnectionManager.STEALState state)
                throws java.io.IOException,
                       NetworkException,
                       ProtocolError
Get the controllers into a particular STEAL state.

Parameters:
state - the state to get into
Throws:
java.io.IOException
NetworkException
ProtocolError

red

public Connection red()
               throws NetworkException
Red team

Throws:
NetworkException

blue

public Connection blue()
                throws NetworkException
Blue team

Throws:
NetworkException

openConnections

protected void openConnections()
                        throws NetworkException
Open controller connections

Throws:
NetworkException

closeConnections

protected void closeConnections()
                         throws java.io.IOException
Close open connections

Throws:
java.io.IOException