org.openflow.gui
Class OpenFlowGUI

java.lang.Object
  extended by org.openflow.gui.OpenFlowGUI

public final class OpenFlowGUI
extends java.lang.Object

Provides static methods for running the GUI.

Author:
David Underhill

Method Summary
static Pair<java.lang.String,java.lang.Short> getServer(java.lang.String[] args)
          Gets the IP[:PORT] to connect to.
static java.util.ArrayList<Pair<java.lang.String,java.lang.Short>> getServers(java.lang.String[] args)
          Gets the IP[:PORT](s) to connect to.
static void main(java.lang.String[] args)
          Run a simple version of the GUI by starting a single connection which will populate a single topology drawn by a PZLayoutManager.
static ConnectionHandler makeDefaultConnection(PZManager manager, java.lang.String server, java.lang.Short port, boolean subscribeSwitches, boolean subscribeLinks)
          Creates a connection which will populate a new topology.
static Pair<java.lang.String,java.lang.Short> parseServerIdentifier(java.lang.String s)
          Returns the parse of a IP[:PORT].
static Pair<java.lang.String,java.lang.Short> promptForServer()
          Ask the user for the backend's IP[:PORT] in dialog box.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

main

public static void main(java.lang.String[] args)
Run a simple version of the GUI by starting a single connection which will populate a single topology drawn by a PZLayoutManager.


makeDefaultConnection

public static ConnectionHandler makeDefaultConnection(PZManager manager,
                                                      java.lang.String server,
                                                      java.lang.Short port,
                                                      boolean subscribeSwitches,
                                                      boolean subscribeLinks)
Creates a connection which will populate a new topology.

Parameters:
manager - the manager of the GUI elements
server - the IP or hostname where the back-end is located
port - the port the back-end is listening on
subscribeSwitches - whether to subscribe to switch changes
subscribeLinks - whether to subscribe to link changes

getServer

public static Pair<java.lang.String,java.lang.Short> getServer(java.lang.String[] args)
Gets the IP[:PORT] to connect to.

Parameters:
args - the command-line arguments to extract a server from; if one is not provided then the user will be prompted for one
Returns:
the server to connect to

getServers

public static java.util.ArrayList<Pair<java.lang.String,java.lang.Short>> getServers(java.lang.String[] args)
Gets the IP[:PORT](s) to connect to. If no servers are specified, the user is prompted to specify one. If the user does not specify anything when prompted, then the program terminates.

Parameters:
args - the command-line arguments to extract server(s) from; if none are provided then the user will be prompted for one
Returns:
the server to connect to

parseServerIdentifier

public static Pair<java.lang.String,java.lang.Short> parseServerIdentifier(java.lang.String s)
Returns the parse of a IP[:PORT]. If PORT is omitted, the Options.DEFAULT_PORT is returned for the port value.

Returns:
IP-port pair

promptForServer

public static Pair<java.lang.String,java.lang.Short> promptForServer()
Ask the user for the backend's IP[:PORT] in dialog box.