Sho SHIMIZU
Committed by Gerrit Code Review

Remove methods deprecated in Emu

Change-Id: I924533daf64e07a1164d456bad4f87ec79098b44
......@@ -95,26 +95,6 @@ public class OchSignal implements Lambda {
}
/**
* Create OCh signal from channel number.
*
* @param channel channel number
* @param maxFrequency maximum frequency
* @param grid grid spacing frequency
*
* @deprecated 1.4.0 Emu Release
*/
@Deprecated
public OchSignal(int channel, Frequency maxFrequency, Frequency grid) {
// Calculate center frequency
Frequency centerFrequency = maxFrequency.subtract(grid.multiply(channel - 1));
this.gridType = DEFAULT_OCH_GRIDTYPE;
this.channelSpacing = DEFAULT_CHANNEL_SPACING;
this.spacingMultiplier = (int) (centerFrequency.subtract(Spectrum.CENTER_FREQUENCY).asHz() / grid.asHz());
this.slotGranularity = (int) Math.round((double) grid.asHz() / ChannelSpacing.CHL_12P5GHZ.frequency().asHz());
}
/**
* Creates OCh signal.
*
* @param centerFrequency frequency
......
......@@ -44,16 +44,6 @@ public interface OvsdbClientService extends OvsdbRpc {
OvsdbNodeId nodeId();
/**
* Creates the configuration for tunnel.
*
* @param srcIp source IP address
* @param dstIp destination IP address
* @deprecated 1.4.0 Emu release
*/
@Deprecated
void createTunnel(IpAddress srcIp, IpAddress dstIp);
/**
* Creates a tunnel port with given options.
*
* @param bridgeName bridge name
......
......@@ -706,77 +706,6 @@ public class DefaultOvsdbClient
}
@Override
public void createTunnel(IpAddress srcIp, IpAddress dstIp) {
String bridgeUuid = getBridgeUuid(OvsdbConstant.INTEGRATION_BRIDGE);
if (bridgeUuid == null) {
log.warn("Could not find bridge {} and Could not create tunnel. ",
OvsdbConstant.INTEGRATION_BRIDGE);
return;
}
DatabaseSchema dbSchema = schema.get(OvsdbConstant.DATABASENAME);
String portName = getTunnelName(OvsdbConstant.TYPEVXLAN, dstIp);
String portUuid = getPortUuid(portName, bridgeUuid);
Port port = (Port) TableGenerator
.createTable(dbSchema, OvsdbTable.PORT);
if (port != null) {
port.setName(portName);
}
if (portUuid == null) {
portUuid = insertConfig(OvsdbConstant.PORT, "_uuid", OvsdbConstant.BRIDGE,
"ports", bridgeUuid, port.getRow());
} else {
updateConfig(OvsdbConstant.PORT, "_uuid", portUuid, port.getRow());
}
// When a tunnel is created, A row is inserted into port table and
// interface table of the ovsdb node.
// and the following step is to get the interface uuid from local store
// in controller node.
// but it need spend some time synchronising data between node and
// controller.
// so loop to judge if interfaceUUid is null is necessary.
String interfaceUuid = null;
for (int i = 0; i < 10; i++) {
interfaceUuid = getInterfaceUuid(portUuid, portName);
if (interfaceUuid == null) {
try {
Thread.sleep(500);
} catch (InterruptedException e) {
log.warn("Interrupted while waiting to get interfaceUuid");
Thread.currentThread().interrupt();
}
} else {
break;
}
}
if (interfaceUuid != null) {
Interface tunInterface = (Interface) TableGenerator
.createTable(dbSchema, OvsdbTable.INTERFACE);
if (tunInterface != null) {
tunInterface.setType(OvsdbConstant.TYPEVXLAN);
Map<String, String> options = Maps.newHashMap();
options.put("key", "flow");
options.put("local_ip", srcIp.toString());
options.put("remote_ip", dstIp.toString());
tunInterface.setOptions(options);
updateConfig(OvsdbConstant.INTERFACE, "_uuid", interfaceUuid,
tunInterface.getRow());
log.info("Tunnel added success", tunInterface);
}
}
return;
}
@Override
public boolean createTunnel(String bridgeName, String portName, String tunnelType, Map<String, String> options) {
String bridgeUuid = getBridgeUuid(bridgeName);
......
......@@ -49,11 +49,6 @@ public class OvsdbClientServiceAdapter implements OvsdbClientService {
}
@Override
public void createTunnel(IpAddress srcIp, IpAddress dstIp) {
}
@Override
public boolean createTunnel(String bridgeName, String portName, String tunnelType, Map<String, String> options) {
return true;
}
......