|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.clackrouter.component.base.ClackComponent net.clackrouter.component.base.Interface
public abstract class Interface
Abstract parent class of both InterfaceIn and InterfaceOut, which provides the basic functionality of a Clack Interface component. Interfaces are unique in that they cannot be created or destroyed, but rather they are defined by the topology, as are their attributes like hardware address, IP address and netmask.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class net.clackrouter.component.base.ClackComponent |
---|
ClackComponent.Waiter |
Field Summary | |
---|---|
protected java.lang.String |
device_name
|
EthernetAddress |
ETH_BCAST_ADDR
|
static java.lang.String |
IP_ADDRESS
|
static java.lang.String |
IP_NETMASK
|
protected EthernetAddress |
m_eth_addr
|
protected java.net.InetAddress |
m_ip_addr
|
protected java.net.InetAddress |
m_ip_subnet
|
Fields inherited from class net.clackrouter.component.base.ClackComponent |
---|
componentCell, m_has_error, m_log, m_name, m_num_ports, m_packetcount_in, m_packetcount_out, m_ports, mListeners, mRouter, pendingError, SIGNAL_ERROR_LEN_MSEC, UNIQUE_COUNT, view |
Constructor Summary | |
---|---|
Interface(java.lang.String name,
Router router,
TopologyModel.Interface entry)
|
|
Interface(java.lang.String name,
Router router,
VNSHWInfo.InterfaceEntry entry)
Creates a new interface component |
Method Summary | |
---|---|
java.awt.Color |
getColor()
The color this component should be rendered in, assuming a standard component rendering by the ComponentView.ComponentRenderer class. |
java.lang.String |
getDeviceName()
Gets simple device name of the component (e.g. |
java.net.InetAddress |
getIPAddress()
Get IP address associated with this interface |
java.net.InetAddress |
getIPSubnet()
Get subnet mask for this interface |
EthernetAddress |
getMACAddress()
Get hardware address associated with this interface |
java.lang.String |
getMACAddressString()
Get hardware MAC address as a string |
java.util.Properties |
getSerializableProperties(boolean isTransient)
Used to get all values the component would like to serialize to file. |
java.lang.String |
getTypeName()
For an interface, the type name to be displayed is the actual name of the component (e.g. |
void |
initializeProperties(java.util.Properties props)
Method used to initialize a component based on serialized properties values saved to a file. |
void |
setIPAddress(java.net.InetAddress a)
|
void |
setIPSubnet(java.net.InetAddress s)
|
Methods inherited from class net.clackrouter.component.base.ClackComponent |
---|
acceptPacket, createCopy, createInputPullPort, createInputPushPort, createOutputPullPort, createOutputPushPort, error, fireListeners, getComponentCell, getHierarchicalView, getLog, getName, getNumPorts, getPacketCountIn, getPacketCountOut, getPendingError, getPort, getPropertiesView, getRouter, getTime, getUniqueCount, getView, handlePullRequest, hasError, isHierarchical, isModifying, log, notifyAlarm, poll, registerListener, sendOutPort, setAlarm, setComponentCell, setName, setPendingError, setupPorts, setView, showErrorDialog, signalError, try_repaint, unregisterListener |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected EthernetAddress m_eth_addr
protected java.net.InetAddress m_ip_addr
protected java.net.InetAddress m_ip_subnet
public EthernetAddress ETH_BCAST_ADDR
protected java.lang.String device_name
public static java.lang.String IP_ADDRESS
public static java.lang.String IP_NETMASK
Constructor Detail |
---|
public Interface(java.lang.String name, Router router, VNSHWInfo.InterfaceEntry entry)
name
- unique name for this component in the routerrouter
- parent router for this componententry
- Clack specific data-structure specifying Interface attributespublic Interface(java.lang.String name, Router router, TopologyModel.Interface entry)
Method Detail |
---|
public EthernetAddress getMACAddress()
public java.net.InetAddress getIPAddress()
public void setIPAddress(java.net.InetAddress a)
public java.net.InetAddress getIPSubnet()
public void setIPSubnet(java.net.InetAddress s)
public java.lang.String getDeviceName()
public java.lang.String getMACAddressString()
public java.util.Properties getSerializableProperties(boolean isTransient)
ClackComponent
Used to get all values the component would like to serialize to file.
These values are stored as String -> String pairs in a Properties
object. These
properties will be passed to ClackComponent.initializeProperties(Properties)
when the Component is recreated.
Serialization can be transient or not, which determines whether all or just some of the internal component state is saved. Transient serialization means that some properties will be saved which may make this serialized file invalid for use on different network or router set-ups. For example, saving info specific to the IP addresses of a certain topology would only happen if transient serialization was used. However, it can be desireable to save these properties when setting up exact demonstrations.
By default we have no properties to serialize, so we return an empty object
getSerializableProperties
in class ClackComponent
isTransient
- flag indicating if serialization is transient
public void initializeProperties(java.util.Properties props)
ClackComponent
Method used to initialize a component based on serialized properties values saved to a file.
By default, no action is performed
initializeProperties
in class ClackComponent
props
- all property values serialized for this componentpublic java.lang.String getTypeName()
getTypeName
in class ClackComponent
public java.awt.Color getColor()
ClackComponent
The color this component should be rendered in, assuming a standard component rendering by the
ComponentView.ComponentRenderer
class.
Other renderers may ignore this value.
getColor
in class ClackComponent
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |