T - generic type (Port) that is casted in the subclassespublic abstract class Switch<T extends Port> extends Object implements OVXEventHandler, OVXSendMsg
| Modifier and Type | Field and Description |
|---|---|
protected org.jboss.netty.channel.Channel |
channel |
static String |
DB_KEY |
protected OVXDescriptionStatistics |
desc |
protected OFFeaturesReply |
featuresReply
The features reply message.
|
protected boolean |
isConnected |
protected Mappable |
map |
protected HashMap<Short,T> |
portMap
The port map.
|
protected Long |
switchId
The switch id (DPID).
|
protected String |
switchName |
| Modifier | Constructor and Description |
|---|---|
protected |
Switch(Long switchId)
Instantiates a new switch (should be never used).
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
addPort(T port)
Adds the port.
|
abstract boolean |
boot()
Starts up the switch.
|
OFFeaturesReply |
getFeaturesReply()
Gets the switch info.
|
Mappable |
getMap() |
String |
getName() |
T |
getPort(Short portNumber)
Gets the port.
|
Map<Short,T> |
getPorts()
Returns an unmodifiable copy of the port map.
|
Long |
getSwitchId()
Gets the switch id.
|
String |
getSwitchName()
Gets the switch name.
|
abstract void |
handleIO(OFMessage msg,
org.jboss.netty.channel.Channel channel) |
abstract void |
handleRoleIO(OFVendor msg,
org.jboss.netty.channel.Channel channel) |
abstract void |
removeChannel(org.jboss.netty.channel.Channel channel) |
boolean |
removePort(Short portNumber)
Removes the port.
|
void |
setChannel(org.jboss.netty.channel.Channel channel)
Sets the channel.
|
void |
setConnected(boolean isConnected)
Sets the connected.
|
void |
setDescriptionStats(OVXDescriptionStatistics description)
Sets the description stats.
|
void |
setFeaturesReply(OFFeaturesReply m)
Sets the features reply.
|
abstract void |
tearDown()
Tear down.
|
String |
toString() |
abstract void |
unregister()
Removes the switch from the network representation.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitsendMsgpublic static final String DB_KEY
protected boolean isConnected
protected org.jboss.netty.channel.Channel channel
protected OVXDescriptionStatistics desc
protected String switchName
protected Mappable map
protected HashMap<Short,T extends Port> portMap
protected OFFeaturesReply featuresReply
protected Long switchId
protected Switch(Long switchId)
switchId - the switchId (long) that represent the DPIDmap - reference to the OVXMappublic String getSwitchName()
public Mappable getMap()
public OFFeaturesReply getFeaturesReply()
public void setFeaturesReply(OFFeaturesReply m)
m - the new features replypublic Long getSwitchId()
public T getPort(Short portNumber)
portNumber - the port numberpublic boolean addPort(T port)
port - the port instancepublic boolean removePort(Short portNumber)
portNumber - the port numberpublic abstract void handleIO(OFMessage msg, org.jboss.netty.channel.Channel channel)
handleIO in interface OVXEventHandlerpublic abstract void handleRoleIO(OFVendor msg, org.jboss.netty.channel.Channel channel)
public void setConnected(boolean isConnected)
isConnected - the new connectedpublic void setChannel(org.jboss.netty.channel.Channel channel)
channel - the new channelpublic abstract boolean boot()
public abstract void unregister()
public abstract void tearDown()
public void setDescriptionStats(OVXDescriptionStatistics description)
description - the new description statspublic String getName()
getName in interface OVXSendMsgpublic abstract void removeChannel(org.jboss.netty.channel.Channel channel)
Copyright © 2015. All rights reserved.