Class PwaasUtil
- java.lang.Object
-
- org.onosproject.segmentrouting.pwaas.PwaasUtil
-
public final class PwaasUtil extends Object
Utility class with static methods that help parse pseudowire related information and also verify that a pseudowire combination is valid.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static L2TunnelHandler.ResultconfigurationValidity(List<L2TunnelDescription> pseudowires)static L2ModeparseMode(String mode)static IntegerparsePwId(String id)Parses a string as a pseudowire id - which is an integer.static org.onlab.packet.MplsLabelparsePWLabel(String label)static org.onlab.packet.VlanIdparseVlan(String vlan)Parses a vlan as a string.
-
-
-
Method Detail
-
parseVlan
public static org.onlab.packet.VlanId parseVlan(String vlan)
Parses a vlan as a string. Returns the VlanId if provided String can be parsed as an integer or is '' / '*'- Parameters:
vlan- string as read from configuration- Returns:
- VlanId null if error
-
parseMode
public static L2Mode parseMode(String mode)
- Parameters:
mode- RAW or TAGGED- Returns:
- the L2Mode if input is correct
-
parsePWLabel
public static org.onlab.packet.MplsLabel parsePWLabel(String label)
- Parameters:
label- the mpls label of the pseudowire- Returns:
- the MplsLabel
- Throws:
IllegalArgumentException- if label is invalid
-
parsePwId
public static Integer parsePwId(String id)
Parses a string as a pseudowire id - which is an integer.- Parameters:
id- The id of pw in string form- Returns:
- The id of pw as an Integer or null if it failed the conversion.
-
configurationValidity
public static L2TunnelHandler.Result configurationValidity(List<L2TunnelDescription> pseudowires)
-
-