Package ons
Class LightPath
java.lang.Object
ons.LightPath
- Direct Known Subclasses:
EONLightPath,WDMLightPath
public abstract class LightPath
extends java.lang.Object
In an optical network, a lightpath is a clear optical path which may traverse
several links in the network.
It is also good to know that information transmitted through lightpaths does not
undergo any conversion to or from electrical form.
-
Field Summary
Fields Modifier and Type Field Description protected booleanbackupprotected java.util.ArrayList<Batch>batchsprotected java.util.ArrayList<BulkData>bulksprotected intdstprotected java.util.ArrayList<Flow>flowsprotected longidprotected int[]linksprotected java.util.ArrayList<java.lang.Long>lpBackupprotected booleanreservedprotected intRxprotected intsrcprotected intTxprotected inttypeProtection -
Constructor Summary
Constructors Constructor Description LightPath(long id, int src, int dst, int[] links)Creates a new LightPath object. -
Method Summary
Modifier and Type Method Description protected voidaddBatch(Batch batch)protected voidaddBulk(BulkData bulk)protected voidaddFlow(Flow flow)protected voidaddLpBackup(long lpBackupId)protected java.util.ArrayList<Batch>getBatchs()protected java.util.ArrayList<BulkData>getBulks()intgetDestination()Retrieves the destination node of a given LightPath.protected java.util.ArrayList<Flow>getFlows()intgetHops()The fiber links are physical hops.longgetID()Retrieves the unique identifier of a given LightPath.int[]getLinks()Retrieves the LightPath's vector containing the identifier numbers of the links that compose the path.java.util.ArrayList<java.lang.Long>getLpBackup()intgetRx()doublegetSnr()intgetSource()Retrieves the source node of a given LightPath.intgetTx()java.lang.StringgetTypeProtection()java.lang.StringgetTypeProtection(int typeProtection)intgetTypeProtection(java.lang.String typeProtection)booleanisBackup()booleanisBackupShared()booleanisReserved()protected voidremoveBatch(Batch batch)protected voidremoveBulk(BulkData bulk)protected voidremoveFlow(Flow flow)protected voidsetBackup(boolean backup)voidsetId(long id)protected voidsetReserved(boolean reserved)protected voidsetRx(int Rx)voidsetSnr(double snr)protected voidsetTx(int Tx)protected voidsetTypeProtection(java.lang.String typeProtection)java.lang.StringtoString()Prints all information related to a given LightPath, starting with its ID, to make it easier to identify.java.lang.StringtoTrace()
-
Field Details
-
id
protected long id -
src
protected int src -
dst
protected int dst -
links
protected int[] links -
Tx
protected int Tx -
Rx
protected int Rx -
reserved
protected boolean reserved -
backup
protected boolean backup -
typeProtection
protected int typeProtection -
lpBackup
protected java.util.ArrayList<java.lang.Long> lpBackup -
flows
-
bulks
-
batchs
-
-
Constructor Details
-
LightPath
public LightPath(long id, int src, int dst, int[] links)Creates a new LightPath object.- Parameters:
id- unique identifiersrc- source nodedst- destination nodelinks- fyberlinks list composing the path
-
-
Method Details
-
getID
public long getID()Retrieves the unique identifier of a given LightPath.- Returns:
- the LightPath's id attribute
-
setId
public void setId(long id) -
getTx
public int getTx() -
setTx
protected void setTx(int Tx) -
getRx
public int getRx() -
setRx
protected void setRx(int Rx) -
isReserved
public boolean isReserved() -
setReserved
protected void setReserved(boolean reserved) -
isBackup
public boolean isBackup() -
setBackup
protected void setBackup(boolean backup) -
getSnr
public double getSnr() -
setSnr
public void setSnr(double snr) -
getLpBackup
public java.util.ArrayList<java.lang.Long> getLpBackup() -
addLpBackup
protected void addLpBackup(long lpBackupId) -
isBackupShared
public boolean isBackupShared() -
getFlows
-
addFlow
-
removeFlow
-
getBulks
-
addBulk
-
removeBulk
-
getBatchs
-
addBatch
-
removeBatch
-
getSource
public int getSource()Retrieves the source node of a given LightPath.- Returns:
- the LightPath's src attribute
-
getDestination
public int getDestination()Retrieves the destination node of a given LightPath.- Returns:
- the LightPath's dst attribute.
-
getLinks
public int[] getLinks()Retrieves the LightPath's vector containing the identifier numbers of the links that compose the path.- Returns:
- a vector of integers that represent fiberlinks identifiers
-
getHops
public int getHops()The fiber links are physical hops. Therefore, by retrieving the number of elements in a LightPath's list of fiber links, we get the number of hops the LightPath has.- Returns:
- the number of hops in a given LightPath
-
setTypeProtection
protected void setTypeProtection(java.lang.String typeProtection) -
getTypeProtection
public java.lang.String getTypeProtection(int typeProtection) -
getTypeProtection
public int getTypeProtection(java.lang.String typeProtection) -
getTypeProtection
public java.lang.String getTypeProtection() -
toString
public java.lang.String toString()Prints all information related to a given LightPath, starting with its ID, to make it easier to identify.- Overrides:
toStringin classjava.lang.Object- Returns:
- string containing all the values of the LightPath's parameters
-
toTrace
public java.lang.String toTrace()
-