|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectat.jku.fim.datalinksimulation.genericdevices.HardwareComponent
at.jku.fim.datalinksimulation.genericdevices.InterlinkingDevice
public abstract class InterlinkingDevice
Title: OSI Simulation Framework
Copyright: (c) 2004-05
Company: FIM@JKU, www.fim.uni-linz.ac.at
Field Summary | |
---|---|
private Wire[] |
connectedWires
reference to all connected wires, indexed by port number |
private java.lang.String |
identifier
internal identifier |
protected Logger |
logger
each interlinking device has its own log |
protected NetworkStack |
networkStack
each interlinking device has it's own network stack |
protected int |
numberOfPorts
the number of available ports |
Fields inherited from class at.jku.fim.datalinksimulation.genericdevices.HardwareComponent |
---|
networkComponentId |
Constructor Summary | |
---|---|
InterlinkingDevice(java.lang.String identifier,
int numberOfPorts)
Constructor |
Method Summary | |
---|---|
void |
bePlugged(Wire wire,
int portNr)
This method should only be called by Wires, which inform this WireConnector that they are connected. |
void |
beUnplugged(Wire wire,
int portNr)
This method should only be called by Wires, which inform this WireConnector that they are disconnected |
java.util.List |
getConnectedWires()
|
protected abstract IncomingNetworkStackConfiguration |
getIncomingNetworkStackConfiguration()
This method must be overriden in subclasses. |
int |
getNextFreePort()
|
int |
getNumberOfFreePorts()
|
int |
getNumberOfTotalPorts()
|
protected abstract OutgoingNetworkStackConfiguration |
getOutgoingNetworkStackConfiguration()
This method must be overriden in subclasses. |
int |
getPortOfWire(Wire wire)
|
Wire |
getWireInPort(int portNr)
|
void |
informAboutDataOnWire(Wire sender,
RawData data)
This method is called whenever a data package is received by a subscribed wire. |
boolean |
isPortFree(int portNr)
|
boolean |
isWireConnected(Wire wireToTest)
Checks, if a specified wire is connected or not |
java.lang.String |
toString()
|
Methods inherited from class at.jku.fim.datalinksimulation.genericdevices.HardwareComponent |
---|
getNetworkComponentId |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected final Logger logger
protected final NetworkStack networkStack
protected final int numberOfPorts
private Wire[] connectedWires
private java.lang.String identifier
Constructor Detail |
---|
public InterlinkingDevice(java.lang.String identifier, int numberOfPorts)
identifier
- Identifier for lognumberOfPorts
- Number of ports of deviceMethod Detail |
---|
public final int getNumberOfTotalPorts()
public final int getNumberOfFreePorts()
public final int getNextFreePort()
public final java.util.List getConnectedWires()
public final boolean isPortFree(int portNr)
portNr
- The identifying port number
public final Wire getWireInPort(int portNr)
portNr
- The identifying port number
public final int getPortOfWire(Wire wire)
wire
- The cable
public final boolean isWireConnected(Wire wireToTest)
wireToTest
- Wire to test
protected abstract IncomingNetworkStackConfiguration getIncomingNetworkStackConfiguration()
protected abstract OutgoingNetworkStackConfiguration getOutgoingNetworkStackConfiguration()
public final void bePlugged(Wire wire, int portNr) throws WiringException
WireConnector
bePlugged
in interface WireConnector
wire
- Connected wire
WiringException
- May be thrown to veto against this wiringpublic final void beUnplugged(Wire wire, int portNr) throws WiringException
WireConnector
beUnplugged
in interface WireConnector
wire
- Disconnected wire
WiringException
- May be thrown on any error or vetopublic final void informAboutDataOnWire(Wire sender, RawData data)
WireConnector
informAboutDataOnWire
in interface WireConnector
sender
- If the sender is a Wire, sender contains the reference to the wire which received the packet.data
- The received data on the wirepublic java.lang.String toString()
toString
in class HardwareComponent
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |