gov.nist.antd.optical
Class SwitchingTable

java.lang.Object
  |
  +--gov.nist.antd.optical.SwitchingTable

public class SwitchingTable
extends java.lang.Object

This class represent the SwitchingTable. It is used only by the OXCSwitch.

 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  java.util.Hashtable inTable
          HashTable.
private  java.util.Hashtable outTable
          HashTable.
private  OXCSwitch oxcSwitch
          The OXCSwitch that owns this switching table.
 
Constructor Summary
SwitchingTable(OXCSwitch oxcSwitch)
          Default constructor.
 
Method Summary
 void connect(LambdaInterface inLambda, LambdaInterface outLambda)
          connect two lambdas.
 void disconnect(LambdaInterface inLambda, LambdaInterface outLambda)
          Command sent from the router to the OXC switch requesting that it disconnect the output lambda from the connected input lambda.
 int[][] getConnectionsInfo()
          Return the list of the connections of switched lambdas only.
 LambdaInterface getInLambda(LambdaInterface outLambda)
          Find the connected input lambda for the output lambda.
 java.util.Enumeration getInLambdas()
          Return all the input lambdas of this OXC (AddDrop included).
 LambdaInterface getOutLambda(LambdaInterface inLambda)
          Find the connected output lambda for the input lambda.
 java.util.Enumeration getOutLambdas()
          Return all the output lambdas of this OXC (AddDrop included).
 OXCSwitch getOxcSwitch()
          Return the OxcSwitch that uses this switching table.
 void printInfos()
          Print the table of the connections
 void setOxcSwitch(OXCSwitch oxcSwitch)
          Set the OXCSwitch that will use this switching table.
 java.lang.String toString()
          Returns the table as String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

oxcSwitch

private OXCSwitch oxcSwitch
The OXCSwitch that owns this switching table.


inTable

private java.util.Hashtable inTable
HashTable. The key is the input lambda and the value is the output lambda.


outTable

private java.util.Hashtable outTable
HashTable. The key is the output lambda and the value is the input lambda.

Constructor Detail

SwitchingTable

public SwitchingTable(OXCSwitch oxcSwitch)
Default constructor.

Parameters:
oxcSwitch - The OXCSwitch that manipulates this table.
Method Detail

getOxcSwitch

public OXCSwitch getOxcSwitch()
Return the OxcSwitch that uses this switching table.

Returns:
OxcSwitch

setOxcSwitch

public void setOxcSwitch(OXCSwitch oxcSwitch)
Set the OXCSwitch that will use this switching table.

Parameters:
oxcSwitch - The OXCSwitch that manipulates this table.

connect

public void connect(LambdaInterface inLambda,
                    LambdaInterface outLambda)
connect two lambdas.

Parameters:
inLambda - The input lambda
outLambda - The output lambda

disconnect

public void disconnect(LambdaInterface inLambda,
                       LambdaInterface outLambda)
Command sent from the router to the OXC switch requesting that it disconnect the output lambda from the connected input lambda.

Parameters:
inLambda - The input lambda
outLambda - The output lambda.

getOutLambda

public LambdaInterface getOutLambda(LambdaInterface inLambda)
Find the connected output lambda for the input lambda.

Parameters:
inLambda - The lambda we want to have the connected output.
Returns:
The output lambda or null if invalide inLambda.

getInLambda

public LambdaInterface getInLambda(LambdaInterface outLambda)
Find the connected input lambda for the output lambda.

Parameters:
outLambda - The lambda we want to have the connected input.
Returns:
The input lambda or null if invalide output.

getInLambdas

public java.util.Enumeration getInLambdas()
Return all the input lambdas of this OXC (AddDrop included).

Returns:
The enumeration of input lambdas or Null if no input lambdas.

getOutLambdas

public java.util.Enumeration getOutLambdas()
Return all the output lambdas of this OXC (AddDrop included).

Returns:
The enumeration of output lambdas or Null if no output lambdas.

getConnectionsInfo

public int[][] getConnectionsInfo()
Return the list of the connections of switched lambdas only.
Result[0] == inONIC, Result[1] == inFiberID, Result[2] == inLambdaID
Result[3] == outONIC, Result[4] ==outFiberID, Result[5] == outLambdaID
Add and Drop ports are now included when ONIC ID and Fiber ID equal -1.

Returns:
The matrix of IDs or an matric of the size[0][0] if no connection.

toString

public java.lang.String toString()
Returns the table as String.

Overrides:
toString in class java.lang.Object
Returns:
The table as String.
Since:
1.1

printInfos

public void printInfos()
Print the table of the connections