gov.nist.antd.ssf.net
Class NICFailureModule

java.lang.Object
  |
  +--gov.nist.antd.ssf.net.NICFailureModule
All Implemented Interfaces:
DMLDump, FailureModule

public class NICFailureModule
extends java.lang.Object
implements FailureModule, DMLDump

This Module implements the default failure and recovery notification mechanism of a NIC.

 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 debug
          For debug purposes of this Module only (use in dml: debug true)
private static boolean DEBUG
          For debug purposes of all these MODULES (use in dml: DEBUG true).
private  double linkPropDelay
          The propagation delay of a link failure/recovery to the signaling protocol.
private  java.util.Vector messages
          This vector contains the messages for this process.
private  _NIC nic
          The NIC this module is assigned to.
 
Fields inherited from interface gov.nist.antd.ssf.FailureModule
DML_SECTION_NAME
 
Constructor Summary
NICFailureModule()
           
 
Method Summary
 void assign(NIC nic)
          Assign the module to the passed nic.
 void config(com.renesys.raceway.DML.Configuration cfg)
          Configures the failure module.
private  void debug(java.lang.String message)
          Generates the debug output.
 double getLinkPropDelay()
          Returns the propagation delay of link failures.
 boolean isDebug()
          Return if the DefaultFailureModule is in debug mode
protected  void linkFailure(_link link)
          This method deals with a link failure.
protected  void linkRecovery(_link link)
          This method deals with a link recovery.
protected  void nicFailure(_NIC oppositeNIC)
          This method deals with a NIC / Host failure.
protected  void nicRecovery(_NIC oppositeNIC)
          This method deals with a NIC / Host recovery.
 EventMessage[] processFailure(FailureInformation component)
          This method processes the failure notification of the passed object.
 EventMessage[] processRecovery(FailureInformation component)
          This method processes the failure recovery notification of the passed object.
 void setLinkPropDelay(double seconds)
          Set the propagation delay for link failures and recovery in seconds.
 java.lang.String toDML()
          This method generates the DML representation of this class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEBUG

private static boolean DEBUG
For debug purposes of all these MODULES (use in dml: DEBUG true).


debug

private boolean debug
For debug purposes of this Module only (use in dml: debug true)


linkPropDelay

private double linkPropDelay
The propagation delay of a link failure/recovery to the signaling protocol. (Default 0.0 seconds)


nic

private _NIC nic
The NIC this module is assigned to.


messages

private java.util.Vector messages
This vector contains the messages for this process. Each process method must clear this vector first.

Constructor Detail

NICFailureModule

public NICFailureModule()
Method Detail

debug

private void debug(java.lang.String message)
Generates the debug output.

Parameters:
message - The message that has to be printed.
Since:

assign

public void assign(NIC nic)
            throws IllegalAssignmentException
Assign the module to the passed nic.

Specified by:
assign in interface FailureModule
Parameters:
nic - The NIC the implemented module is assigned to.
Throws:
java.lang.IllegalAccessException - if the NIC is already set or the passed instance is not from the type _NIC.
IllegalAssignmentException - if the NIC is already set.

config

public void config(com.renesys.raceway.DML.Configuration cfg)
            throws com.renesys.raceway.DML.configException
Configures the failure module.

Specified by:
config in interface FailureModule
Parameters:
cfg - The configuration instance.
Throws:
com.renesys.raceway.DML.configException

setLinkPropDelay

public void setLinkPropDelay(double seconds)
Set the propagation delay for link failures and recovery in seconds.

Parameters:
seconds - the propagation delay in seconds.

getLinkPropDelay

public double getLinkPropDelay()
Returns the propagation delay of link failures.

Returns:
the propagation delay of link failures in seconds.

isDebug

public boolean isDebug()
Return if the DefaultFailureModule is in debug mode

Returns:
true if the DefaultFailureModule is in debug mode

processRecovery

public EventMessage[] processRecovery(FailureInformation component)
This method processes the failure recovery notification of the passed object. This method has to determine if the recovery process has to be started or not.

Specified by:
processRecovery in interface FailureModule
Parameters:
component - the component whose failure attribute was set to true.
Returns:
an array of messages that has to be send. If no message has to be send the array is empty.

processFailure

public EventMessage[] processFailure(FailureInformation component)
This method processes the failure notification of the passed object. This method has to take care about logical failures that are the result of this failure.

Specified by:
processFailure in interface FailureModule
Parameters:
component - the component whose failure attribute was set to false.
Returns:
an array of messages that has to be send. If no message has to be send the array is empty.

toDML

public java.lang.String toDML()
This method generates the DML representation of this class.

Specified by:
toDML in interface DMLDump
Returns:
The DML configuration as String

nicFailure

protected void nicFailure(_NIC oppositeNIC)
This method deals with a NIC / Host failure.

Parameters:
oppositeNIC - the affected _NIC

nicRecovery

protected void nicRecovery(_NIC oppositeNIC)
This method deals with a NIC / Host recovery.

Parameters:
oppositeNIC - the recovered _NIC

linkFailure

protected void linkFailure(_link link)
This method deals with a link failure.

Parameters:
link - the affected _link

linkRecovery

protected void linkRecovery(_link link)
This method deals with a link recovery.

Parameters:
link - the recovered optical link