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 boolean
backup
protected java.util.ArrayList<Batch>
batchs
protected java.util.ArrayList<BulkData>
bulks
protected int
dst
protected java.util.ArrayList<Flow>
flows
protected long
id
protected int[]
links
protected java.util.ArrayList<java.lang.Long>
lpBackup
protected boolean
reserved
protected int
Rx
protected int
src
protected int
Tx
protected int
typeProtection
-
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 void
addBatch(Batch batch)
protected void
addBulk(BulkData bulk)
protected void
addFlow(Flow flow)
protected void
addLpBackup(long lpBackupId)
protected java.util.ArrayList<Batch>
getBatchs()
protected java.util.ArrayList<BulkData>
getBulks()
int
getDestination()
Retrieves the destination node of a given LightPath.protected java.util.ArrayList<Flow>
getFlows()
int
getHops()
The fiber links are physical hops.long
getID()
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()
int
getRx()
double
getSnr()
int
getSource()
Retrieves the source node of a given LightPath.int
getTx()
java.lang.String
getTypeProtection()
java.lang.String
getTypeProtection(int typeProtection)
int
getTypeProtection(java.lang.String typeProtection)
boolean
isBackup()
boolean
isBackupShared()
boolean
isReserved()
protected void
removeBatch(Batch batch)
protected void
removeBulk(BulkData bulk)
protected void
removeFlow(Flow flow)
protected void
setBackup(boolean backup)
void
setId(long id)
protected void
setReserved(boolean reserved)
protected void
setRx(int Rx)
void
setSnr(double snr)
protected void
setTx(int Tx)
protected void
setTypeProtection(java.lang.String typeProtection)
java.lang.String
toString()
Prints all information related to a given LightPath, starting with its ID, to make it easier to identify.java.lang.String
toTrace()
-
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:
toString
in classjava.lang.Object
- Returns:
- string containing all the values of the LightPath's parameters
-
toTrace
public java.lang.String toTrace()
-