gov.nist.antd.optical
Class Lambda

java.lang.Object
  |
  +--gov.nist.antd.optical.Lambda
All Implemented Interfaces:
FailureInformation, LambdaInterface

public class Lambda
extends java.lang.Object
implements LambdaInterface, FailureInformation

The lambda used in a fiber.

 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 available
          Indicates if the Lambda is available.
private  double bandwidth
          This value represents the bandwidth of this lambda.
private  boolean control
          Indicates if this lambda is used for the control plane.
static double ERR
          Constante value for the precision in computing the wavelength.
private  boolean failure
          Indicates a failure of the Lambda.
private  Fiber fiber
          The fiber the lambda is asigned to.
private  int id
          The id of the lambda.
protected  boolean inConfiguration
          Indicator if the class is in the configuration mode (true).
private  Lambda pair
          The pair lambda assiociated to this lambda.
private  boolean protection
          Indicates if this Lambda is used as a protection for an other Lambda.
private  int protectionMode
          The mode of Protection ProtectionMode.NEVER, ProtectionMode.ONLY, or ProtectionMode.SHARED
private  boolean reserved
          Indicates if the Lambda is already reserved for later use.
private  double snr
          This attribute contains the signal to noise ratio.
private  double wavelength
          The wavelength.
 
Constructor Summary
Lambda(Fiber fiber)
          Constructs a lambda.
Lambda(Fiber fiber, int id)
          Constructs a lambda.
 
Method Summary
 boolean checkData()
          This method checks the data of the object.
 boolean compareCharacteristics(Lambda otherLambda)
          Compare the attribute wavelength of two lambda's.
 void config(com.renesys.raceway.DML.Configuration cfg)
          Configure the Fiber.
protected  void configureBandwidth(java.lang.String value)
          configures the bandwidth from the DML
private  void configureControl(java.lang.String value)
          Configures the control status.
private  void configureID(java.lang.String value)
          Configures the id.
protected  void configurePair(java.lang.String value)
          configures the pairing.
protected  void configureWaveLength(java.lang.String value)
          Configures the wavelength.
 double getBandwidth()
          Get the bandwidth of this lambda.
 Fiber getFiber()
          Get the Fiber this lambda is assigned.
 int getID()
          Get the id of this lambda.
 Lambda getPair()
          Get the pair lambda attached to this lambda.
 int getProtectionMode()
          Returns the protection mode of the lambda.
 double getSNR()
          Get the value of the signal to noise ratio.
 double getWavelength()
          Get the value of the wavelength.
 boolean isAvailable()
          Informs if this lambda is used.
 boolean isControl()
          Indicates if the lambdas is used for control.
 boolean isDepthFailure()
          Informs if lambda or one of the related components (fiber, link, and ONICS) are failed.
 boolean isFailure()
          Informs is this lambda component is failed.
 boolean isProtection()
          Informs if this lambda is used as a protection lambda.
 boolean isReserved()
          Informs if the lambda is already reserved.
private  void notifyONIC()
          Notifies the ONIC for a failed Lambda.
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.
 void setAvailable(boolean available)
          Set the attribute available.
 void setBandwidth(double bandwidth)
          Define the bandwidth for this lambda.
 void setControl(boolean control)
          Set the attribute control.
 void setFailure(boolean newValue)
          Set the attribute failure.
protected  void setFiber(Fiber newFiber)
          Set the fiber of this Lambda.
 void setID(int newID)
          Set the id for this lambda.
 void setPair(Lambda pair)
          Create a relation between two lambdas.
 void setProtection(boolean protection)
          Set the attribute protection.
 void setProtectionMode(int newMode)
          Set the protection mode.
 void setReserved(boolean reserved)
          Set the attribute reserved.
 void setSNR(double newSnr)
          Set the attribute signal to noise ratio.
 void setWavelength(double wavelength)
          Set the wavelength value of this lambda in nm.
 java.lang.String toString()
          Textual representation of the lambda.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ERR

public static double ERR
Constante value for the precision in computing the wavelength.


available

private boolean available
Indicates if the Lambda is available. This attribute MUST be false if the Lambda has a failure.


