SSF.Net
Class ExtRouter

java.lang.Object
  |
  +--com.renesys.raceway.SSF.Entity
        |
        +--SSF.OS.ProtocolGraph
              |
              +--SSF.Net.Host
                    |
                    +--SSF.Net.Router
                          |
                          +--SSF.Net.ExtRouter
All Implemented Interfaces:
com.renesys.raceway.DML.Configurable, FailureInformation
Direct Known Subclasses:
LSR, OXCEdgeRouter

public abstract class ExtRouter
extends Router
implements FailureInformation

This class is a bridge to access package attributes by subclasses. This class was developed at the National Institute of Standards and Technology by employees of the Federal Government in the course of their official duties. Pursuant to title 17 Section 105 of the United States Code this software is not subject to copyright protection and is in the public domain. NIST assumes no responsibility whatsoever for its use by other parties, and makes no guarantees, expressed or implied, about its quality, reliability, or any other characteristic. We would appreciate acknowledgement if the software is used. NIST ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION AND DISCLAIM ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.

Author:
borchert
, rouil

Field Summary
private  boolean failure
          Indicates if the ExtRouter is failed.
protected  boolean inConfiguration
          Indicator if the class is in the configuration mode (true).
private  boolean log
          If a logfile has to be produced.
protected  java.util.Vector protNames
          This Vector contains the names of the attached protocols.
 
Fields inherited from class SSF.Net.Host
hostConfig, ID, interfaceAddresses, interfaceCount, interfaceNumbers, net, nhi, nhi_context
 
Fields inherited from class SSF.OS.ProtocolGraph
description
 
Fields inherited from class com.renesys.raceway.SSF.Entity
 
Constructor Summary
ExtRouter(Net N, java.lang.String use_nhi, int use_id)
          Default constructor
 
Method Summary
 void config(com.renesys.raceway.DML.Configuration cfg)
          Configures the ExtRouter by adding Onic.
 int getID()
          Return the ID of the host
 java.util.Hashtable getInterfaceAddresses()
          Return the table of the interfaces
 int getInterfaceCount()
          Number of interfaces constructed for this Host (may not all be "up")
static int getInterfaceCount(Host ofHost)
          Number of interfaces constructed for this Host (may not all be "up")
 java.util.Vector getNameOfProtocols()
          Determine the names of attached Protocols.
 Net getNet()
          Return the net that contains this host
 boolean isFailure()
          Informs if the OXC is failed.
 boolean isLog()
          Returns if the log has to be created or not.
protected  void notifyONIC()
          Notifies the ONIC about a change in the failure setting.
 void removeProtocolSession(java.lang.String name)
          Remove a protocolSession of this node.
protected  void sendMessage(short messageType)
          Checks if the Eventhandler has receivers and this object is not in the configuration mode, this message will send the specified event.
 ProtocolSession SessionForName(java.lang.String protocol_name)
          If a protocol has been registered under the given name, return an instance (session) of it.
 void setFailure(boolean newFailure)
          Set the status of the ExtRouter.
 void setID(int newID)
          Set the ID of the host
static void setInterfaceCount(int newInterfaceCount, Host ofHost)
          Set the number of interfaces constructed for this Host (may not all be "up")
 void setLog(boolean newValue)
          Set the log value.
private  void storeProtocolSessionName(com.renesys.raceway.DML.Configuration cfg)
          Determines all used protocols out of the configuration file.
 
Methods inherited from class SSF.Net.Host
defined_in_network, global_nhi_to_ip, init, local_nhi_to_ip, toString
 
Methods inherited from class SSF.OS.ProtocolGraph
cpu
 
Methods inherited from class com.renesys.raceway.SSF.Entity
alignment, alignTo, coalignedEntities, inChannels, joinAll, makeIndependent, now, outChannels, pauseAll, playRole, processes, resumeAll, startAll, startAll, startClient, startClient, startServer, W, Z
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

log

private boolean log
If a logfile has to be produced.

Since:
1.3

protNames

protected java.util.Vector protNames
This Vector contains the names of the attached protocols.

Since:
1.6

failure

private boolean failure
Indicates if the ExtRouter is failed. (Default: false)


