}
public static InstanceIdentifier<Node> createInstanceIdentifier(NodeId nodeId) {
- InstanceIdentifier<Node> nodePath = InstanceIdentifier
+ return InstanceIdentifier
.create(NetworkTopology.class)
.child(Topology.class, new TopologyKey(SouthboundConstants.OVSDB_TOPOLOGY_ID))
.child(Node.class,new NodeKey(nodeId));
- return nodePath;
}
public static InstanceIdentifier<Node> createInstanceIdentifier(ConnectionInfo key,OvsdbBridgeName bridgeName) {
String uriString = SouthboundConstants.OVSDB_URI_PREFIX + "://"
+ new String(ip.getValue()) + ":" + port.getValue();
Uri uri = new Uri(uriString);
- NodeId nodeId = new NodeId(uri);
- return nodeId;
+ return new NodeId(uri);
}
public static InetAddress createInetAddress(IpAddress ip) throws UnknownHostException {
}
public static String createDatapathType(OvsdbBridgeAugmentation mdsalbridge) {
- String datapathtype = new String(SouthboundConstants.DATAPATH_TYPE_MAP.get(DatapathTypeSystem.class));
+ String datapathtype = SouthboundConstants.DATAPATH_TYPE_MAP.get(DatapathTypeSystem.class);
if (mdsalbridge.getDatapathType() != null) {
if (SouthboundConstants.DATAPATH_TYPE_MAP.get(mdsalbridge.getDatapathType()) != null) {
checkNotNull(nodeIid);
// node connector representing all physical ports on node
NodeConnectorKey nodeConnectorKey = new NodeConnectorKey(createNodeConnectorId(OFPP_ALL,
- nodeIid.firstKeyOf(Node.class, NodeKey.class).getId()));
+ nodeIid.firstKeyOf(Node.class).getId()));
InstanceIdentifier<NodeConnector> egressNc = nodeIid.child(NodeConnector.class, nodeConnectorKey);
return sendArp(senderAddress, tpa, egressNc);
}
private NodeConnectorId createNodeConnectorId(String connectorId, NodeId nodeId) {
- StringBuilder stringId = new StringBuilder(nodeId.getValue()).append(":").append(connectorId);
- return new NodeConnectorId(stringId.toString());
+ return new NodeConnectorId(nodeId.getValue() + ":" + connectorId);
}
/**
public static NodeId createManagedNodeId(InstanceIdentifier<Node> iid) {
- NodeKey nodeKey = iid.firstKeyOf(Node.class, NodeKey.class);
+ NodeKey nodeKey = iid.firstKeyOf(Node.class);
return nodeKey.getNodeId();
}
public static InstanceIdentifier<Topology> createInstanceIdentifier() {
- InstanceIdentifier<Topology> path = InstanceIdentifier
+ return InstanceIdentifier
.create(NetworkTopology.class)
.child(Topology.class, new TopologyKey(OVSDB_TOPOLOGY_ID));
- return path;
}
public static InstanceIdentifier<Node> createInstanceIdentifier(NodeId nodeId) {
- InstanceIdentifier<Node> nodePath = InstanceIdentifier
+ return InstanceIdentifier
.create(NetworkTopology.class)
.child(Topology.class, new TopologyKey(OVSDB_TOPOLOGY_ID))
.child(Node.class,new NodeKey(nodeId));
- return nodePath;
}
public static InstanceIdentifier<Node> createInstanceIdentifier(NodeKey ovsdbNodeKey, String bridgeName) {
}
public NodeKey getNodeKey() {
- return getInstanceIdentifier().firstKeyOf(Node.class, NodeKey.class);
+ return getInstanceIdentifier().firstKeyOf(Node.class);
}
public NodeId getNodeId() {
private static final Logger LOG = LoggerFactory.getLogger(SouthboundMapper.class);
private static NodeId createNodeId(OvsdbConnectionInstance client) {
- NodeKey key = client.getInstanceIdentifier().firstKeyOf(Node.class, NodeKey.class);
+ NodeKey key = client.getInstanceIdentifier().firstKeyOf(Node.class);
return key.getNodeId();
}
}
public static NodeId createManagedNodeId(InstanceIdentifier<Node> iid) {
- NodeKey nodeKey = iid.firstKeyOf(Node.class, NodeKey.class);
+ NodeKey nodeKey = iid.firstKeyOf(Node.class);
return nodeKey.getNodeId();
}
}
public static Set<String> createOvsdbBridgeProtocols(OvsdbBridgeAugmentation ovsdbBridgeNode) {
- Set<String> protocols = new HashSet<String>();
+ Set<String> protocols = new HashSet<>();
if (ovsdbBridgeNode.getProtocolEntry() != null && ovsdbBridgeNode.getProtocolEntry().size() > 0) {
for (ProtocolEntry protocol : ovsdbBridgeNode.getProtocolEntry()) {
if (SouthboundConstants.OVSDB_PROTOCOL_MAP.get(protocol.getProtocol()) != null) {
public static Map<UUID, Controller> createOvsdbController(OvsdbBridgeAugmentation omn,DatabaseSchema dbSchema) {
List<ControllerEntry> controllerEntries = omn.getControllerEntry();
- Map<UUID,Controller> controllerMap = new HashMap<UUID,Controller>();
+ Map<UUID,Controller> controllerMap = new HashMap<>();
if (controllerEntries != null && !controllerEntries.isEmpty()) {
for (ControllerEntry controllerEntry : controllerEntries) {
String controllerNamedUUID = "Controller_" + getRandomUUID();
if (iid != null) {
Optional<Node> nodeOptional = getBridgeNode(iid);
if (nodeOptional.isPresent() && nodeOptional.get().getTerminationPoint() != null) {
- TerminationPointKey key = iid.firstKeyOf(TerminationPoint.class, TerminationPointKey.class);
+ TerminationPointKey key = iid.firstKeyOf(TerminationPoint.class);
if (key != null) {
for (TerminationPoint tp:nodeOptional.get().getTerminationPoint()) {
if (tp.getKey().equals(key)) {
if (iid != null) {
Optional<OvsdbBridgeAugmentation> ovsdbBridgeOptional = getOvsdbBridgeAugmentation(iid);
if (ovsdbBridgeOptional.isPresent() && ovsdbBridgeOptional.get().getControllerEntry() != null) {
- ControllerEntryKey key = iid.firstKeyOf(ControllerEntry.class, ControllerEntryKey.class);
+ ControllerEntryKey key = iid.firstKeyOf(ControllerEntry.class);
if (key != null) {
for (ControllerEntry entry: ovsdbBridgeOptional.get().getControllerEntry()) {
if (entry.getKey().equals(key)) {
if (iid != null) {
Optional<OvsdbBridgeAugmentation> ovsdbBridgeOptional = getOvsdbBridgeAugmentation(iid);
if (ovsdbBridgeOptional.isPresent() && ovsdbBridgeOptional.get().getProtocolEntry() != null) {
- ProtocolEntryKey key = iid.firstKeyOf(ProtocolEntry.class, ProtocolEntryKey.class);
+ ProtocolEntryKey key = iid.firstKeyOf(ProtocolEntry.class);
if (key != null) {
for (ProtocolEntry entry: ovsdbBridgeOptional.get().getProtocolEntry()) {
if (entry.getKey().equals(key)) {
}
private NodeId getNodeId(OpenVSwitch ovs) {
- NodeKey nodeKey = getInstanceIdentifier(ovs).firstKeyOf(Node.class, NodeKey.class);
+ NodeKey nodeKey = getInstanceIdentifier(ovs).firstKeyOf(Node.class);
return nodeKey.getNodeId();
}
}
InstanceIdentifier<Node> bridgeIid, Bridge bridge) {
Preconditions.checkNotNull(bridgeIid);
Preconditions.checkNotNull(bridge);
- List<InstanceIdentifier<BridgeOtherConfigs>> result =
- new ArrayList<InstanceIdentifier<BridgeOtherConfigs>>();
+ List<InstanceIdentifier<BridgeOtherConfigs>> result = new ArrayList<>();
Bridge oldBridge = oldBridgeRows.get(bridge.getUuid());
InstanceIdentifier<Node> bridgeIid, Bridge bridge) {
Preconditions.checkNotNull(bridgeIid);
Preconditions.checkNotNull(bridge);
- List<InstanceIdentifier<BridgeExternalIds>> result =
- new ArrayList<InstanceIdentifier<BridgeExternalIds>>();
+ List<InstanceIdentifier<BridgeExternalIds>> result = new ArrayList<>();
Bridge oldBridge = oldBridgeRows.get(bridge.getUuid());
InstanceIdentifier<Node> bridgeIid, Bridge bridge) {
Preconditions.checkNotNull(bridgeIid);
Preconditions.checkNotNull(bridge);
- List<InstanceIdentifier<ProtocolEntry>> result =
- new ArrayList<InstanceIdentifier<ProtocolEntry>>();
+ List<InstanceIdentifier<ProtocolEntry>> result = new ArrayList<>();
Bridge oldBridge = oldBridgeRows.get(bridge.getUuid());
try {
connectionNode.setNodeId(getOvsdbConnectionInstance().getNodeId());
OvsdbNodeAugmentationBuilder ovsdbConnectionAugmentationBuilder = new OvsdbNodeAugmentationBuilder();
- List<ManagedNodeEntry> managedBridges = new ArrayList<ManagedNodeEntry>();
+ List<ManagedNodeEntry> managedBridges = new ArrayList<>();
InstanceIdentifier<Node> bridgeIid = SouthboundMapper.createInstanceIdentifier(getOvsdbConnectionInstance(),
bridge);
ManagedNodeEntry managedBridge = new ManagedNodeEntryBuilder().setBridgeRef(
.getOtherConfigColumn().getData();
if (otherConfigs != null && !otherConfigs.isEmpty()) {
Set<String> otherConfigKeys = otherConfigs.keySet();
- List<BridgeOtherConfigs> otherConfigList = new ArrayList<BridgeOtherConfigs>();
+ List<BridgeOtherConfigs> otherConfigList = new ArrayList<>();
String otherConfigValue;
for (String otherConfigKey : otherConfigKeys) {
otherConfigValue = otherConfigs.get(otherConfigKey);
.getData();
if (externalIds != null && !externalIds.isEmpty()) {
Set<String> externalIdKeys = externalIds.keySet();
- List<BridgeExternalIds> externalIdsList = new ArrayList<BridgeExternalIds>();
+ List<BridgeExternalIds> externalIdsList = new ArrayList<>();
String externalIdValue;
for (String externalIdKey : externalIdKeys) {
externalIdValue = externalIds.get(externalIdKey);
}
private NodeId getNodeId(Bridge bridge) {
- NodeKey nodeKey = getInstanceIdentifier(bridge).firstKeyOf(Node.class, NodeKey.class);
+ NodeKey nodeKey = getInstanceIdentifier(bridge).firstKeyOf(Node.class);
return nodeKey.getNodeId();
}
}