reserved

private boolean reserved
Indicates if the Lambda is already reserved for later use. This is usefull lambda assignment. This attribute will be used and manipulated by the class OpticalChannelSegment


control

private boolean control
Indicates if this lambda is used for the control plane.


failure

private boolean failure
Indicates a failure of the Lambda. If the Lambda has a failure the attribute available MUST be false.


id

private int id
The id of the lambda. This id has to be unique at the Fiber. ID=0 for the control lambda in each fiber.


protection

private boolean protection
Indicates if this Lambda is used as a protection for an other Lambda.


protectionMode

private int protectionMode
The mode of Protection ProtectionMode.NEVER, ProtectionMode.ONLY, or ProtectionMode.SHARED


bandwidth

private double bandwidth
This value represents the bandwidth of this lambda. (Default==2.5 Gbps)


snr

private double snr
This attribute contains the signal to noise ratio. (Default==0.0)


wavelength

private double wavelength
The wavelength. (Default==0.0)


inConfiguration

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


pair

private Lambda pair
The pair lambda assiociated to this lambda.


fiber

private Fiber fiber
The fiber the lambda is asigned to.

Constructor Detail

Lambda

public Lambda(Fiber fiber)
       throws DataIntegrityException
Constructs a lambda. The fiber must be a valid instance.

Parameters:
fiber - The fiber that contains this lambda.
Throws:
DataIntegrityException - The Lambda could not be created for the link.

Lambda

public Lambda(Fiber fiber,
              int id)
       throws DataIntegrityException
Constructs a lambda. The fiber must be a valid instance.

Parameters:
fiber - The fiber that contains this lambda.
id - The id of the lambda. This id must be unique in the fiber.
Throws:
DataIntegrityException - The Lambda could not be created for the link.
Method Detail

compareCharacteristics

public boolean compareCharacteristics(Lambda otherLambda)
Compare the attribute wavelength of two lambda's. The characteristics that are compared are
wavelength, protection, and signalType

Parameters:
otherLambda - The second lambda.
Returns:
True if there is no differences.

getFiber

public Fiber getFiber()
Get the Fiber this lambda is assigned.

Returns:
Attribute fiber.

getID

public int getID()
Get the id of this lambda.

Specified by:
getID in interface LambdaInterface
Returns:
The attribute ID.

getPair

public Lambda getPair()
Get the pair lambda attached to this lambda.

Returns:
Lambda The attribute Pair.

getBandwidth

public double getBandwidth()
Get the bandwidth of this lambda.

Returns:
the bandwidth

getSNR

public double getSNR()
Get the value of the signal to noise ratio.

Returns:
The attribute snr.

getWavelength

public double getWavelength()
Get the value of the wavelength.

Returns:
The attribute wavelength.

isAvailable

public boolean isAvailable()
Informs if this lambda is used.

Returns:
True if the lambda is not used and as no failure.

isReserved

public boolean isReserved()
Informs if the lambda is already reserved. This result of this method will not be affected by the availability of the lambda.

Returns:
true if the lambda is reserved, otherwise false.

isControl

public boolean isControl()
Indicates if the lambdas is used for control.

Returns:
true if the lambda is a control lambda.

isProtection

public boolean isProtection()
Informs if this lambda is used as a protection lambda.

Returns:
The attribute protection.

getProtectionMode

public int getProtectionMode()
Returns the protection mode of the lambda.

Returns:
The int that indicates the mode.

setAvailable

public void setAvailable(boolean available)
Set the attribute available.

Parameters:
available - True if the lambda is not used.

setReserved

public void setReserved(boolean reserved)
Set the attribute reserved.

Parameters:
reserved - True if the lambda is reserved.

setControl

public void setControl(boolean control)
Set the attribute control.

Parameters:
control - True if this lambda is used by control plane.

setID

public void setID(int newID)
           throws DuplicateIDException
Set the id for this lambda.

Parameters:
newID - The new id.
Throws:
DuplicateIDException - The ID is already used in the fiber.

setPair

public void setPair(Lambda pair)
             throws DataIntegrityException