inConfiguration

protected boolean inConfiguration
Indicator if the class is in the configuration mode (true).

Constructor Detail

ExtRouter

public ExtRouter(Net N,
                 java.lang.String use_nhi,
                 int use_id)
Default constructor

Parameters:
N - The net that contains this router
use_nhi - The NHI context
use_id - The id to use for this node
Method Detail

config

public void config(com.renesys.raceway.DML.Configuration cfg)
            throws com.renesys.raceway.DML.configException
Configures the ExtRouter by adding Onic.

Specified by:
config in interface com.renesys.raceway.DML.Configurable
Overrides:
config in class Host
Parameters:
cfg - the configuration object.
com.renesys.raceway.DML.configException

storeProtocolSessionName

private void storeProtocolSessionName(com.renesys.raceway.DML.Configuration cfg)
                               throws com.renesys.raceway.DML.configException
Determines all used protocols out of the configuration file.

Parameters:
cfg - the Configuration containing the graph information.
Throws:
com.renesys.raceway.DML.configException - An configuration Exception occured.
Since:
1.6

removeProtocolSession

public void removeProtocolSession(java.lang.String name)
Remove a protocolSession of this node. This method does only remove the name out of the session name vector. It does not remove the session finally.

Parameters:
name - The name of the ProtocolSession to remove
Since:
1.6

getNameOfProtocols

public java.util.Vector getNameOfProtocols()
Determine the names of attached Protocols.

Returns:
A Vector containing the names of the protocolls
Since:
1.6

SessionForName

public ProtocolSession SessionForName(java.lang.String protocol_name)
                               throws ProtocolException
If a protocol has been registered under the given name, return an instance (session) of it. Otherwise, create a new session of the protocol and return that.

Overrides:
SessionForName in class ProtocolGraph
Parameters:
protocol_name - The name of the protocol
Returns:
The ProtocolSession
Throws:
ProtocolException - if the specified protocol name doesn't name a valid protocol class, or if the class could not be instantiated due to its lack of a public zero-argument constructor.

getNet

public Net getNet()
Return the net that contains this host

Overrides:
getNet in class Host
Returns:
the net that contains this host

getID

public int getID()
Return the ID of the host

Returns:
the ID of the host

setID

public void setID(int newID)
           throws IllegalIDException,
                  DuplicateIDException
Set the ID of the host

IllegalIDException
DuplicateIDException

getInterfaceAddresses

public java.util.Hashtable getInterfaceAddresses()
Return the table of the interfaces

Returns:
the table of the interfaces

getInterfaceCount

public int getInterfaceCount()
Number of interfaces constructed for this Host (may not all be "up")

Returns:
The number of interface attached to this host

isLog

public boolean isLog()
Returns if the log has to be created or not.

Returns:
true if the log has to be created or not..
Since:
1.3

setLog

public void setLog(boolean newValue)
Set the log value.

Parameters:
newValue - true if the log has to be created.
Since:
1.3

setFailure

public void setFailure(boolean newFailure)
Set the status of the ExtRouter. Is the value true == failure an ERROR event will be send. Otherwise a CHANGE event will be send.

Parameters:
newFailure - True if the OXC becomes failed.

isFailure

public boolean isFailure()
Informs if the OXC is failed.

Specified by:
isFailure in interface FailureInformation
Returns:
True if the link is failed.

notifyONIC

protected void notifyONIC()
Notifies the ONIC about a change in the failure setting. Additional verbose description.

Returns:
description.
See Also:
package.class

sendMessage

protected void sendMessage(short messageType)
Checks if the Eventhandler has receivers and this object is not in the configuration mode, this message will send the specified event.

Parameters:
messageType - the type of the message. The types are specified in the class gov.nist.antd.optical.event.monitor.EventHandler.

setInterfaceCount

public static void setInterfaceCount(int newInterfaceCount,
                                     Host ofHost)
Set the number of interfaces constructed for this Host (may not all be "up")

Returns:
The number of interfaces attached to this host

getInterfaceCount

public static int getInterfaceCount(Host ofHost)
Number of interfaces constructed for this Host (may not all be "up")

Returns:
The number of interfaces attached to this host