|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--gov.nist.antd.optical.AbstractObject | +--gov.nist.antd.optical.Fiber
The physical fiber the link uses.
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.
Field Summary | |
private boolean |
bidirectional
Indicates if the fiber is bidirectional (true) or unidirectional (false). |
static int |
BW_ALL
Constant for the method getBandwidth. |
static int |
BW_CONTROL
Constant for the method getBandwidth. |
static int |
BW_DATA
Constant for the method getBandwidth. |
private double |
deltaWavelength
The space between 2 wavelengths in nm |
private boolean |
failure
Indicates a failure of the fiber itself. |
private int |
host1PortID
The port id of the host 1. |
private int |
host2ID
If this fiber is unidirectional this attribute contains the ID address of the receiver == host2. |
private int |
host2PortID
The port id of the host 2. |
private int |
id
The id of the fiber. |
protected boolean |
inConfiguration
Indicator if the class is in the configuration mode (true). |
static int |
INITIAL_ARRAY_SIZE
Constant for the fiber array. |
private Lambda[] |
lambdas
The lambdas used in this fiber. |
private OpticalLink |
link
The link the fiber is used for. |
private int |
noLambdas
Number of lambdas assigned to the Lambda. |
private boolean |
protection
Indicates if this fiber is used as a protection fiber. |
private int |
protectionMode
The mode of Protection ProtectionMode.NEVER, ProtectionMode.ONLY, or ProtectionMode.SHARED |
private double |
startWavelength
The starting point for the wavelength. |
private boolean |
used
Indicates if this fiber is in use. |
Constructor Summary | |
Fiber(OpticalLink link)
Default constructor. |
Method Summary | |
void |
addControlLambda(Lambda lambda)
Modifies the status of the given lambda to use for control plane. |
void |
addLambda(Lambda lambda)
Add a lambda in this fiber. |
void |
config(com.renesys.raceway.DML.Configuration cfg)
Configure the Fiber. |
protected void |
configHost2(com.renesys.raceway.DML.Configuration cfg)
Configures host2 or the receiver. |
protected void |
configID(java.lang.String value)
Configure the optional parameters of the Fiber. |
protected void |
configLambdas(com.renesys.raceway.DML.Configuration cfg)
Configure the lambdas of the fiber. |
protected void |
configOptional(com.renesys.raceway.DML.Configuration cfg)
Configure the optional parameters of the Fiber. |
protected void |
configPortID(com.renesys.raceway.DML.Configuration cfg)
Configure the ports of the fiber. |
protected java.lang.Object[] |
createArray(int size)
Creates an Lambda array of the specified size. |
protected void |
generateLambdas(double fiberBandwidth,
int noLambdas,
boolean control)
Autogeneration of the lambdas. |
double |
getBandwidth(int type)
Compute the max. |
double |
getBandWidth(int type,
boolean maximum)
Compute the bandwidth. |
Lambda[] |
getControlLambdas()
Returns all control lambdas. |
Lambda[] |
getDataLambdas()
Returns an array containing all data lambdas. |
double |
getDeltaWavelength()
Get the deltaWavelength value. |
int |
getHost1ID()
Returns the host1 id of this fiber. |
protected ONIC |
getHost1ONIC()
Determines the sender ONIC. |
int |
getHost2ID()
Returns the host2 id of this fiber. |
protected ONIC |
getHost2ONIC()
Determines the receiver ONIC. |
int |
getID()
Get the fiber id. |
Lambda |
getLambda(int lambdaID)
Find the specified lambda of this fiber. |
Lambda[] |
getLambdas()
Find all lambda's that belong this fiber. |
OpticalLink |
getLink()
Get the link the fiber is attached. |
double |
getMaximumBandwidth(int type)
Compute the maximum bandwidth. |
double |
getNextWavelength()
Get the next available wavelength |
int |
getPortID(boolean host2)
Get the fibers port id for host1 (sender) or host2 (receiver) |
int |
getPortID(int hostID)
Get the fibers port id on the specific host. |
int |
getProtectionMode()
Returns the protection mode of the fiber. |
int |
getReceiverID()
Deprecated. use getHost2ID() instead. |
protected ONIC |
getReceiverONIC()
Deprecated. use getHost2ONIC() instead. |
protected ONIC |
getSenderONIC()
Deprecated. use getHost1ONIC() instead. |
double |
getStartWavelength()
Get the starting wavelength value. |
boolean |
isAvailable()
Determines if the fiber is available. |
boolean |
isBidirectional()
Returns if the fiber is bidirectional. |
boolean |
isDepthFailure()
Determines if fiber, the lambdas in the fiber, or the link is failed. |
boolean |
isFailure()
Determines if the fiber itself is failed. |
boolean |
isProtection()
Informs if the fiber is used to protect an other fiber. |
boolean |
isUsed()
Informs if the fiber is used. |
boolean |
isWavelengthUsed(double wavelength)
Check if this wavelength is used in one of the lambda |
private void |
notifyONIC()
Notifies the ONIC for a failed fiber. |
void |
removeLambda(Lambda lambda)
Delete a lambda in this fiber. |
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 |
setBidirectional(boolean bidirectional)
Set the fiber as uni- or bidirectional |
void |
setDeltaWavelength(double deltaWavelength)
Set the deltaWavelength. |
void |
setFailure(boolean newValue)
Set the attribute failure. |
void |
setHost2ID(int host2ID)
Set the ID of the host2 (receiver for unidirectional links) of this fiber. |
void |
setID(int newId)
Set the fiber's id. |
protected void |
setNoElements(int size)
Set the number of elements. |
void |
setPortID(boolean host2,
int id)
Set the fiber's id. |
void |
setProtection(boolean protection)
Set the attribute protection. |
void |
setProtectionMode(int newMode)
Set the protection mode. |
void |
setReceiverID(int receiverID)
Deprecated. use setHost2ID instead. |
void |
setStartWavelength(double wavelength)
Set the startWavelength. |
void |
setUsed(boolean used)
Set the attribute used. |
java.lang.String |
toString()
Return the informations of the optical link |
Methods inherited from class gov.nist.antd.optical.AbstractObject |
addElement, clear, isElementOf, removeElement |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int INITIAL_ARRAY_SIZE
public static final int BW_DATA
public static final int BW_CONTROL
public static final int BW_ALL
private boolean failure
private boolean protection
private int protectionMode
private boolean bidirectional
private int noLambdas
private int id
private int host1PortID
private int host2PortID
private int host2ID
private boolean used
protected boolean inConfiguration
private Lambda[] lambdas
private OpticalLink link
private double startWavelength
private double deltaWavelength
Constructor Detail |
public Fiber(OpticalLink link)
link
- The attached link.Method Detail |
public void addControlLambda(Lambda lambda) throws DataIntegrityException
lambda
- The lambda to use for control plane.
DataIntegrityException
- The lambda could not be added.public void addLambda(Lambda lambda) throws DataIntegrityException
lambda
- The lambda to add.
DataIntegrityException
- The lambda could not be added.public int getID()
public int getPortID(boolean host2)
host2
- if true the port id of the host2 (receiver), otherwise the
requested id is host1 (sender).
public int getPortID(int hostID) throws IllegalIDException
hostID
- The id of the host we want the port number.
IllegalIDException
public Lambda[] getLambdas()
public Lambda getLambda(int lambdaID)
lambdaID
- The id of the lambda to find.
public OpticalLink getLink()
public int getReceiverID()
public int getHost2ID()
public int getHost1ID()
public boolean isAvailable()
public boolean isFailure()
isFailure
in interface FailureInformation
public boolean isDepthFailure()
public boolean isProtection()
public int getProtectionMode()
public boolean isUsed()
public boolean isBidirectional()
public void removeLambda(Lambda lambda)
lambda
- The lambda to remove.public void setFailure(boolean newValue)
newValue
- The new value.protected ONIC getReceiverONIC()
protected ONIC getHost2ONIC()
protected ONIC getSenderONIC()
protected ONIC getHost1ONIC()
public void setPortID(boolean host2, int id) throws IllegalIDException, DataIntegrityException
host2
- indicates if this port id is on the side of host2 (==receiver)
if true or the side of host1 (senders).id
- The new id.
IllegalIDException
- the given id is illegal (<0).
DataIntegrityException
- the id is already used.public void setID(int newId) throws IllegalIDException, DataIntegrityException
newId
- The new id.
IllegalIDException
- the given id is illegal (<0).
DataIntegrityException
- the id is already used.public void setProtection(boolean protection)
protection
- The new value.public void setProtectionMode(int newMode) throws IllegalDataException, DataIntegrityException
newMode
- the protection mode.
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
public void setReceiverID(int receiverID) throws DataIntegrityException
receiverID
- the ID of an ExtRouter.
DataIntegrityException
- if the fiber is not connected to the
host with this id.public void setHost2ID(int host2ID) throws DataIntegrityException
host2ID
- the ID of an ExtRouter.
DataIntegrityException
- if the fiber is not connected to the
host with this id.public void setUsed(boolean used)
used
- The used value.public void setBidirectional(boolean bidirectional)
bidirectional
- if true, the fiber becomes bidirectional.public void setStartWavelength(double wavelength)
wavelength
- The starting value for wavelength.public double getStartWavelength()
public void setDeltaWavelength(double deltaWavelength)
deltaWavelength
- The value for the space between 2 lambdas.public double getDeltaWavelength()
public Lambda[] getDataLambdas()
public Lambda[] getControlLambdas()
protected java.lang.Object[] createArray(int size)
createArray
in class AbstractObject
size
- The size of the lambda array.
protected void setNoElements(int size)
setNoElements
in class AbstractObject
size
- the new number of elements.protected void configOptional(com.renesys.raceway.DML.Configuration cfg) throws com.renesys.raceway.DML.configException
cfg
- The configuration object.
com.renesys.raceway.DML.configException
- when a DML configuration error occurs.protected void configID(java.lang.String value) throws com.renesys.raceway.DML.configException
value
- The value of the id.
com.renesys.raceway.DML.configException
- The value is not valid.protected void configHost2(com.renesys.raceway.DML.Configuration cfg) throws com.renesys.raceway.DML.configException
cfg
- The configuration object.
com.renesys.raceway.DML.configException
- If the configuration is not valid.protected void configPortID(com.renesys.raceway.DML.Configuration cfg) throws com.renesys.raceway.DML.configException
cfg
- The configuration object.
com.renesys.raceway.DML.configException
- The port configuration is not good.protected void configLambdas(com.renesys.raceway.DML.Configuration cfg) throws com.renesys.raceway.DML.configException
cfg
- The configuration object.
com.renesys.raceway.DML.configException
- The port configuration is not good.protected void generateLambdas(double fiberBandwidth, int noLambdas, boolean control) throws com.renesys.raceway.DML.configException
fiberBandwidth
- The bandwidth of the fibernoLambdas
- The number of lambdas to add in the fibercontrol
- Indicates if we have to have control lambdas
when
- a DataIntegrity occurs.
com.renesys.raceway.DML.configException
public void config(com.renesys.raceway.DML.Configuration cfg) throws com.renesys.raceway.DML.configException
cfg
- The configuration object.
com.renesys.raceway.DML.configException
- The configuration is not good.public java.lang.String toString()
toString
in class java.lang.Object
public double getNextWavelength()
public boolean isWavelengthUsed(double wavelength)
wavelength
- The wavelength to check.
public double getBandwidth(int type)
type
- The type of requested bandwidth
(Fiber.BW_ALL, Fiber.BW_CONTROL, or Fiber.BW_DATA).
public double getMaximumBandwidth(int type)
type
- The type of requested bandwidth
(Fiber.BW_ALL, Fiber.BW_CONTROL, or Fiber.BW_DATA).
public double getBandWidth(int type, boolean maximum)
type
- The type of requested bandwidth
(Fiber.BW_ALL, Fiber.BW_CONTROL, or Fiber.BW_DATA).maximum
- Indicates if the result is the available bandwith (false)
or the maximum bandwidth (true).
protected void sendMessage(short messageType)
messageType
- the type of the message. The types are specified in the
class gov.nist.antd.optical.event.monitor.EventHandler.private void notifyONIC()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |