gov.nist.antd.optical.path
Class OpticalPath

java.lang.Object
  |
  +--gov.nist.antd.optical.AbstractObject
        |
        +--gov.nist.antd.optical.path.OpticalPath

public class OpticalPath
extends AbstractObject

The path is an end-to-end connection. It contains a set of optical channels. The more channels the path contains the bigger is the bandwidth.

 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.

Version:
2.2

 VERSION CONTROL
 -------------------------------------------------------------------------
 Name - YYYY/MM/DD - VERSION - ACTION
 borchert - 2001/05/29 - 1.0 - Source created.
 borchert - 2001/09/06       - Method getNoChannels published.
 borchert - 2001/09/06 - 1.1 - Added isFailure. This method checks the 
                               channels.
 borchert - 2001/10/18 - 2.0 - Added the method configSwitches and 
                               resetSwitches into OpticalPath.
                             - Added finalization method.
 borchert - 2001/10/18       - Added method isConnected(lambda).
                             - Added toString().
 rouil    - 2002/02/14       - Complete documentation.
 borchert - 2002/06/06 - 2.1 - Changed Reference from OpticalRoute to 
                               OpticalConnection
 rouil    - 2002/06/17 - 2.2 - Deprecated getRoute, use getConnection
 klink    - 2002/09/26       - Fixed logical bug in isFailure()
 

Author:
borchert
, gallo , rouil , klink

Field Summary
private  int noChannels
          Number of channels assigned to the optical path.
private  OpticalChannel[] opticalChannel
          The list of channels in that path
private  OpticalConnection route
          The Route this path belongs too.
 
Fields inherited from class gov.nist.antd.optical.AbstractObject
INITIAL_ARRAY_SIZE
 
Constructor Summary
OpticalPath(OpticalConnection oRoute)
          Default constructor.
 
Method Summary
 void addOpticalChannel(OpticalChannel channelConnection)
          Add an optical channel in this optical path
 boolean configSwitches()
          Configures the switches for each Channel.
protected  java.lang.Object[] createArray(int size)
          Creates an OpticalChannel array of the specified size.
 void finalize()
          Reset all switches if necessary.
 double getBandwidth()
          Return the bandwidth of the path
 OpticalConnection getConnection()
          Determines the connection object of the path.
 int getNoChannels()
          Returns the number of stored channels in this Route.
 OpticalChannel getOpticalChannel(int channelID)
          Returns the specified channel that belongs to this path.
 OpticalChannel[] getOpticalChannels()
          Returns a copy of the list of channels who belong to this path.
 OpticalConnection getRoute()
          Deprecated. use getConnection
 boolean isFailure()
          Determines if the Path is usable.
 boolean isProtection()
          Informs if the path is used to protect an other path.
 void removeOpticalChannel(OpticalChannel channel)
          Remove the given optical channel.
 boolean resetSwitches()
          Reset the switches for each Channel.
protected  void setNoElements(int size)
          Set the number of channels.
 java.lang.String toString()
          Returns the information about this optical path, including all of the optical channels that this path contains.
 
Methods inherited from class gov.nist.antd.optical.AbstractObject
addElement, clear, isElementOf, removeElement
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

noChannels

private int noChannels
Number of channels assigned to the optical path.


opticalChannel

private OpticalChannel[] opticalChannel
The list of channels in that path


route

private OpticalConnection route
The Route this path belongs too.

Constructor Detail

OpticalPath

public OpticalPath(OpticalConnection oRoute)
Default constructor.

Parameters:
oRoute - The optical route this path belongs to.
Method Detail

addOpticalChannel

public void addOpticalChannel(OpticalChannel channelConnection)
Add an optical channel in this optical path

Parameters:
channelConnection - The optical channel to add.

getOpticalChannels

public OpticalChannel[] getOpticalChannels()
Returns a copy of the list of channels who belong to this path.

Returns:
A copy of the channel list.

getOpticalChannel

public OpticalChannel getOpticalChannel(int channelID)
                                 throws IllegalIDException
Returns the specified channel that belongs to this path.

Parameters:
channelID - The id of the requested channel.
Returns:
The reguested channel or null if it does not exist.
IllegalIDException

removeOpticalChannel

public void removeOpticalChannel(OpticalChannel channel)
Remove the given optical channel.

Parameters:
channel - the channel to remove.

isProtection

public boolean isProtection()
Informs if the path is used to protect an other path.

Returns:
true if the path is a protecion path.

createArray

protected java.lang.Object[] createArray(int size)
Creates an OpticalChannel array of the specified size.

Specified by:
createArray in class AbstractObject
Parameters:
size - The size of the channel array.
Returns:
The array of OpticalChannels.

setNoElements

protected void setNoElements(int size)
Set the number of channels.

Specified by:
setNoElements in class AbstractObject
Parameters:
size - the new number of channels.

getRoute

public OpticalConnection getRoute()
Deprecated. use getConnection

Determines the route object of the path.

Returns:
the route the path belongs to.

getConnection

public OpticalConnection getConnection()
Determines the connection object of the path.

Returns:
the connection the path belongs to.

getBandwidth

public double getBandwidth()
Return the bandwidth of the path

Returns:
The bandwitdh of the path

getNoChannels

public int getNoChannels()
Returns the number of stored channels in this Route.

Returns:
the number of channels.

isFailure

public boolean isFailure()
Determines if the Path is usable.

Returns:
true if an failure occured in one or more channels;otherwise false.

configSwitches

public boolean configSwitches()
Configures the switches for each Channel. This method tries to configure as much channels as possible. If not all channels are configured this method returns false. The handling of this problem will be done by the caller of this method.

Returns:
true if all channels are configured.
Since:
2.0

resetSwitches

public boolean resetSwitches()
Reset the switches for each Channel. This method tries to reset as much channels as possible. If not all channels are resetted this method returns false. The handling of this problem will be done by the caller of this method.

Returns:
true if all channels are resettet.
Since:
2.0

finalize

public void finalize()
Reset all switches if necessary.

Overrides:
finalize in class java.lang.Object

toString

public java.lang.String toString()
Returns the information about this optical path, including all of the optical channels that this path contains.

Overrides:
toString in class java.lang.Object
Returns:
The string that contains the info to be printed.