|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openflow.gui.ConnectionHandler
public class ConnectionHandler
Processes messages from a connection and updates the associated topology accordingly. It also maintains the network topology data structure associated with it. This class should be extended to process new messages in extended OFG versions which add new message types.
| Constructor Summary | |
|---|---|
ConnectionHandler(Topology topo,
java.lang.String ip,
int port,
boolean subscribeSwitches,
boolean subscribeLinks)
Create a connection bound to the server at the specified address and port which will be used to populate the specified topology. |
|
| Method Summary | |
|---|---|
void |
connectionStateChange()
Called when the backend has been disconnected or reconnected |
OFGMessage |
decode(int len,
java.io.DataInput in)
Constructs the object representing the received message. |
BackendConnection<OFGMessage> |
getConnection()
|
Topology |
getTopology()
|
protected void |
handleNewSwitch(OpenFlowSwitch s)
Handles a new switch by requesting its links and description if Options.AUTO_REQUEST_LINK_INFO_FOR_NEW_SWITCH is true. |
boolean |
isSubscribeToLinkChanges()
Returns whether the connection is subscribed to link changes |
boolean |
isSubscribeToSwitchChanges()
Returns whether the connection is subscribed to switch changes |
protected void |
logLinkMissing(java.lang.String msg,
java.lang.String why,
long dstDPID,
short dstPort,
long srcDPID,
short srcPort)
Prints an error message about a missing link. |
protected void |
logNodeMissing(java.lang.String msg,
java.lang.String why,
long id)
Prints an error message about a missing node. |
void |
process(OFGMessage msg)
Handles messages received from the backend |
protected void |
processAuthRequest(AuthRequest req)
Query the user for login credentials and send them to the backend. |
protected void |
processAuthStatus(AuthStatus status)
Let the user know about the authentication status contained in msg. |
protected void |
processDrawableNodeAdd(Node n)
add new node to the topology |
protected void |
processEchoReply(int xid)
Handles the echo reply by simply printing a message to stdout. |
protected void |
processEchoRequest(int xid)
Handles the echo request by replying. |
protected Node |
processNodeAdd(Node n)
Add a new node to the topology. |
void |
setSubscribeToLinkChanges(boolean b)
Sets whether the connection is subscribed to link changes and sends the appropriate subscription request if this is different. |
void |
setSubscribeToSwitchChanges(boolean b)
Sets whether the connection is subscribed to switch changes and sends the appropriate subscription request if this is different. |
void |
shutdown()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ConnectionHandler(Topology topo,
java.lang.String ip,
int port,
boolean subscribeSwitches,
boolean subscribeLinks)
topo - the topology this connection will interact withip - the IP where the server livesport - the port the server listens onsubscribeSwitches - whether to subscribe to switch changessubscribeLinks - whether to subscribe to link changes| Method Detail |
|---|
public BackendConnection<OFGMessage> getConnection()
public Topology getTopology()
public void connectionStateChange()
connectionStateChange in interface MessageProcessor<OFGMessage>
public OFGMessage decode(int len,
java.io.DataInput in)
throws java.io.IOException
decode in interface MessageProcessor<OFGMessage>java.io.IOExceptionpublic void process(OFGMessage msg)
process in interface MessageProcessor<OFGMessage>protected void processAuthRequest(AuthRequest req)
protected void processAuthStatus(AuthStatus status)
protected void processEchoRequest(int xid)
protected void processEchoReply(int xid)
protected void handleNewSwitch(OpenFlowSwitch s)
s - the new switchprotected void processDrawableNodeAdd(Node n)
protected Node processNodeAdd(Node n)
protected void logNodeMissing(java.lang.String msg,
java.lang.String why,
long id)
protected void logLinkMissing(java.lang.String msg,
java.lang.String why,
long dstDPID,
short dstPort,
long srcDPID,
short srcPort)
public void shutdown()
public boolean isSubscribeToSwitchChanges()
public void setSubscribeToSwitchChanges(boolean b)
throws java.io.IOException
java.io.IOExceptionpublic boolean isSubscribeToLinkChanges()
public void setSubscribeToLinkChanges(boolean b)
throws java.io.IOException
java.io.IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||