Create a relation between two lambdas.

Parameters:
pair - The lambda attached to this one.
Throws:
DataIntegrityException - If the dataintegrity is not given.

setProtection

public void setProtection(boolean protection)
Set the attribute protection.

Parameters:
protection - The new status.

setProtectionMode

public void setProtectionMode(int newMode)
                       throws IllegalDataException,
                              DataIntegrityException
Set the protection mode.

Parameters:
newMode - the protection mode.
Throws:
IllegalDataExcetion - The given mode is not known.
DataIntegrityException - The given mode and the protection value is invalid (i.e. ProtectionMode.NEVER and isProtection()==true.
IllegalDataException

setBandwidth

public void setBandwidth(double bandwidth)
Define the bandwidth for this lambda.

Parameters:
bandwidth - The new bandwidth.

setSNR

public void setSNR(double newSnr)
Set the attribute signal to noise ratio.

Parameters:
newSnr - The new value.

setWavelength

public void setWavelength(double wavelength)
                   throws IllegalDataException,
                          DataIntegrityException
Set the wavelength value of this lambda in nm.

Parameters:
wavelength - The value of the wavelength.
Throws:
IllegalDataException
DataIntegrityException

isFailure

public boolean isFailure()
Informs is this lambda component is failed.

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

isDepthFailure

public boolean isDepthFailure()
Informs if lambda or one of the related components (fiber, link, and ONICS) are failed.

Returns:
True if the lambda, the related fiber, or the related link failed.

setFailure

public void setFailure(boolean newValue)
Set the attribute failure.

Parameters:
newValue - The new failure value.

toString

public java.lang.String toString()
Textual representation of the lambda.

Overrides:
toString in class java.lang.Object
Returns:
The textual representation as String.

setFiber

protected void setFiber(Fiber newFiber)
                 throws DataIntegrityException
Set the fiber of this Lambda.

Parameters:
newFiber - The fiber the lambda is assigned to.
Throws:
DataIntegrityException - will be thrown, if the data integrity is not given anymore.

checkData

public boolean checkData()
                  throws DataIntegrityException
This method checks the data of the object.

Returns:
true If the data are not complete.
Throws:
DataIntegrityException - This exception will be thrown only in the case that stored data are damaging the data integrity.

config

public void config(com.renesys.raceway.DML.Configuration cfg)
            throws com.renesys.raceway.DML.configException
Configure the Fiber.

Parameters:
cfg - The configuration object.
Throws:
com.renesys.raceway.DML.configException - an Configuration Exception occured

configureID

private void configureID(java.lang.String value)
                  throws com.renesys.raceway.DML.configException,
                         DataIntegrityException
Configures the id.

Parameters:
value - the id value.
Throws:
com.renesys.raceway.DML.configException - an configException occured.
DataIntegrityException - an DataIntegrityException occured.

configureControl

private void configureControl(java.lang.String value)
                       throws com.renesys.raceway.DML.configException,
                              DataIntegrityException
Configures the control status.

Parameters:
value - the control value.
Throws:
com.renesys.raceway.DML.configException - an configException occured.
DataIntegrityException - an DataIntegrityException occured.

configureWaveLength

protected void configureWaveLength(java.lang.String value)
                            throws DataIntegrityException
Configures the wavelength.

Parameters:
value - the wavelength value.
Throws:
DataIntegrityException - an DataIntegrityException occured.

configurePair

protected void configurePair(java.lang.String value)
                      throws com.renesys.raceway.DML.configException,
                             DataIntegrityException
configures the pairing.

Parameters:
value - the pair value.
Throws:
com.renesys.raceway.DML.configException - an configException occured.
DataIntegrityException - an DataIntegrityException occured.

configureBandwidth

protected void configureBandwidth(java.lang.String value)
                           throws IllegalDataException
configures the bandwidth from the DML

Parameters:
value - the string representing the bandwidth from the DML
Throws:
IllegalDataException - thrown if value is not a valid bandwidth

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.

notifyONIC

private void notifyONIC()
Notifies the ONIC for a failed Lambda.

Since:
1.3