uk.org.arlott.simon.hw.f24.lbsta
Class NetworkEvent

java.lang.Object
  extended by uk.org.arlott.simon.hw.f24.lbsta.NetworkEvent

public class NetworkEvent
extends java.lang.Object

Models an event on the network.


Field Summary
static int BRIDGE_PORT_STATE_CHANGED
          Bridge port state change event.
 int bridgeID
          Bridge ID.
 int bridgePort
          Bridge Port.
 int dstHostAddress
          Destination Host ID.
static int HOST_GETS_PACKET
          Host receives packet event.
 int portState
          Bridge Port state.
static int ROOT_ID_AT_BRIDGE_CHANGED
          Root ID at a bridge changed event.
 int rootID
          Root ID.
 int srcHostAddress
          Source Host ID.
 int type
          Type of this event.
 
Constructor Summary
private NetworkEvent(int type)
          Creates a new NetworkEvent of the specified type.
 
Method Summary
static NetworkEvent createBridgePortStateChanged(int bridgeID, int bridgePort, int portState)
          Creates a new Bridge Port State Changed event.
static NetworkEvent createHostGetsPacket(int srcHostAddress, int dstHostAddress)
          Creates a new Host Received Packet event.
static NetworkEvent createRootIDatBridge(int bridgeID, int rootID)
          Creates a new Root ID at Bridge event.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BRIDGE_PORT_STATE_CHANGED

public static final int BRIDGE_PORT_STATE_CHANGED
Bridge port state change event.

See Also:
Constant Field Values

HOST_GETS_PACKET

public static final int HOST_GETS_PACKET
Host receives packet event.

See Also:
Constant Field Values

ROOT_ID_AT_BRIDGE_CHANGED

public static final int ROOT_ID_AT_BRIDGE_CHANGED
Root ID at a bridge changed event.

See Also:
Constant Field Values

type

public int type
Type of this event.


bridgeID

public int bridgeID
Bridge ID.


bridgePort

public int bridgePort
Bridge Port.


portState

public int portState
Bridge Port state.


rootID

public int rootID
Root ID.


srcHostAddress

public int srcHostAddress
Source Host ID.


dstHostAddress

public int dstHostAddress
Destination Host ID.

Constructor Detail

NetworkEvent

private NetworkEvent(int type)
Creates a new NetworkEvent of the specified type.

Parameters:
type - The type of the event to create.
Method Detail

createBridgePortStateChanged

public static NetworkEvent createBridgePortStateChanged(int bridgeID,
                                                        int bridgePort,
                                                        int portState)
Creates a new Bridge Port State Changed event.

Parameters:
bridgeID - The bridge ID the event occured on.
bridgePort - The bridge port ID the event occured on.
portState - The new port state.
Returns:
A new NetworkEvent.

createHostGetsPacket

public static NetworkEvent createHostGetsPacket(int srcHostAddress,
                                                int dstHostAddress)
Creates a new Host Received Packet event.

Parameters:
srcHostAddress - The host address the packet was received from.
dstHostAddress - The host address the event occured on.
Returns:
A new NetworkEvent.

createRootIDatBridge

public static NetworkEvent createRootIDatBridge(int bridgeID,
                                                int rootID)
Creates a new Root ID at Bridge event.

Parameters:
bridgeID - The bridge ID the event occured on.
rootID - The new root ID.
Returns:
A new NetworkEvent.