- private boolean isValidPortId(String portId, String nodeConnectorType) {
- if (NodeConnectorIDType.getClassType(nodeConnectorType) == null) {
- logger.warn("Invalid node connector id type {}", nodeConnectorType);
- return false;
- }
-
- return true;
- }
-
- private long getSwitchIDLong(String switchId) {
- int radix = 16;
- String switchString = "0";
-
- if (isValidSwitchId(switchId)) {
- if (switchId.contains(":")) {
- // Handle the 00:00:AA:BB:CC:DD:EE:FF notation
- switchString = switchId.replace(":", "");
- } else if (switchId.contains("-")) {
- // Handle the 00-00-AA-BB-CC-DD-EE-FF notation
- switchString = switchId.replace("-", "");
- } else {
- // Handle the 0123456789ABCDEF notation
- switchString = switchId;
- }
- }
- return Long.parseLong(switchString, radix);