private static InstanceIdentifier<Node> createInstanceIdentifier(IpAddress ip, PortNumber port) {
String uriString = HwvtepSouthboundConstants.HWVTEP_URI_PREFIX + "://"
- + new String(ip.getValue()) + ":" + port.getValue();
+ + String.valueOf(ip.getValue()) + ":" + port.getValue();
Uri uri = new Uri(uriString);
NodeId nodeId = new NodeId(uri);
InstanceIdentifier<Node> path = InstanceIdentifier.create(NetworkTopology.class)
}
private String connectionInfoToString(final ConnectionInfo connectionInfo) {
- return new String(connectionInfo.getRemoteIp().getValue()) + ":" + connectionInfo.getRemotePort().getValue();
+ return String.valueOf(connectionInfo.getRemoteIp().getValue()) + ":" + connectionInfo.getRemotePort().getValue();
}
private boolean addOvsdbNode(final ConnectionInfo connectionInfo) throws InterruptedException {
} else if (tokens[0].equalsIgnoreCase("ptcp")) {
ConnectionInfo connectionInfo = ovsdbNodeAugmentation.getConnectionInfo();
if (connectionInfo != null && connectionInfo.getLocalIp() != null) {
- controllerIpStr = new String(connectionInfo.getLocalIp().getValue());
+ controllerIpStr = String.valueOf(connectionInfo.getLocalIp().getValue());
controllersStr.add(Constants.OPENFLOW_CONNECTION_PROTOCOL
+ ":" + controllerIpStr + ":" + Constants.OPENFLOW_PORT);
} else {
public static NodeId createNodeId(IpAddress ip, PortNumber port) {
String uriString = SouthboundConstants.OVSDB_URI_PREFIX + "://"
- + new String(ip.getValue()) + ":" + port.getValue();
+ + String.valueOf(ip.getValue()) + ":" + port.getValue();
Uri uri = new Uri(uriString);
return new NodeId(uri);
}
}
- //private AtomicLong flowCookieInc = new AtomicLong(0x1L);
private BigInteger getCookie(FlowID flowID) {
- String cookieString = new String().format("1110%02d%010d", flowID.value, cookieIndex++);
- //new String().format("1100%02d00%04d", flowID.value, flowCookieInc.getAndIncrement());
- // "1100%02000000d%04d"
+ String cookieString = String.format("1110%02d%010d", flowID.value, cookieIndex++);
return new BigInteger(cookieString, 16);
}
} else if (tokens[0].equalsIgnoreCase("ptcp")) {
ConnectionInfo connectionInfo = ovsdbNodeAugmentation.getConnectionInfo();
if (connectionInfo != null && connectionInfo.getLocalIp() != null) {
- controllerIpStr = new String(connectionInfo.getLocalIp().getValue());
+ controllerIpStr = String.valueOf(connectionInfo.getLocalIp().getValue());
controllersStr.add(Constants.OPENFLOW_CONNECTION_PROTOCOL
+ ":" + controllerIpStr + ":" + Constants.OPENFLOW_PORT);
} else {
ConnectionInfo connectionInfo = ovsdbNodeAugmentation.getConnectionInfo();
LOG.info("connectionInfo: {}", connectionInfo);
if (connectionInfo != null && connectionInfo.getLocalIp() != null) {
- ipAddr = new String(connectionInfo.getLocalIp().getValue());
+ ipAddr = String.valueOf(connectionInfo.getLocalIp().getValue());
}
if (ipAddr == null) {
ipAddr = getLocalControllerHostIpAddress();
char[] ipAddress = {'0', '.', '0', '.', '0', '.', '0'};
when(connectionInfo.getLocalIp().getValue()).thenReturn(ipAddress);
String testTarget = SouthboundConstants.OPENFLOW_CONNECTION_PROTOCOL + ":"
- + new String(ipAddress) + ":" + SouthboundConstants.DEFAULT_OPENFLOW_PORT;
+ + String.valueOf(ipAddress) + ":" + SouthboundConstants.DEFAULT_OPENFLOW_PORT;
assertEquals("Incorrect controller IP", testTarget, SouthboundUtil.getControllerTarget(ovsdbNode));
verify(ovsdbNode).getAugmentation(OvsdbNodeAugmentation.class);
verify(ovsdbNodeAugmentation).getConnectionInfo();
}
private static String connectionInfoToString(final ConnectionInfo connectionInfo) {
- return new String(connectionInfo.getRemoteIp().getValue()) + ":" + connectionInfo.getRemotePort().getValue();
+ return String.valueOf(
+ connectionInfo.getRemoteIp().getValue()) + ":" + connectionInfo.getRemotePort().getValue();
}
@Test
public static NodeId createNodeId(IpAddress ip, PortNumber port) {
String uriString = SouthboundConstants.OVSDB_URI_PREFIX + "://"
- + new String(ip.getValue()) + ":" + port.getValue();
+ + String.valueOf(ip.getValue()) + ":" + port.getValue();
Uri uri = new Uri(uriString);
return new NodeId(uri);
}
public NodeId createNodeId(IpAddress ip, PortNumber port) {
String uriString = SouthboundConstants.OVSDB_URI_PREFIX + "://"
- + new String(ip.getValue()) + ":" + port.getValue();
+ + String.valueOf(ip.getValue()) + ":" + port.getValue();
Uri uri = new Uri(uriString);
return new NodeId(uri);
}
}
public String connectionInfoToString(final ConnectionInfo connectionInfo) {
- return new String(connectionInfo.getRemoteIp().getValue()) + ":" + connectionInfo.getRemotePort().getValue();
+ return String.valueOf(
+ connectionInfo.getRemoteIp().getValue()) + ":" + connectionInfo.getRemotePort().getValue();
}
public boolean addOvsdbNode(final ConnectionInfo connectionInfo) {