@Override public void dropBridge(String bridgeName) { String bridgeUUID = getBridgeUuid(bridgeName); if (bridgeUUID == null) { log.warn("Could not find bridge in node", nodeId.getIpAddress()); return; } deleteConfig(OvsdbConstant.BRIDGE, "_uuid", bridgeUUID, OvsdbConstant.DATABASENAME, "bridges"); }
@Override public void dropTunnel(IpAddress srcIp, IpAddress dstIp) { String bridgeName = OvsdbConstant.INTEGRATION_BRIDGE; String portName = getTunnelName(OvsdbConstant.TYPEVXLAN, dstIp); String bridgeUuid = getBridgeUuid(OvsdbConstant.INTEGRATION_BRIDGE); if (bridgeUuid == null) { log.warn("Could not find bridge {} in {}", bridgeName, nodeId.getIpAddress()); return; } String portUUID = getPortUuid(portName, bridgeUuid); if (portUUID != null) { log.info("Delete tunnel"); deleteConfig(OvsdbConstant.PORT, "_uuid", portUUID, OvsdbConstant.BRIDGE, "ports"); } return; }
@Override public void createPort(String bridgeName, String portName) { String bridgeUuid = getBridgeUuid(bridgeName); if (bridgeUuid == null) { log.error("Can't find bridge {} in {}", bridgeName, nodeId.getIpAddress()); return; } DatabaseSchema dbSchema = schema.get(OvsdbConstant.DATABASENAME); String portUuid = getPortUuid(portName, bridgeUuid); Port port = (Port) TableGenerator.createTable(dbSchema, OvsdbTable.PORT); port.setName(portName); if (portUuid == null) { insertConfig( OvsdbConstant.PORT, "_uuid", OvsdbConstant.BRIDGE, "ports", bridgeUuid, port.getRow()); } else { updateConfig(OvsdbConstant.PORT, "_uuid", portUuid, port.getRow()); } return; }