Package org.onosproject.net.optical.util
Class OpticalChannelUtility
- java.lang.Object
-
- org.onosproject.net.optical.util.OpticalChannelUtility
-
public final class OpticalChannelUtility extends Object
Optical Channel Utility is a set of methods to convert different set of parameters to the OchSignal instance and backwards.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static org.onlab.util.FrequencycomputeCentralFrequency(int spacingMultiplier, org.onosproject.net.ChannelSpacing channelSpacing)This method computes the Central Frequency value from Spacing Multiplier and Channel Spacing values.static intcomputeSlotGranularity(org.onlab.util.Frequency slotWidth)This method computes Slot Granularity from Slot Width value.static org.onlab.util.FrequencycomputeSlotWidth(int slotGranularity)This method computes Slot Width value from Slot Granularity value.static intcomputeSpacingMultiplier(org.onlab.util.Frequency centralFrequency, org.onosproject.net.ChannelSpacing channelSpacing)This method computes the Spacing Multiplier value from Central Frequency and Channel Spacing values.static org.onosproject.net.OchSignalcreateOchSignal(org.onlab.util.Frequency centralFrequency, org.onlab.util.Frequency slotWidth, org.onosproject.net.GridType gridType, org.onosproject.net.ChannelSpacing channelSpacing)This method creates OchSignal instance based on Central Frequency and the Slot Width of the channel.static org.onosproject.net.OchSignalcreateOchSignalFromBounds(org.onlab.util.Frequency lowerBound, org.onlab.util.Frequency upperBound, org.onosproject.net.GridType gridType, org.onosproject.net.ChannelSpacing channelSpacing)This method creates OchSignal instance from frequency bounds.static Map<String,org.onlab.util.Frequency>extractOch(org.onosproject.net.OchSignal signal, org.onosproject.net.ChannelSpacing channelSpacing)This method extracts Central Frequency and Slot Width from OchSignal instance.static Map<String,org.onlab.util.Frequency>extractOchFreqBounds(org.onosproject.net.OchSignal signal, org.onosproject.net.ChannelSpacing channelSpacing)This method extracts frequency bounds from OchSignal instance.
-
-
-
Method Detail
-
createOchSignal
public static final org.onosproject.net.OchSignal createOchSignal(org.onlab.util.Frequency centralFrequency, org.onlab.util.Frequency slotWidth, org.onosproject.net.GridType gridType, org.onosproject.net.ChannelSpacing channelSpacing)This method creates OchSignal instance based on Central Frequency and the Slot Width of the channel.- Parameters:
centralFrequency- - central frequency of the connection.slotWidth- - bandwidth of the optical channel.gridType- - type of the frequency grid.channelSpacing- - channel spacing.- Returns:
- - returns created instance of OchSignal.
-
createOchSignalFromBounds
public static final org.onosproject.net.OchSignal createOchSignalFromBounds(org.onlab.util.Frequency lowerBound, org.onlab.util.Frequency upperBound, org.onosproject.net.GridType gridType, org.onosproject.net.ChannelSpacing channelSpacing)This method creates OchSignal instance from frequency bounds.- Parameters:
lowerBound- - lower bound of the frequency.upperBound- - upper bound of the frequency.gridType- - type of the frequency grid.channelSpacing- - channel spacing.- Returns:
- - returns created instance of OchSignal.
-
extractOchFreqBounds
public static final Map<String,org.onlab.util.Frequency> extractOchFreqBounds(org.onosproject.net.OchSignal signal, org.onosproject.net.ChannelSpacing channelSpacing)
This method extracts frequency bounds from OchSignal instance.- Parameters:
signal- - OchSignal instance.channelSpacing- - channel spacing.- Returns:
- - HashMap with upper and lower bounds of frequency.
-
extractOch
public static final Map<String,org.onlab.util.Frequency> extractOch(org.onosproject.net.OchSignal signal, org.onosproject.net.ChannelSpacing channelSpacing)
This method extracts Central Frequency and Slot Width from OchSignal instance.- Parameters:
signal- - OchSignal instance.channelSpacing- - channel spacing.- Returns:
- - HashMap with upper and lower bounds of frequency.
-
computeSpacingMultiplier
public static final int computeSpacingMultiplier(org.onlab.util.Frequency centralFrequency, org.onosproject.net.ChannelSpacing channelSpacing)This method computes the Spacing Multiplier value from Central Frequency and Channel Spacing values.- Parameters:
centralFrequency- - central frequency.channelSpacing- - channel spacing.- Returns:
- - computed spacing multiplier.
-
computeSlotGranularity
public static final int computeSlotGranularity(org.onlab.util.Frequency slotWidth)
This method computes Slot Granularity from Slot Width value.- Parameters:
slotWidth- - slot width.- Returns:
- - computed slot granularity.
-
computeCentralFrequency
public static final org.onlab.util.Frequency computeCentralFrequency(int spacingMultiplier, org.onosproject.net.ChannelSpacing channelSpacing)This method computes the Central Frequency value from Spacing Multiplier and Channel Spacing values.- Parameters:
spacingMultiplier- - spacing multiplier.channelSpacing- - channel spacing.- Returns:
- - central frequency as an instance of Frequency.
-
computeSlotWidth
public static final org.onlab.util.Frequency computeSlotWidth(int slotGranularity)
This method computes Slot Width value from Slot Granularity value.- Parameters:
slotGranularity- - slot granularity.- Returns:
- - slot width as an instance of Frequency.
-
-