gov.nist.antd.optical
Class AddDropLambda

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

public class AddDropLambda
extends java.lang.Object
implements LambdaInterface

Virtual lambda used in the switching table for the add and drop capabilities.

 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  ProtocolSession dropSession
          The receiving session if this lambda is connected as drop lambda.
private  int id
          The id of the add drop lambda.
private  SwitchingTable switchingTable
          The switching table that manipulates this virtual lambda.
 
Constructor Summary
AddDropLambda(int ID, SwitchingTable table)
          Creates an add drop Lambda that belongs to a specified Lambda.
 
Method Summary
 int getAddFiberID()
          Return the id of the fiber connected to the add-lambda-port.
 int getAddLambdaID()
          Get the id of the lambda connected to the add-lambda-port or -1 if not connected.
 int getAddOnicID()
          Get the id of the ONIC connected to this add-lambda-port.
 int getDropFiberID()
          Return the id of the fiber connected to the drop-lambda-port.
 int getDropLambdaID()
          Get the id of the lambda connected to the drop-lambda-port or -1 if not connected.
 int getDropOnicID()
          Get the id of the ONIC connected to this drop-lambda-port.
 ProtocolSession getDropSession()
          Determines the drop session.
 int getID()
          Returns the ID of the AddDropLambda.
 AddDropLambda getPairofAddPort()
          Get the pair lambda add-drop-lambda attached to this add-lambda-port.
 AddDropLambda getPairofDropPort()
          Get the pair lambda add-drop-lambda attached to this drop-lambda-port.
 SwitchingTable getSwitchingTable()
          Get the table that uses this virtual lambda.
 boolean isAddLambda()
          Determine if the AddDropLambda is an add lambda.
 boolean isDropLambda()
          Determine if the AddDropLambda is an drop lambda.
 void setDropSession(ProtocolSession newSession)
          Set the receiving protocol session.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

id

private int id
The id of the add drop lambda.


switchingTable

private SwitchingTable switchingTable
The switching table that manipulates this virtual lambda.


dropSession

private ProtocolSession dropSession
The receiving session if this lambda is connected as drop lambda.

Constructor Detail

AddDropLambda

public AddDropLambda(int ID,
                     SwitchingTable table)
              throws IllegalIDException,
                     java.lang.NullPointerException
Creates an add drop Lambda that belongs to a specified Lambda.

Parameters:
ID - The id of the AddDropLambda. This id has to be unigue in the Switch.
table - the Switching table.
Throws:
IllegalIDException - The id is < 0.
java.lang.NullPointerException - The given table is null.
Method Detail

getID

public int getID()
Returns the ID of the AddDropLambda. Additional verbose description.

Specified by:
getID in interface LambdaInterface
Returns:
description.
See Also:
package.class

getSwitchingTable

public SwitchingTable getSwitchingTable()
Get the table that uses this virtual lambda.

Returns:
The switching table.

getDropSession

public ProtocolSession getDropSession()
Determines the drop session.

Returns:
the drop session if existent.

setDropSession

public void setDropSession(ProtocolSession newSession)
Set the receiving protocol session.

Parameters:
newSession - the protocol session that receives the messages.

isAddLambda

public boolean isAddLambda()
Determine if the AddDropLambda is an add lambda.

Returns:
true if the AddDropLambda is configured as add lambda.

isDropLambda

public boolean isDropLambda()
Determine if the AddDropLambda is an drop lambda.

Returns:
true if the AddDropLambda is configured as drop lambda.

getAddLambdaID

public int getAddLambdaID()
Get the id of the lambda connected to the add-lambda-port or -1 if not connected.

Returns:
The id or -1 if not connected.

getDropLambdaID

public int getDropLambdaID()
Get the id of the lambda connected to the drop-lambda-port or -1 if not connected.

Returns:
The id or -1 if not connected.

getAddFiberID

public int getAddFiberID()
Return the id of the fiber connected to the add-lambda-port.

Returns:
The fiber id if the connected or -1 if not connected.

getDropFiberID

public int getDropFiberID()
Return the id of the fiber connected to the drop-lambda-port.

Returns:
The fiber id if the connected or -1 if not connected.

getAddOnicID

public int getAddOnicID()
Get the id of the ONIC connected to this add-lambda-port.

Returns:
The ONIC id if the connected or -1 if not connected.

getDropOnicID

public int getDropOnicID()
Get the id of the ONIC connected to this drop-lambda-port.

Returns:
The ONIC id if the connected or -1 if not connected.

getPairofAddPort

public AddDropLambda getPairofAddPort()
                               throws DataIntegrityException
Get the pair lambda add-drop-lambda attached to this add-lambda-port.

Returns:
Lambda The attribute Pair or null.
Throws:
DataIntegrityException - if the pair is invalid.

getPairofDropPort

public AddDropLambda getPairofDropPort()
                                throws DataIntegrityException
Get the pair lambda add-drop-lambda attached to this drop-lambda-port.

Returns:
Lambda The attribute Pair or null.
Throws:
DataIntegrityException - if the pair is invalid.