Fix naming convention issues in preparation for stricter checkstyle enforcement
Change-Id: I918b7b1dcf6424a526b6b26b89acc9a57d807fec
Showing
36 changed files
with
228 additions
and
233 deletions
... | @@ -86,7 +86,7 @@ public final class AclRule { | ... | @@ -86,7 +86,7 @@ public final class AclRule { |
86 | /** | 86 | /** |
87 | * Check if the first CIDR address is in (or the same as) the second CIDR address. | 87 | * Check if the first CIDR address is in (or the same as) the second CIDR address. |
88 | */ | 88 | */ |
89 | - private boolean checkCIDRinCIDR(Ip4Prefix cidrAddr1, Ip4Prefix cidrAddr2) { | 89 | + private boolean checkCidrInCidr(Ip4Prefix cidrAddr1, Ip4Prefix cidrAddr2) { |
90 | if (cidrAddr2 == null) { | 90 | if (cidrAddr2 == null) { |
91 | return true; | 91 | return true; |
92 | } else if (cidrAddr1 == null) { | 92 | } else if (cidrAddr1 == null) { |
... | @@ -116,8 +116,8 @@ public final class AclRule { | ... | @@ -116,8 +116,8 @@ public final class AclRule { |
116 | public boolean checkMatch(AclRule r) { | 116 | public boolean checkMatch(AclRule r) { |
117 | return (this.dstTpPort == r.dstTpPort || r.dstTpPort == 0) | 117 | return (this.dstTpPort == r.dstTpPort || r.dstTpPort == 0) |
118 | && (this.ipProto == r.ipProto || r.ipProto == 0) | 118 | && (this.ipProto == r.ipProto || r.ipProto == 0) |
119 | - && (checkCIDRinCIDR(this.srcIp(), r.srcIp())) | 119 | + && (checkCidrInCidr(this.srcIp(), r.srcIp())) |
120 | - && (checkCIDRinCIDR(this.dstIp(), r.dstIp())); | 120 | + && (checkCidrInCidr(this.dstIp(), r.dstIp())); |
121 | } | 121 | } |
122 | 122 | ||
123 | /** | 123 | /** | ... | ... |
... | @@ -129,7 +129,7 @@ public class AclWebResource extends AbstractWebResource { | ... | @@ -129,7 +129,7 @@ public class AclWebResource extends AbstractWebResource { |
129 | * @return 200 OK | 129 | * @return 200 OK |
130 | */ | 130 | */ |
131 | @DELETE | 131 | @DELETE |
132 | - public Response clearACL() { | 132 | + public Response clearAcl() { |
133 | get(AclService.class).clearAcl(); | 133 | get(AclService.class).clearAcl(); |
134 | return Response.ok().build(); | 134 | return Response.ok().build(); |
135 | } | 135 | } |
... | @@ -189,4 +189,4 @@ public class AclWebResource extends AbstractWebResource { | ... | @@ -189,4 +189,4 @@ public class AclWebResource extends AbstractWebResource { |
189 | return rule.build(); | 189 | return rule.build(); |
190 | } | 190 | } |
191 | 191 | ||
192 | -} | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
192 | +} | ... | ... |
... | @@ -90,7 +90,7 @@ public class AclManager implements AclService { | ... | @@ -90,7 +90,7 @@ public class AclManager implements AclService { |
90 | /** | 90 | /** |
91 | * Checks if the given IP address is in the given CIDR address. | 91 | * Checks if the given IP address is in the given CIDR address. |
92 | */ | 92 | */ |
93 | - private boolean checkIpInCIDR(Ip4Address ip, Ip4Prefix cidr) { | 93 | + private boolean checkIpInCidr(Ip4Address ip, Ip4Prefix cidr) { |
94 | int offset = 32 - cidr.prefixLength(); | 94 | int offset = 32 - cidr.prefixLength(); |
95 | int cidrPrefix = cidr.address().toInt(); | 95 | int cidrPrefix = cidr.address().toInt(); |
96 | int ipIntValue = ip.toInt(); | 96 | int ipIntValue = ip.toInt(); |
... | @@ -111,17 +111,17 @@ public class AclManager implements AclService { | ... | @@ -111,17 +111,17 @@ public class AclManager implements AclService { |
111 | DeviceId deviceId = event.subject().location().deviceId(); | 111 | DeviceId deviceId = event.subject().location().deviceId(); |
112 | for (IpAddress address : event.subject().ipAddresses()) { | 112 | for (IpAddress address : event.subject().ipAddresses()) { |
113 | if ((rule.srcIp() != null) ? | 113 | if ((rule.srcIp() != null) ? |
114 | - (checkIpInCIDR(address.getIp4Address(), rule.srcIp())) : | 114 | + (checkIpInCidr(address.getIp4Address(), rule.srcIp())) : |
115 | - (checkIpInCIDR(address.getIp4Address(), rule.dstIp()))) { | 115 | + (checkIpInCidr(address.getIp4Address(), rule.dstIp()))) { |
116 | if (!aclStore.checkIfRuleWorksInDevice(rule.id(), deviceId)) { | 116 | if (!aclStore.checkIfRuleWorksInDevice(rule.id(), deviceId)) { |
117 | List<RuleId> allowingRuleList = aclStore | 117 | List<RuleId> allowingRuleList = aclStore |
118 | .getAllowingRuleByDenyingRule(rule.id()); | 118 | .getAllowingRuleByDenyingRule(rule.id()); |
119 | if (allowingRuleList != null) { | 119 | if (allowingRuleList != null) { |
120 | for (RuleId allowingRuleId : allowingRuleList) { | 120 | for (RuleId allowingRuleId : allowingRuleList) { |
121 | - generateACLFlow(aclStore.getAclRule(allowingRuleId), deviceId); | 121 | + generateAclFlow(aclStore.getAclRule(allowingRuleId), deviceId); |
122 | } | 122 | } |
123 | } | 123 | } |
124 | - generateACLFlow(rule, deviceId); | 124 | + generateAclFlow(rule, deviceId); |
125 | } | 125 | } |
126 | } | 126 | } |
127 | } | 127 | } |
... | @@ -212,7 +212,7 @@ public class AclManager implements AclService { | ... | @@ -212,7 +212,7 @@ public class AclManager implements AclService { |
212 | if (cidrAddr.prefixLength() != 32) { | 212 | if (cidrAddr.prefixLength() != 32) { |
213 | for (Host h : hosts) { | 213 | for (Host h : hosts) { |
214 | for (IpAddress a : h.ipAddresses()) { | 214 | for (IpAddress a : h.ipAddresses()) { |
215 | - if (checkIpInCIDR(a.getIp4Address(), cidrAddr)) { | 215 | + if (checkIpInCidr(a.getIp4Address(), cidrAddr)) { |
216 | deviceIdSet.add(h.location().deviceId()); | 216 | deviceIdSet.add(h.location().deviceId()); |
217 | } | 217 | } |
218 | } | 218 | } |
... | @@ -220,7 +220,7 @@ public class AclManager implements AclService { | ... | @@ -220,7 +220,7 @@ public class AclManager implements AclService { |
220 | } else { | 220 | } else { |
221 | for (Host h : hosts) { | 221 | for (Host h : hosts) { |
222 | for (IpAddress a : h.ipAddresses()) { | 222 | for (IpAddress a : h.ipAddresses()) { |
223 | - if (checkIpInCIDR(a.getIp4Address(), cidrAddr)) { | 223 | + if (checkIpInCidr(a.getIp4Address(), cidrAddr)) { |
224 | deviceIdSet.add(h.location().deviceId()); | 224 | deviceIdSet.add(h.location().deviceId()); |
225 | return deviceIdSet; | 225 | return deviceIdSet; |
226 | } | 226 | } |
... | @@ -245,10 +245,10 @@ public class AclManager implements AclService { | ... | @@ -245,10 +245,10 @@ public class AclManager implements AclService { |
245 | List<RuleId> allowingRuleList = aclStore.getAllowingRuleByDenyingRule(rule.id()); | 245 | List<RuleId> allowingRuleList = aclStore.getAllowingRuleByDenyingRule(rule.id()); |
246 | if (allowingRuleList != null) { | 246 | if (allowingRuleList != null) { |
247 | for (RuleId allowingRuleId : allowingRuleList) { | 247 | for (RuleId allowingRuleId : allowingRuleList) { |
248 | - generateACLFlow(aclStore.getAclRule(allowingRuleId), deviceId); | 248 | + generateAclFlow(aclStore.getAclRule(allowingRuleId), deviceId); |
249 | } | 249 | } |
250 | } | 250 | } |
251 | - generateACLFlow(rule, deviceId); | 251 | + generateAclFlow(rule, deviceId); |
252 | } | 252 | } |
253 | } | 253 | } |
254 | 254 | ||
... | @@ -256,7 +256,7 @@ public class AclManager implements AclService { | ... | @@ -256,7 +256,7 @@ public class AclManager implements AclService { |
256 | * Generates ACL flow rule according to ACL rule | 256 | * Generates ACL flow rule according to ACL rule |
257 | * and install it into related device. | 257 | * and install it into related device. |
258 | */ | 258 | */ |
259 | - private void generateACLFlow(AclRule rule, DeviceId deviceId) { | 259 | + private void generateAclFlow(AclRule rule, DeviceId deviceId) { |
260 | if (rule == null || aclStore.checkIfRuleWorksInDevice(rule.id(), deviceId)) { | 260 | if (rule == null || aclStore.checkIfRuleWorksInDevice(rule.id(), deviceId)) { |
261 | return; | 261 | return; |
262 | } | 262 | } | ... | ... |
... | @@ -83,11 +83,11 @@ public class IcmpHandler { | ... | @@ -83,11 +83,11 @@ public class IcmpHandler { |
83 | 83 | ||
84 | if (((ICMP) ipv4.getPayload()).getIcmpType() == ICMP.TYPE_ECHO_REQUEST && | 84 | if (((ICMP) ipv4.getPayload()).getIcmpType() == ICMP.TYPE_ECHO_REQUEST && |
85 | ipMatches) { | 85 | ipMatches) { |
86 | - sendICMPResponse(ethernet, connectPoint); | 86 | + sendIcmpResponse(ethernet, connectPoint); |
87 | } | 87 | } |
88 | } | 88 | } |
89 | 89 | ||
90 | - private void sendICMPResponse(Ethernet icmpRequest, ConnectPoint outport) { | 90 | + private void sendIcmpResponse(Ethernet icmpRequest, ConnectPoint outport) { |
91 | 91 | ||
92 | Ethernet icmpReplyEth = new Ethernet(); | 92 | Ethernet icmpReplyEth = new Ethernet(); |
93 | 93 | ... | ... |
... | @@ -268,7 +268,7 @@ public class CordFabricManager implements FabricService { | ... | @@ -268,7 +268,7 @@ public class CordFabricManager implements FabricService { |
268 | removeVlan(vlan.vlan()); | 268 | removeVlan(vlan.vlan()); |
269 | 269 | ||
270 | if (vlan.iptv()) { | 270 | if (vlan.iptv()) { |
271 | - provisionIPTV(); | 271 | + provisionIpTv(); |
272 | } | 272 | } |
273 | 273 | ||
274 | vlan.ports().forEach(cp -> { | 274 | vlan.ports().forEach(cp -> { |
... | @@ -283,7 +283,7 @@ public class CordFabricManager implements FabricService { | ... | @@ -283,7 +283,7 @@ public class CordFabricManager implements FabricService { |
283 | } | 283 | } |
284 | 284 | ||
285 | //FIXME: pass iptv vlan in here. | 285 | //FIXME: pass iptv vlan in here. |
286 | - private void provisionIPTV() { | 286 | + private void provisionIpTv() { |
287 | TrafficSelector ipTvUp = DefaultTrafficSelector.builder() | 287 | TrafficSelector ipTvUp = DefaultTrafficSelector.builder() |
288 | .matchVlanId(VlanId.vlanId((short) 7)) | 288 | .matchVlanId(VlanId.vlanId((short) 7)) |
289 | .matchInPort(PortNumber.portNumber(2)) | 289 | .matchInPort(PortNumber.portNumber(2)) | ... | ... |
... | @@ -15,15 +15,12 @@ | ... | @@ -15,15 +15,12 @@ |
15 | */ | 15 | */ |
16 | package org.onosproject.optical.testapp; | 16 | package org.onosproject.optical.testapp; |
17 | 17 | ||
18 | -import static org.slf4j.LoggerFactory.getLogger; | ||
19 | - | ||
20 | -import java.util.HashMap; | ||
21 | -import java.util.Map; | ||
22 | - | ||
23 | import org.apache.felix.scr.annotations.Activate; | 18 | import org.apache.felix.scr.annotations.Activate; |
24 | import org.apache.felix.scr.annotations.Deactivate; | 19 | import org.apache.felix.scr.annotations.Deactivate; |
25 | import org.apache.felix.scr.annotations.Reference; | 20 | import org.apache.felix.scr.annotations.Reference; |
26 | import org.apache.felix.scr.annotations.ReferenceCardinality; | 21 | import org.apache.felix.scr.annotations.ReferenceCardinality; |
22 | +import org.onlab.packet.Ethernet; | ||
23 | +import org.onlab.packet.MplsLabel; | ||
27 | import org.onosproject.core.ApplicationId; | 24 | import org.onosproject.core.ApplicationId; |
28 | import org.onosproject.core.CoreService; | 25 | import org.onosproject.core.CoreService; |
29 | import org.onosproject.net.Device; | 26 | import org.onosproject.net.Device; |
... | @@ -39,15 +36,18 @@ import org.onosproject.net.flow.FlowRule; | ... | @@ -39,15 +36,18 @@ import org.onosproject.net.flow.FlowRule; |
39 | import org.onosproject.net.flow.FlowRuleService; | 36 | import org.onosproject.net.flow.FlowRuleService; |
40 | import org.onosproject.net.flow.TrafficSelector; | 37 | import org.onosproject.net.flow.TrafficSelector; |
41 | import org.onosproject.net.flow.TrafficTreatment; | 38 | import org.onosproject.net.flow.TrafficTreatment; |
42 | -import org.onlab.packet.Ethernet; | ||
43 | -import org.onlab.packet.MplsLabel; | ||
44 | import org.slf4j.Logger; | 39 | import org.slf4j.Logger; |
45 | 40 | ||
41 | +import java.util.HashMap; | ||
42 | +import java.util.Map; | ||
43 | + | ||
44 | +import static org.slf4j.LoggerFactory.getLogger; | ||
45 | + | ||
46 | /** | 46 | /** |
47 | * Sample reactive forwarding application. | 47 | * Sample reactive forwarding application. |
48 | */ | 48 | */ |
49 | //@Component(immediate = true) | 49 | //@Component(immediate = true) |
50 | -public class MPLSForwarding { | 50 | +public class MplsForwarding { |
51 | 51 | ||
52 | private final Logger log = getLogger(getClass()); | 52 | private final Logger log = getLogger(getClass()); |
53 | 53 | ... | ... |
... | @@ -22,7 +22,7 @@ import java.util.Optional; | ... | @@ -22,7 +22,7 @@ import java.util.Optional; |
22 | /** | 22 | /** |
23 | * Simple demo api interface. | 23 | * Simple demo api interface. |
24 | */ | 24 | */ |
25 | -public interface DemoAPI { | 25 | +public interface DemoApi { |
26 | 26 | ||
27 | enum InstallType { MESH, RANDOM } | 27 | enum InstallType { MESH, RANDOM } |
28 | 28 | ... | ... |
... | @@ -87,7 +87,7 @@ import static org.slf4j.LoggerFactory.getLogger; | ... | @@ -87,7 +87,7 @@ import static org.slf4j.LoggerFactory.getLogger; |
87 | */ | 87 | */ |
88 | @Component(immediate = true) | 88 | @Component(immediate = true) |
89 | @Service | 89 | @Service |
90 | -public class DemoInstaller implements DemoAPI { | 90 | +public class DemoInstaller implements DemoApi { |
91 | 91 | ||
92 | private final Logger log = getLogger(getClass()); | 92 | private final Logger log = getLogger(getClass()); |
93 | 93 | ... | ... |
... | @@ -51,7 +51,7 @@ public class DemoResource extends BaseResource { | ... | @@ -51,7 +51,7 @@ public class DemoResource extends BaseResource { |
51 | public Response flowTest(InputStream input) throws IOException { | 51 | public Response flowTest(InputStream input) throws IOException { |
52 | ObjectMapper mapper = new ObjectMapper(); | 52 | ObjectMapper mapper = new ObjectMapper(); |
53 | JsonNode cfg = mapper.readTree(input); | 53 | JsonNode cfg = mapper.readTree(input); |
54 | - DemoAPI demo = get(DemoAPI.class); | 54 | + DemoApi demo = get(DemoApi.class); |
55 | return Response.ok(demo.flowTest(Optional.ofNullable(cfg)).toString()).build(); | 55 | return Response.ok(demo.flowTest(Optional.ofNullable(cfg)).toString()).build(); |
56 | } | 56 | } |
57 | 57 | ||
... | @@ -75,9 +75,9 @@ public class DemoResource extends BaseResource { | ... | @@ -75,9 +75,9 @@ public class DemoResource extends BaseResource { |
75 | } | 75 | } |
76 | 76 | ||
77 | 77 | ||
78 | - DemoAPI.InstallType type = DemoAPI.InstallType.valueOf( | 78 | + DemoApi.InstallType type = DemoApi.InstallType.valueOf( |
79 | cfg.get("type").asText().toUpperCase()); | 79 | cfg.get("type").asText().toUpperCase()); |
80 | - DemoAPI demo = get(DemoAPI.class); | 80 | + DemoApi demo = get(DemoApi.class); |
81 | demo.setup(type, Optional.ofNullable(cfg.get("runParams"))); | 81 | demo.setup(type, Optional.ofNullable(cfg.get("runParams"))); |
82 | 82 | ||
83 | return Response.ok(mapper.createObjectNode().toString()).build(); | 83 | return Response.ok(mapper.createObjectNode().toString()).build(); |
... | @@ -93,7 +93,7 @@ public class DemoResource extends BaseResource { | ... | @@ -93,7 +93,7 @@ public class DemoResource extends BaseResource { |
93 | @Produces(MediaType.APPLICATION_JSON) | 93 | @Produces(MediaType.APPLICATION_JSON) |
94 | public Response tearDown() { | 94 | public Response tearDown() { |
95 | ObjectMapper mapper = new ObjectMapper(); | 95 | ObjectMapper mapper = new ObjectMapper(); |
96 | - DemoAPI demo = get(DemoAPI.class); | 96 | + DemoApi demo = get(DemoApi.class); |
97 | demo.tearDown(); | 97 | demo.tearDown(); |
98 | return Response.ok(mapper.createObjectNode().toString()).build(); | 98 | return Response.ok(mapper.createObjectNode().toString()).build(); |
99 | } | 99 | } | ... | ... |
... | @@ -15,12 +15,6 @@ | ... | @@ -15,12 +15,6 @@ |
15 | */ | 15 | */ |
16 | package org.onosproject.cli.net; | 16 | package org.onosproject.cli.net; |
17 | 17 | ||
18 | -import static com.google.common.base.Strings.isNullOrEmpty; | ||
19 | -import static org.onosproject.net.flow.DefaultTrafficTreatment.builder; | ||
20 | - | ||
21 | -import java.util.LinkedList; | ||
22 | -import java.util.List; | ||
23 | - | ||
24 | import org.apache.karaf.shell.commands.Option; | 18 | import org.apache.karaf.shell.commands.Option; |
25 | import org.onlab.packet.Ip6Address; | 19 | import org.onlab.packet.Ip6Address; |
26 | import org.onlab.packet.IpAddress; | 20 | import org.onlab.packet.IpAddress; |
... | @@ -47,6 +41,12 @@ import org.onosproject.net.intent.constraint.LinkTypeConstraint; | ... | @@ -47,6 +41,12 @@ import org.onosproject.net.intent.constraint.LinkTypeConstraint; |
47 | import org.onosproject.net.intent.constraint.PartialFailureConstraint; | 41 | import org.onosproject.net.intent.constraint.PartialFailureConstraint; |
48 | import org.onosproject.net.resource.link.BandwidthResource; | 42 | import org.onosproject.net.resource.link.BandwidthResource; |
49 | 43 | ||
44 | +import java.util.LinkedList; | ||
45 | +import java.util.List; | ||
46 | + | ||
47 | +import static com.google.common.base.Strings.isNullOrEmpty; | ||
48 | +import static org.onosproject.net.flow.DefaultTrafficTreatment.builder; | ||
49 | + | ||
50 | /** | 50 | /** |
51 | * Base class for command line operations for connectivity based intents. | 51 | * Base class for command line operations for connectivity based intents. |
52 | */ | 52 | */ |
... | @@ -99,11 +99,11 @@ public abstract class ConnectivityIntentCommand extends AbstractShellCommand { | ... | @@ -99,11 +99,11 @@ public abstract class ConnectivityIntentCommand extends AbstractShellCommand { |
99 | 99 | ||
100 | @Option(name = "--ndSLL", description = "IPv6 Neighbor Discovery Source Link-Layer", | 100 | @Option(name = "--ndSLL", description = "IPv6 Neighbor Discovery Source Link-Layer", |
101 | required = false, multiValued = false) | 101 | required = false, multiValued = false) |
102 | - private String ndSLLString = null; | 102 | + private String ndSllString = null; |
103 | 103 | ||
104 | @Option(name = "--ndTLL", description = "IPv6 Neighbor Discovery Target Link-Layer", | 104 | @Option(name = "--ndTLL", description = "IPv6 Neighbor Discovery Target Link-Layer", |
105 | required = false, multiValued = false) | 105 | required = false, multiValued = false) |
106 | - private String ndTLLString = null; | 106 | + private String ndTllString = null; |
107 | 107 | ||
108 | @Option(name = "--tcpSrc", description = "Source TCP Port", | 108 | @Option(name = "--tcpSrc", description = "Source TCP Port", |
109 | required = false, multiValued = false) | 109 | required = false, multiValued = false) |
... | @@ -264,12 +264,12 @@ public abstract class ConnectivityIntentCommand extends AbstractShellCommand { | ... | @@ -264,12 +264,12 @@ public abstract class ConnectivityIntentCommand extends AbstractShellCommand { |
264 | selectorBuilder.matchIPv6NDTargetAddress(Ip6Address.valueOf(ndTargetString)); | 264 | selectorBuilder.matchIPv6NDTargetAddress(Ip6Address.valueOf(ndTargetString)); |
265 | } | 265 | } |
266 | 266 | ||
267 | - if (!isNullOrEmpty(ndSLLString)) { | 267 | + if (!isNullOrEmpty(ndSllString)) { |
268 | - selectorBuilder.matchIPv6NDSourceLinkLayerAddress(MacAddress.valueOf(ndSLLString)); | 268 | + selectorBuilder.matchIPv6NDSourceLinkLayerAddress(MacAddress.valueOf(ndSllString)); |
269 | } | 269 | } |
270 | 270 | ||
271 | - if (!isNullOrEmpty(ndTLLString)) { | 271 | + if (!isNullOrEmpty(ndTllString)) { |
272 | - selectorBuilder.matchIPv6NDTargetLinkLayerAddress(MacAddress.valueOf(ndTLLString)); | 272 | + selectorBuilder.matchIPv6NDTargetLinkLayerAddress(MacAddress.valueOf(ndTllString)); |
273 | } | 273 | } |
274 | 274 | ||
275 | if (!isNullOrEmpty(srcTcpString)) { | 275 | if (!isNullOrEmpty(srcTcpString)) { | ... | ... |
... | @@ -82,15 +82,15 @@ public class GetFlowStatistics extends AbstractShellCommand { | ... | @@ -82,15 +82,15 @@ public class GetFlowStatistics extends AbstractShellCommand { |
82 | DeviceService deviceService = get(DeviceService.class); | 82 | DeviceService deviceService = get(DeviceService.class); |
83 | FlowStatisticService flowStatsService = get(FlowStatisticService.class); | 83 | FlowStatisticService flowStatsService = get(FlowStatisticService.class); |
84 | 84 | ||
85 | - String deviceURI = getDeviceId(devicePort); | 85 | + String deviceUri = getDeviceId(devicePort); |
86 | - String portURI = getPortNumber(devicePort); | 86 | + String portUri = getPortNumber(devicePort); |
87 | 87 | ||
88 | - DeviceId ingressDeviceId = deviceId(deviceURI); | 88 | + DeviceId ingressDeviceId = deviceId(deviceUri); |
89 | PortNumber ingressPortNumber; | 89 | PortNumber ingressPortNumber; |
90 | - if (portURI.length() == 0) { | 90 | + if (portUri.length() == 0) { |
91 | ingressPortNumber = null; | 91 | ingressPortNumber = null; |
92 | } else { | 92 | } else { |
93 | - ingressPortNumber = portNumber(portURI); | 93 | + ingressPortNumber = portNumber(portUri); |
94 | } | 94 | } |
95 | 95 | ||
96 | Device device = deviceService.getDevice(ingressDeviceId); | 96 | Device device = deviceService.getDevice(ingressDeviceId); |
... | @@ -102,7 +102,7 @@ public class GetFlowStatistics extends AbstractShellCommand { | ... | @@ -102,7 +102,7 @@ public class GetFlowStatistics extends AbstractShellCommand { |
102 | if (ingressPortNumber != null) { | 102 | if (ingressPortNumber != null) { |
103 | Port port = deviceService.getPort(ingressDeviceId, ingressPortNumber); | 103 | Port port = deviceService.getPort(ingressDeviceId, ingressPortNumber); |
104 | if (port == null) { | 104 | if (port == null) { |
105 | - error("No such port %s on device %s", portURI, ingressDeviceId.uri()); | 105 | + error("No such port %s on device %s", portUri, ingressDeviceId.uri()); |
106 | return; | 106 | return; |
107 | } | 107 | } |
108 | } | 108 | } |
... | @@ -148,7 +148,7 @@ public class GetFlowStatistics extends AbstractShellCommand { | ... | @@ -148,7 +148,7 @@ public class GetFlowStatistics extends AbstractShellCommand { |
148 | 148 | ||
149 | // print show topn head line with type | 149 | // print show topn head line with type |
150 | print("deviceId=%s, show TOPN=%s flows, live type=%s, instruction type=%s", | 150 | print("deviceId=%s, show TOPN=%s flows, live type=%s, instruction type=%s", |
151 | - deviceURI, | 151 | + deviceUri, |
152 | Integer.toString(topn), | 152 | Integer.toString(topn), |
153 | flowLiveType == null ? "ALL" : flowLiveType, | 153 | flowLiveType == null ? "ALL" : flowLiveType, |
154 | instructionType == null ? "ALL" : instructionType); | 154 | instructionType == null ? "ALL" : instructionType); |
... | @@ -169,7 +169,7 @@ public class GetFlowStatistics extends AbstractShellCommand { | ... | @@ -169,7 +169,7 @@ public class GetFlowStatistics extends AbstractShellCommand { |
169 | } else if (showAll) { // is true? | 169 | } else if (showAll) { // is true? |
170 | // print show all head line with type | 170 | // print show all head line with type |
171 | print("deviceId=%s, show ALL flows, live type=%s, instruction type=%s", | 171 | print("deviceId=%s, show ALL flows, live type=%s, instruction type=%s", |
172 | - deviceURI, | 172 | + deviceUri, |
173 | flowLiveType == null ? "ALL" : flowLiveType, | 173 | flowLiveType == null ? "ALL" : flowLiveType, |
174 | instructionType == null ? "ALL" : instructionType); | 174 | instructionType == null ? "ALL" : instructionType); |
175 | if (ingressPortNumber == null) { | 175 | if (ingressPortNumber == null) { |
... | @@ -188,7 +188,7 @@ public class GetFlowStatistics extends AbstractShellCommand { | ... | @@ -188,7 +188,7 @@ public class GetFlowStatistics extends AbstractShellCommand { |
188 | } | 188 | } |
189 | } else { // if (showSummary == true) //always is true | 189 | } else { // if (showSummary == true) //always is true |
190 | // print show summary head line | 190 | // print show summary head line |
191 | - print("deviceId=%s, show SUMMARY flows", deviceURI); | 191 | + print("deviceId=%s, show SUMMARY flows", deviceUri); |
192 | if (ingressPortNumber == null) { | 192 | if (ingressPortNumber == null) { |
193 | Map<ConnectPoint, SummaryFlowEntryWithLoad> summaryFlowLoadMap = | 193 | Map<ConnectPoint, SummaryFlowEntryWithLoad> summaryFlowLoadMap = |
194 | flowStatsService.loadSummary(device); | 194 | flowStatsService.loadSummary(device); | ... | ... |
... | @@ -15,24 +15,23 @@ | ... | @@ -15,24 +15,23 @@ |
15 | */ | 15 | */ |
16 | package org.onosproject.cli.net; | 16 | package org.onosproject.cli.net; |
17 | 17 | ||
18 | -import java.util.Set; | 18 | +import com.google.common.collect.Lists; |
19 | -import java.util.List; | ||
20 | - | ||
21 | import org.apache.karaf.shell.commands.Argument; | 19 | import org.apache.karaf.shell.commands.Argument; |
22 | import org.apache.karaf.shell.commands.Command; | 20 | import org.apache.karaf.shell.commands.Command; |
23 | import org.apache.karaf.shell.commands.Option; | 21 | import org.apache.karaf.shell.commands.Option; |
24 | import org.onosproject.cli.AbstractShellCommand; | 22 | import org.onosproject.cli.AbstractShellCommand; |
23 | +import org.onosproject.net.DeviceId; | ||
24 | +import org.onosproject.net.Link; | ||
25 | +import org.onosproject.net.Path; | ||
25 | import org.onosproject.net.intent.IntentId; | 26 | import org.onosproject.net.intent.IntentId; |
26 | import org.onosproject.net.resource.link.DefaultLinkResourceRequest; | 27 | import org.onosproject.net.resource.link.DefaultLinkResourceRequest; |
27 | import org.onosproject.net.resource.link.LinkResourceAllocations; | 28 | import org.onosproject.net.resource.link.LinkResourceAllocations; |
28 | import org.onosproject.net.resource.link.LinkResourceRequest; | 29 | import org.onosproject.net.resource.link.LinkResourceRequest; |
29 | import org.onosproject.net.resource.link.LinkResourceService; | 30 | import org.onosproject.net.resource.link.LinkResourceService; |
30 | import org.onosproject.net.topology.PathService; | 31 | import org.onosproject.net.topology.PathService; |
31 | -import org.onosproject.net.DeviceId; | ||
32 | -import org.onosproject.net.Link; | ||
33 | -import org.onosproject.net.Path; | ||
34 | 32 | ||
35 | -import com.google.common.collect.Lists; | 33 | +import java.util.List; |
34 | +import java.util.Set; | ||
36 | 35 | ||
37 | /** | 36 | /** |
38 | * Commands to test out LinkResourceManager directly. | 37 | * Commands to test out LinkResourceManager directly. |
... | @@ -44,7 +43,7 @@ public class LinkResourceTestCommand extends AbstractShellCommand { | ... | @@ -44,7 +43,7 @@ public class LinkResourceTestCommand extends AbstractShellCommand { |
44 | // default is bandwidth. | 43 | // default is bandwidth. |
45 | @Option(name = "-m", aliases = "--mpls", description = "MPLS resource", | 44 | @Option(name = "-m", aliases = "--mpls", description = "MPLS resource", |
46 | required = false, multiValued = false) | 45 | required = false, multiValued = false) |
47 | - private boolean isMPLS = false; | 46 | + private boolean isMpls = false; |
48 | 47 | ||
49 | @Option(name = "-o", aliases = "--optical", description = "Optical resource", | 48 | @Option(name = "-o", aliases = "--optical", description = "Optical resource", |
50 | required = false, multiValued = false) | 49 | required = false, multiValued = false) |
... | @@ -96,7 +95,7 @@ public class LinkResourceTestCommand extends AbstractShellCommand { | ... | @@ -96,7 +95,7 @@ public class LinkResourceTestCommand extends AbstractShellCommand { |
96 | for (Path p : paths) { | 95 | for (Path p : paths) { |
97 | List<Link> links = p.links(); | 96 | List<Link> links = p.links(); |
98 | LinkResourceRequest.Builder request = null; | 97 | LinkResourceRequest.Builder request = null; |
99 | - if (isMPLS) { | 98 | + if (isMpls) { |
100 | List<Link> nlinks = Lists.newArrayList(); | 99 | List<Link> nlinks = Lists.newArrayList(); |
101 | try { | 100 | try { |
102 | nlinks.addAll(links.subList(1, links.size() - 2)); | 101 | nlinks.addAll(links.subList(1, links.size() - 2)); | ... | ... |
... | @@ -71,7 +71,7 @@ public class DefaultDeviceDescription extends AbstractDescription | ... | @@ -71,7 +71,7 @@ public class DefaultDeviceDescription extends AbstractDescription |
71 | */ | 71 | */ |
72 | public DefaultDeviceDescription(DeviceDescription base, | 72 | public DefaultDeviceDescription(DeviceDescription base, |
73 | SparseAnnotations... annotations) { | 73 | SparseAnnotations... annotations) { |
74 | - this(base.deviceURI(), base.type(), base.manufacturer(), | 74 | + this(base.deviceUri(), base.type(), base.manufacturer(), |
75 | base.hwVersion(), base.swVersion(), base.serialNumber(), | 75 | base.hwVersion(), base.swVersion(), base.serialNumber(), |
76 | base.chassisId(), annotations); | 76 | base.chassisId(), annotations); |
77 | } | 77 | } |
... | @@ -83,13 +83,13 @@ public class DefaultDeviceDescription extends AbstractDescription | ... | @@ -83,13 +83,13 @@ public class DefaultDeviceDescription extends AbstractDescription |
83 | * @param annotations Annotations to use. | 83 | * @param annotations Annotations to use. |
84 | */ | 84 | */ |
85 | public DefaultDeviceDescription(DeviceDescription base, Type type, SparseAnnotations... annotations) { | 85 | public DefaultDeviceDescription(DeviceDescription base, Type type, SparseAnnotations... annotations) { |
86 | - this(base.deviceURI(), type, base.manufacturer(), | 86 | + this(base.deviceUri(), type, base.manufacturer(), |
87 | base.hwVersion(), base.swVersion(), base.serialNumber(), | 87 | base.hwVersion(), base.swVersion(), base.serialNumber(), |
88 | base.chassisId(), annotations); | 88 | base.chassisId(), annotations); |
89 | } | 89 | } |
90 | 90 | ||
91 | @Override | 91 | @Override |
92 | - public URI deviceURI() { | 92 | + public URI deviceUri() { |
93 | return uri; | 93 | return uri; |
94 | } | 94 | } |
95 | 95 | ... | ... |
... | @@ -33,7 +33,7 @@ public interface DeviceDescription extends Description { | ... | @@ -33,7 +33,7 @@ public interface DeviceDescription extends Description { |
33 | * | 33 | * |
34 | * @return provider specific URI for the device | 34 | * @return provider specific URI for the device |
35 | */ | 35 | */ |
36 | - URI deviceURI(); | 36 | + URI deviceUri(); |
37 | 37 | ||
38 | /** | 38 | /** |
39 | * Returns the type of the infrastructure device. | 39 | * Returns the type of the infrastructure device. | ... | ... |
... | @@ -41,7 +41,7 @@ public class DefaultDeviceDescriptionTest { | ... | @@ -41,7 +41,7 @@ public class DefaultDeviceDescriptionTest { |
41 | public void basics() { | 41 | public void basics() { |
42 | DeviceDescription device = | 42 | DeviceDescription device = |
43 | new DefaultDeviceDescription(DURI, SWITCH, MFR, HW, SW, SN, CID); | 43 | new DefaultDeviceDescription(DURI, SWITCH, MFR, HW, SW, SN, CID); |
44 | - assertEquals("incorrect uri", DURI, device.deviceURI()); | 44 | + assertEquals("incorrect uri", DURI, device.deviceUri()); |
45 | assertEquals("incorrect type", SWITCH, device.type()); | 45 | assertEquals("incorrect type", SWITCH, device.type()); |
46 | assertEquals("incorrect manufacturer", MFR, device.manufacturer()); | 46 | assertEquals("incorrect manufacturer", MFR, device.manufacturer()); |
47 | assertEquals("incorrect hw", HW, device.hwVersion()); | 47 | assertEquals("incorrect hw", HW, device.hwVersion()); | ... | ... |
... | @@ -57,7 +57,7 @@ public class XmlDriverLoaderTest { | ... | @@ -57,7 +57,7 @@ public class XmlDriverLoaderTest { |
57 | } | 57 | } |
58 | 58 | ||
59 | @Test(expected = IOException.class) | 59 | @Test(expected = IOException.class) |
60 | - public void badXML() throws IOException { | 60 | + public void badXml() throws IOException { |
61 | XmlDriverLoader loader = new XmlDriverLoader(getClass().getClassLoader()); | 61 | XmlDriverLoader loader = new XmlDriverLoader(getClass().getClassLoader()); |
62 | loader.loadDrivers(getClass().getResourceAsStream("drivers.bad.xml"), null); | 62 | loader.loadDrivers(getClass().getResourceAsStream("drivers.bad.xml"), null); |
63 | } | 63 | } |
... | @@ -77,4 +77,4 @@ public class XmlDriverLoaderTest { | ... | @@ -77,4 +77,4 @@ public class XmlDriverLoaderTest { |
77 | driver.createBehaviour(new DefaultDriverData(driver, DEVICE_ID), TestBehaviour.class); | 77 | driver.createBehaviour(new DefaultDriverData(driver, DEVICE_ID), TestBehaviour.class); |
78 | } | 78 | } |
79 | 79 | ||
80 | -} | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
80 | +} | ... | ... |
... | @@ -115,19 +115,19 @@ public class DefaultCellComparatorTest { | ... | @@ -115,19 +115,19 @@ public class DefaultCellComparatorTest { |
115 | } | 115 | } |
116 | 116 | ||
117 | @Test | 117 | @Test |
118 | - public void swEpisodeII() { | 118 | + public void swEpisodeIi() { |
119 | assertTrue("r2d2 c3po", | 119 | assertTrue("r2d2 c3po", |
120 | cmp.compare(SmallStarWars.R2D2, SmallStarWars.C3PO) > 0); | 120 | cmp.compare(SmallStarWars.R2D2, SmallStarWars.C3PO) > 0); |
121 | } | 121 | } |
122 | 122 | ||
123 | @Test | 123 | @Test |
124 | - public void swEpisodeIII() { | 124 | + public void swEpisodeIii() { |
125 | assertTrue("luke c3po", | 125 | assertTrue("luke c3po", |
126 | cmp.compare(SmallStarWars.LUKE, SmallStarWars.C3PO) > 0); | 126 | cmp.compare(SmallStarWars.LUKE, SmallStarWars.C3PO) > 0); |
127 | } | 127 | } |
128 | 128 | ||
129 | @Test | 129 | @Test |
130 | - public void swEpisodeIV() { | 130 | + public void swEpisodeIv() { |
131 | assertTrue("c3po luke", | 131 | assertTrue("c3po luke", |
132 | cmp.compare(SmallStarWars.C3PO, SmallStarWars.LUKE) < 0); | 132 | cmp.compare(SmallStarWars.C3PO, SmallStarWars.LUKE) < 0); |
133 | } | 133 | } |
... | @@ -139,7 +139,7 @@ public class DefaultCellComparatorTest { | ... | @@ -139,7 +139,7 @@ public class DefaultCellComparatorTest { |
139 | } | 139 | } |
140 | 140 | ||
141 | @Test | 141 | @Test |
142 | - public void swEpisodeVI() { | 142 | + public void swEpisodeVi() { |
143 | assertTrue("r2d2 luke", | 143 | assertTrue("r2d2 luke", |
144 | cmp.compare(SmallStarWars.R2D2, SmallStarWars.LUKE) < 0); | 144 | cmp.compare(SmallStarWars.R2D2, SmallStarWars.LUKE) < 0); |
145 | } | 145 | } | ... | ... |
... | @@ -26,10 +26,10 @@ import org.onlab.graph.DijkstraGraphSearch; | ... | @@ -26,10 +26,10 @@ import org.onlab.graph.DijkstraGraphSearch; |
26 | import org.onlab.graph.DisjointPathPair; | 26 | import org.onlab.graph.DisjointPathPair; |
27 | import org.onlab.graph.GraphPathSearch; | 27 | import org.onlab.graph.GraphPathSearch; |
28 | import org.onlab.graph.GraphPathSearch.Result; | 28 | import org.onlab.graph.GraphPathSearch.Result; |
29 | -import org.onlab.graph.SRLGGraphSearch; | 29 | +import org.onlab.graph.SrlgGraphSearch; |
30 | import org.onlab.graph.SuurballeGraphSearch; | 30 | import org.onlab.graph.SuurballeGraphSearch; |
31 | import org.onlab.graph.TarjanGraphSearch; | 31 | import org.onlab.graph.TarjanGraphSearch; |
32 | -import org.onlab.graph.TarjanGraphSearch.SCCResult; | 32 | +import org.onlab.graph.TarjanGraphSearch.SccResult; |
33 | import org.onosproject.net.AbstractModel; | 33 | import org.onosproject.net.AbstractModel; |
34 | import org.onosproject.net.ConnectPoint; | 34 | import org.onosproject.net.ConnectPoint; |
35 | import org.onosproject.net.DefaultDisjointPath; | 35 | import org.onosproject.net.DefaultDisjointPath; |
... | @@ -83,7 +83,7 @@ public class DefaultTopology extends AbstractModel implements Topology { | ... | @@ -83,7 +83,7 @@ public class DefaultTopology extends AbstractModel implements Topology { |
83 | private final TopologyGraph graph; | 83 | private final TopologyGraph graph; |
84 | 84 | ||
85 | private final LinkWeight weight; | 85 | private final LinkWeight weight; |
86 | - private final Supplier<SCCResult<TopologyVertex, TopologyEdge>> clusterResults; | 86 | + private final Supplier<SccResult<TopologyVertex, TopologyEdge>> clusterResults; |
87 | private final Supplier<ImmutableMap<ClusterId, TopologyCluster>> clusters; | 87 | private final Supplier<ImmutableMap<ClusterId, TopologyCluster>> clusters; |
88 | private final Supplier<ImmutableSet<ConnectPoint>> infrastructurePoints; | 88 | private final Supplier<ImmutableSet<ConnectPoint>> infrastructurePoints; |
89 | private final Supplier<ImmutableSetMultimap<ClusterId, ConnectPoint>> broadcastSets; | 89 | private final Supplier<ImmutableSetMultimap<ClusterId, ConnectPoint>> broadcastSets; |
... | @@ -385,7 +385,7 @@ public class DefaultTopology extends AbstractModel implements Topology { | ... | @@ -385,7 +385,7 @@ public class DefaultTopology extends AbstractModel implements Topology { |
385 | return ImmutableSet.of(); | 385 | return ImmutableSet.of(); |
386 | } | 386 | } |
387 | 387 | ||
388 | - SRLGGraphSearch<TopologyVertex, TopologyEdge> srlg = new SRLGGraphSearch<>(riskProfile); | 388 | + SrlgGraphSearch<TopologyVertex, TopologyEdge> srlg = new SrlgGraphSearch<>(riskProfile); |
389 | GraphPathSearch.Result<TopologyVertex, TopologyEdge> result = | 389 | GraphPathSearch.Result<TopologyVertex, TopologyEdge> result = |
390 | srlg.search(graph, srcV, dstV, weight, ALL_PATHS); | 390 | srlg.search(graph, srcV, dstV, weight, ALL_PATHS); |
391 | ImmutableSet.Builder<DisjointPath> builder = ImmutableSet.builder(); | 391 | ImmutableSet.Builder<DisjointPath> builder = ImmutableSet.builder(); |
... | @@ -455,14 +455,14 @@ public class DefaultTopology extends AbstractModel implements Topology { | ... | @@ -455,14 +455,14 @@ public class DefaultTopology extends AbstractModel implements Topology { |
455 | 455 | ||
456 | // Searches for SCC clusters in the network topology graph using Tarjan | 456 | // Searches for SCC clusters in the network topology graph using Tarjan |
457 | // algorithm. | 457 | // algorithm. |
458 | - private SCCResult<TopologyVertex, TopologyEdge> searchForClusters() { | 458 | + private SccResult<TopologyVertex, TopologyEdge> searchForClusters() { |
459 | return TARJAN.search(graph, new NoIndirectLinksWeight()); | 459 | return TARJAN.search(graph, new NoIndirectLinksWeight()); |
460 | } | 460 | } |
461 | 461 | ||
462 | // Builds the topology clusters and returns the id-cluster bindings. | 462 | // Builds the topology clusters and returns the id-cluster bindings. |
463 | private ImmutableMap<ClusterId, TopologyCluster> buildTopologyClusters() { | 463 | private ImmutableMap<ClusterId, TopologyCluster> buildTopologyClusters() { |
464 | ImmutableMap.Builder<ClusterId, TopologyCluster> clusterBuilder = ImmutableMap.builder(); | 464 | ImmutableMap.Builder<ClusterId, TopologyCluster> clusterBuilder = ImmutableMap.builder(); |
465 | - SCCResult<TopologyVertex, TopologyEdge> results = clusterResults.get(); | 465 | + SccResult<TopologyVertex, TopologyEdge> results = clusterResults.get(); |
466 | 466 | ||
467 | // Extract both vertexes and edges from the results; the lists form | 467 | // Extract both vertexes and edges from the results; the lists form |
468 | // pairs along the same index. | 468 | // pairs along the same index. | ... | ... |
... | @@ -532,7 +532,7 @@ public class SimpleDeviceStore | ... | @@ -532,7 +532,7 @@ public class SimpleDeviceStore |
532 | 532 | ||
533 | checkArgument(!providerDescs.isEmpty(), "No Device descriptions supplied"); | 533 | checkArgument(!providerDescs.isEmpty(), "No Device descriptions supplied"); |
534 | 534 | ||
535 | - ProviderId primary = pickPrimaryPID(providerDescs); | 535 | + ProviderId primary = pickPrimaryPid(providerDescs); |
536 | 536 | ||
537 | DeviceDescriptions desc = providerDescs.get(primary); | 537 | DeviceDescriptions desc = providerDescs.get(primary); |
538 | 538 | ||
... | @@ -575,7 +575,7 @@ public class SimpleDeviceStore | ... | @@ -575,7 +575,7 @@ public class SimpleDeviceStore |
575 | private Port composePort(Device device, PortNumber number, | 575 | private Port composePort(Device device, PortNumber number, |
576 | Map<ProviderId, DeviceDescriptions> descsMap) { | 576 | Map<ProviderId, DeviceDescriptions> descsMap) { |
577 | 577 | ||
578 | - ProviderId primary = pickPrimaryPID(descsMap); | 578 | + ProviderId primary = pickPrimaryPid(descsMap); |
579 | DeviceDescriptions primDescs = descsMap.get(primary); | 579 | DeviceDescriptions primDescs = descsMap.get(primary); |
580 | // if no primary, assume not enabled | 580 | // if no primary, assume not enabled |
581 | // TODO: revisit this default port enabled/disabled behavior | 581 | // TODO: revisit this default port enabled/disabled behavior |
... | @@ -613,7 +613,7 @@ public class SimpleDeviceStore | ... | @@ -613,7 +613,7 @@ public class SimpleDeviceStore |
613 | /** | 613 | /** |
614 | * @return primary ProviderID, or randomly chosen one if none exists | 614 | * @return primary ProviderID, or randomly chosen one if none exists |
615 | */ | 615 | */ |
616 | - private ProviderId pickPrimaryPID(Map<ProviderId, DeviceDescriptions> descsMap) { | 616 | + private ProviderId pickPrimaryPid(Map<ProviderId, DeviceDescriptions> descsMap) { |
617 | ProviderId fallBackPrimary = null; | 617 | ProviderId fallBackPrimary = null; |
618 | for (Entry<ProviderId, DeviceDescriptions> e : descsMap.entrySet()) { | 618 | for (Entry<ProviderId, DeviceDescriptions> e : descsMap.entrySet()) { |
619 | if (!e.getKey().isAncillary()) { | 619 | if (!e.getKey().isAncillary()) { | ... | ... |
... | @@ -61,7 +61,7 @@ public final class BasicDeviceOperator implements ConfigOperator { | ... | @@ -61,7 +61,7 @@ public final class BasicDeviceOperator implements ConfigOperator { |
61 | } | 61 | } |
62 | 62 | ||
63 | SparseAnnotations sa = combine(bdc, descr.annotations()); | 63 | SparseAnnotations sa = combine(bdc, descr.annotations()); |
64 | - return new DefaultDeviceDescription(descr.deviceURI(), type, descr.manufacturer(), | 64 | + return new DefaultDeviceDescription(descr.deviceUri(), type, descr.manufacturer(), |
65 | descr.hwVersion(), descr.swVersion(), | 65 | descr.hwVersion(), descr.swVersion(), |
66 | descr.serialNumber(), descr.chassisId(), sa); | 66 | descr.serialNumber(), descr.chassisId(), sa); |
67 | } | 67 | } | ... | ... |
... | @@ -255,7 +255,7 @@ public class FlowStatisticManager implements FlowStatisticService { | ... | @@ -255,7 +255,7 @@ public class FlowStatisticManager implements FlowStatisticService { |
255 | Instruction.Type instType) { | 255 | Instruction.Type instType) { |
256 | checkPermission(STATISTIC_READ); | 256 | checkPermission(STATISTIC_READ); |
257 | 257 | ||
258 | - List<TypedFlowEntryWithLoad> retTFEL = new ArrayList<>(); | 258 | + List<TypedFlowEntryWithLoad> retTfel = new ArrayList<>(); |
259 | 259 | ||
260 | Set<FlowEntry> currentStats; | 260 | Set<FlowEntry> currentStats; |
261 | Set<FlowEntry> previousStats; | 261 | Set<FlowEntry> previousStats; |
... | @@ -264,11 +264,11 @@ public class FlowStatisticManager implements FlowStatisticService { | ... | @@ -264,11 +264,11 @@ public class FlowStatisticManager implements FlowStatisticService { |
264 | synchronized (flowStatisticStore) { | 264 | synchronized (flowStatisticStore) { |
265 | currentStats = flowStatisticStore.getCurrentFlowStatistic(cp); | 265 | currentStats = flowStatisticStore.getCurrentFlowStatistic(cp); |
266 | if (currentStats == null) { | 266 | if (currentStats == null) { |
267 | - return retTFEL; | 267 | + return retTfel; |
268 | } | 268 | } |
269 | previousStats = flowStatisticStore.getPreviousFlowStatistic(cp); | 269 | previousStats = flowStatisticStore.getPreviousFlowStatistic(cp); |
270 | if (previousStats == null) { | 270 | if (previousStats == null) { |
271 | - return retTFEL; | 271 | + return retTfel; |
272 | } | 272 | } |
273 | // copy to local flow entry set | 273 | // copy to local flow entry set |
274 | typedStatistics = new TypedStatistics(currentStats, previousStats); | 274 | typedStatistics = new TypedStatistics(currentStats, previousStats); |
... | @@ -291,7 +291,7 @@ public class FlowStatisticManager implements FlowStatisticService { | ... | @@ -291,7 +291,7 @@ public class FlowStatisticManager implements FlowStatisticService { |
291 | List<TypedFlowEntryWithLoad> fel = typedFlowEntryLoadByInstInternal(cp, currentMap, previousMap, | 291 | List<TypedFlowEntryWithLoad> fel = typedFlowEntryLoadByInstInternal(cp, currentMap, previousMap, |
292 | isAllInstType, instType, TypedFlowEntryWithLoad.shortPollInterval()); | 292 | isAllInstType, instType, TypedFlowEntryWithLoad.shortPollInterval()); |
293 | if (fel.size() > 0) { | 293 | if (fel.size() > 0) { |
294 | - retTFEL.addAll(fel); | 294 | + retTfel.addAll(fel); |
295 | } | 295 | } |
296 | } | 296 | } |
297 | 297 | ||
... | @@ -302,7 +302,7 @@ public class FlowStatisticManager implements FlowStatisticService { | ... | @@ -302,7 +302,7 @@ public class FlowStatisticManager implements FlowStatisticService { |
302 | List<TypedFlowEntryWithLoad> fel = typedFlowEntryLoadByInstInternal(cp, currentMap, previousMap, | 302 | List<TypedFlowEntryWithLoad> fel = typedFlowEntryLoadByInstInternal(cp, currentMap, previousMap, |
303 | isAllInstType, instType, TypedFlowEntryWithLoad.shortPollInterval()); | 303 | isAllInstType, instType, TypedFlowEntryWithLoad.shortPollInterval()); |
304 | if (fel.size() > 0) { | 304 | if (fel.size() > 0) { |
305 | - retTFEL.addAll(fel); | 305 | + retTfel.addAll(fel); |
306 | } | 306 | } |
307 | } | 307 | } |
308 | 308 | ||
... | @@ -313,7 +313,7 @@ public class FlowStatisticManager implements FlowStatisticService { | ... | @@ -313,7 +313,7 @@ public class FlowStatisticManager implements FlowStatisticService { |
313 | List<TypedFlowEntryWithLoad> fel = typedFlowEntryLoadByInstInternal(cp, currentMap, previousMap, | 313 | List<TypedFlowEntryWithLoad> fel = typedFlowEntryLoadByInstInternal(cp, currentMap, previousMap, |
314 | isAllInstType, instType, TypedFlowEntryWithLoad.midPollInterval()); | 314 | isAllInstType, instType, TypedFlowEntryWithLoad.midPollInterval()); |
315 | if (fel.size() > 0) { | 315 | if (fel.size() > 0) { |
316 | - retTFEL.addAll(fel); | 316 | + retTfel.addAll(fel); |
317 | } | 317 | } |
318 | } | 318 | } |
319 | 319 | ||
... | @@ -324,7 +324,7 @@ public class FlowStatisticManager implements FlowStatisticService { | ... | @@ -324,7 +324,7 @@ public class FlowStatisticManager implements FlowStatisticService { |
324 | List<TypedFlowEntryWithLoad> fel = typedFlowEntryLoadByInstInternal(cp, currentMap, previousMap, | 324 | List<TypedFlowEntryWithLoad> fel = typedFlowEntryLoadByInstInternal(cp, currentMap, previousMap, |
325 | isAllInstType, instType, TypedFlowEntryWithLoad.longPollInterval()); | 325 | isAllInstType, instType, TypedFlowEntryWithLoad.longPollInterval()); |
326 | if (fel.size() > 0) { | 326 | if (fel.size() > 0) { |
327 | - retTFEL.addAll(fel); | 327 | + retTfel.addAll(fel); |
328 | } | 328 | } |
329 | } | 329 | } |
330 | 330 | ||
... | @@ -335,11 +335,11 @@ public class FlowStatisticManager implements FlowStatisticService { | ... | @@ -335,11 +335,11 @@ public class FlowStatisticManager implements FlowStatisticService { |
335 | List<TypedFlowEntryWithLoad> fel = typedFlowEntryLoadByInstInternal(cp, currentMap, previousMap, | 335 | List<TypedFlowEntryWithLoad> fel = typedFlowEntryLoadByInstInternal(cp, currentMap, previousMap, |
336 | isAllInstType, instType, TypedFlowEntryWithLoad.avgPollInterval()); | 336 | isAllInstType, instType, TypedFlowEntryWithLoad.avgPollInterval()); |
337 | if (fel.size() > 0) { | 337 | if (fel.size() > 0) { |
338 | - retTFEL.addAll(fel); | 338 | + retTfel.addAll(fel); |
339 | } | 339 | } |
340 | } | 340 | } |
341 | 341 | ||
342 | - return retTFEL; | 342 | + return retTfel; |
343 | } | 343 | } |
344 | 344 | ||
345 | private List<TypedFlowEntryWithLoad> typedFlowEntryLoadByInstInternal(ConnectPoint cp, | 345 | private List<TypedFlowEntryWithLoad> typedFlowEntryLoadByInstInternal(ConnectPoint cp, | ... | ... |
... | @@ -495,15 +495,15 @@ public class ProxyArpManagerTest { | ... | @@ -495,15 +495,15 @@ public class ProxyArpManagerTest { |
495 | replay(hostService); | 495 | replay(hostService); |
496 | replay(interfaceService); | 496 | replay(interfaceService); |
497 | 497 | ||
498 | - Ethernet ndpRequest = buildNDP(ICMP6.NEIGHBOR_SOLICITATION, | 498 | + Ethernet ndpRequest = buildNdp(ICMP6.NEIGHBOR_SOLICITATION, |
499 | - MAC4, SOLICITED_MAC3, | 499 | + MAC4, SOLICITED_MAC3, |
500 | - IP4, IP3); | 500 | + IP4, IP3); |
501 | 501 | ||
502 | proxyArp.reply(ndpRequest, getLocation(5)); | 502 | proxyArp.reply(ndpRequest, getLocation(5)); |
503 | 503 | ||
504 | assertEquals(1, packetService.packets.size()); | 504 | assertEquals(1, packetService.packets.size()); |
505 | - Ethernet ndpReply = buildNDP(ICMP6.NEIGHBOR_ADVERTISEMENT, | 505 | + Ethernet ndpReply = buildNdp(ICMP6.NEIGHBOR_ADVERTISEMENT, |
506 | - MAC3, MAC4, IP3, IP4); | 506 | + MAC3, MAC4, IP3, IP4); |
507 | verifyPacketOut(ndpReply, getLocation(5), packetService.packets.get(0)); | 507 | verifyPacketOut(ndpReply, getLocation(5), packetService.packets.get(0)); |
508 | } | 508 | } |
509 | 509 | ||
... | @@ -556,9 +556,9 @@ public class ProxyArpManagerTest { | ... | @@ -556,9 +556,9 @@ public class ProxyArpManagerTest { |
556 | replay(hostService); | 556 | replay(hostService); |
557 | replay(interfaceService); | 557 | replay(interfaceService); |
558 | 558 | ||
559 | - Ethernet ndpRequest = buildNDP(ICMP6.NEIGHBOR_SOLICITATION, | 559 | + Ethernet ndpRequest = buildNdp(ICMP6.NEIGHBOR_SOLICITATION, |
560 | - MAC4, SOLICITED_MAC3, | 560 | + MAC4, SOLICITED_MAC3, |
561 | - IP4, IP3); | 561 | + IP4, IP3); |
562 | 562 | ||
563 | proxyArp.reply(ndpRequest, getLocation(NUM_DEVICES)); | 563 | proxyArp.reply(ndpRequest, getLocation(NUM_DEVICES)); |
564 | 564 | ||
... | @@ -686,9 +686,9 @@ public class ProxyArpManagerTest { | ... | @@ -686,9 +686,9 @@ public class ProxyArpManagerTest { |
686 | replay(hostService); | 686 | replay(hostService); |
687 | replay(interfaceService); | 687 | replay(interfaceService); |
688 | 688 | ||
689 | - Ethernet ndpRequest = buildNDP(ICMP6.NEIGHBOR_SOLICITATION, | 689 | + Ethernet ndpRequest = buildNdp(ICMP6.NEIGHBOR_SOLICITATION, |
690 | - MAC4, SOLICITED_MAC3, | 690 | + MAC4, SOLICITED_MAC3, |
691 | - IP4, IP3); | 691 | + IP4, IP3); |
692 | 692 | ||
693 | proxyArp.reply(ndpRequest, getLocation(NUM_DEVICES)); | 693 | proxyArp.reply(ndpRequest, getLocation(NUM_DEVICES)); |
694 | 694 | ||
... | @@ -752,37 +752,37 @@ public class ProxyArpManagerTest { | ... | @@ -752,37 +752,37 @@ public class ProxyArpManagerTest { |
752 | replay(hostService); | 752 | replay(hostService); |
753 | replay(interfaceService); | 753 | replay(interfaceService); |
754 | 754 | ||
755 | - Ethernet ndpRequest = buildNDP(ICMP6.NEIGHBOR_SOLICITATION, | 755 | + Ethernet ndpRequest = buildNdp(ICMP6.NEIGHBOR_SOLICITATION, |
756 | - MAC2, | 756 | + MAC2, |
757 | - MacAddress.valueOf("33:33:ff:00:00:01"), | 757 | + MacAddress.valueOf("33:33:ff:00:00:01"), |
758 | - theirIp, | 758 | + theirIp, |
759 | - ourFirstIp); | 759 | + ourFirstIp); |
760 | 760 | ||
761 | proxyArp.reply(ndpRequest, LOC1); | 761 | proxyArp.reply(ndpRequest, LOC1); |
762 | assertEquals(1, packetService.packets.size()); | 762 | assertEquals(1, packetService.packets.size()); |
763 | 763 | ||
764 | - Ethernet ndpReply = buildNDP(ICMP6.NEIGHBOR_ADVERTISEMENT, | 764 | + Ethernet ndpReply = buildNdp(ICMP6.NEIGHBOR_ADVERTISEMENT, |
765 | - firstMac, | 765 | + firstMac, |
766 | - MAC2, | 766 | + MAC2, |
767 | - ourFirstIp, | 767 | + ourFirstIp, |
768 | - theirIp); | 768 | + theirIp); |
769 | verifyPacketOut(ndpReply, LOC1, packetService.packets.get(0)); | 769 | verifyPacketOut(ndpReply, LOC1, packetService.packets.get(0)); |
770 | 770 | ||
771 | // Test a request for the second address on that port | 771 | // Test a request for the second address on that port |
772 | packetService.packets.clear(); | 772 | packetService.packets.clear(); |
773 | - ndpRequest = buildNDP(ICMP6.NEIGHBOR_SOLICITATION, | 773 | + ndpRequest = buildNdp(ICMP6.NEIGHBOR_SOLICITATION, |
774 | - MAC2, | 774 | + MAC2, |
775 | - MacAddress.valueOf("33:33:ff:00:00:01"), | 775 | + MacAddress.valueOf("33:33:ff:00:00:01"), |
776 | - theirIp, | 776 | + theirIp, |
777 | - ourSecondIp); | 777 | + ourSecondIp); |
778 | proxyArp.reply(ndpRequest, LOC1); | 778 | proxyArp.reply(ndpRequest, LOC1); |
779 | assertEquals(1, packetService.packets.size()); | 779 | assertEquals(1, packetService.packets.size()); |
780 | 780 | ||
781 | - ndpReply = buildNDP(ICMP6.NEIGHBOR_ADVERTISEMENT, | 781 | + ndpReply = buildNdp(ICMP6.NEIGHBOR_ADVERTISEMENT, |
782 | - secondMac, | 782 | + secondMac, |
783 | - MAC2, | 783 | + MAC2, |
784 | - ourSecondIp, | 784 | + ourSecondIp, |
785 | - theirIp); | 785 | + theirIp); |
786 | verifyPacketOut(ndpReply, LOC1, packetService.packets.get(0)); | 786 | verifyPacketOut(ndpReply, LOC1, packetService.packets.get(0)); |
787 | } | 787 | } |
788 | 788 | ||
... | @@ -819,21 +819,21 @@ public class ProxyArpManagerTest { | ... | @@ -819,21 +819,21 @@ public class ProxyArpManagerTest { |
819 | 819 | ||
820 | Ip6Address theirIp = Ip6Address.valueOf("1000::ffff"); | 820 | Ip6Address theirIp = Ip6Address.valueOf("1000::ffff"); |
821 | 821 | ||
822 | - Ethernet ndpRequest = buildNDP(ICMP6.NEIGHBOR_SOLICITATION, | 822 | + Ethernet ndpRequest = buildNdp(ICMP6.NEIGHBOR_SOLICITATION, |
823 | - MAC1, | 823 | + MAC1, |
824 | - MacAddress.valueOf("33:33:ff:00:00:01"), | 824 | + MacAddress.valueOf("33:33:ff:00:00:01"), |
825 | - theirIp, | 825 | + theirIp, |
826 | - Ip6Address.valueOf("3000::1")); | 826 | + Ip6Address.valueOf("3000::1")); |
827 | proxyArp.reply(ndpRequest, LOC1); | 827 | proxyArp.reply(ndpRequest, LOC1); |
828 | assertEquals(0, packetService.packets.size()); | 828 | assertEquals(0, packetService.packets.size()); |
829 | 829 | ||
830 | // Request for a valid internal IP address but coming in an external port | 830 | // Request for a valid internal IP address but coming in an external port |
831 | packetService.packets.clear(); | 831 | packetService.packets.clear(); |
832 | - ndpRequest = buildNDP(ICMP6.NEIGHBOR_SOLICITATION, | 832 | + ndpRequest = buildNdp(ICMP6.NEIGHBOR_SOLICITATION, |
833 | - MAC1, | 833 | + MAC1, |
834 | - MacAddress.valueOf("33:33:ff:00:00:01"), | 834 | + MacAddress.valueOf("33:33:ff:00:00:01"), |
835 | - theirIp, | 835 | + theirIp, |
836 | - IP3); | 836 | + IP3); |
837 | proxyArp.reply(ndpRequest, LOC1); | 837 | proxyArp.reply(ndpRequest, LOC1); |
838 | assertEquals(0, packetService.packets.size()); | 838 | assertEquals(0, packetService.packets.size()); |
839 | } | 839 | } |
... | @@ -894,11 +894,11 @@ public class ProxyArpManagerTest { | ... | @@ -894,11 +894,11 @@ public class ProxyArpManagerTest { |
894 | 894 | ||
895 | // This is a request from something inside our network (like a BGP | 895 | // This is a request from something inside our network (like a BGP |
896 | // daemon) to an external host. | 896 | // daemon) to an external host. |
897 | - Ethernet ndpRequest = buildNDP(ICMP6.NEIGHBOR_SOLICITATION, | 897 | + Ethernet ndpRequest = buildNdp(ICMP6.NEIGHBOR_SOLICITATION, |
898 | - ourMac, | 898 | + ourMac, |
899 | - MacAddress.valueOf("33:33:ff:00:00:01"), | 899 | + MacAddress.valueOf("33:33:ff:00:00:01"), |
900 | - ourIp, | 900 | + ourIp, |
901 | - theirIp); | 901 | + theirIp); |
902 | 902 | ||
903 | proxyArp.reply(ndpRequest, getLocation(5)); | 903 | proxyArp.reply(ndpRequest, getLocation(5)); |
904 | assertEquals(1, packetService.packets.size()); | 904 | assertEquals(1, packetService.packets.size()); |
... | @@ -954,9 +954,9 @@ public class ProxyArpManagerTest { | ... | @@ -954,9 +954,9 @@ public class ProxyArpManagerTest { |
954 | replay(hostService); | 954 | replay(hostService); |
955 | replay(interfaceService); | 955 | replay(interfaceService); |
956 | 956 | ||
957 | - Ethernet ndpRequest = buildNDP(ICMP6.NEIGHBOR_SOLICITATION, | 957 | + Ethernet ndpRequest = buildNdp(ICMP6.NEIGHBOR_SOLICITATION, |
958 | - MAC4, SOLICITED_MAC3, | 958 | + MAC4, SOLICITED_MAC3, |
959 | - IP4, IP3); | 959 | + IP4, IP3); |
960 | 960 | ||
961 | proxyArp.forward(ndpRequest, LOC2); | 961 | proxyArp.forward(ndpRequest, LOC2); |
962 | 962 | ||
... | @@ -995,9 +995,9 @@ public class ProxyArpManagerTest { | ... | @@ -995,9 +995,9 @@ public class ProxyArpManagerTest { |
995 | replay(hostService); | 995 | replay(hostService); |
996 | replay(interfaceService); | 996 | replay(interfaceService); |
997 | 997 | ||
998 | - Ethernet ndpRequest = buildNDP(ICMP6.NEIGHBOR_SOLICITATION, | 998 | + Ethernet ndpRequest = buildNdp(ICMP6.NEIGHBOR_SOLICITATION, |
999 | - MAC4, SOLICITED_MAC3, | 999 | + MAC4, SOLICITED_MAC3, |
1000 | - IP4, IP3); | 1000 | + IP4, IP3); |
1001 | 1001 | ||
1002 | proxyArp.forward(ndpRequest, getLocation(NUM_DEVICES)); | 1002 | proxyArp.forward(ndpRequest, getLocation(NUM_DEVICES)); |
1003 | 1003 | ||
... | @@ -1113,7 +1113,7 @@ public class ProxyArpManagerTest { | ... | @@ -1113,7 +1113,7 @@ public class ProxyArpManagerTest { |
1113 | * @param dstIp destination IP address | 1113 | * @param dstIp destination IP address |
1114 | * @return the NDP packet | 1114 | * @return the NDP packet |
1115 | */ | 1115 | */ |
1116 | - private Ethernet buildNDP(byte type, MacAddress srcMac, MacAddress dstMac, | 1116 | + private Ethernet buildNdp(byte type, MacAddress srcMac, MacAddress dstMac, |
1117 | Ip6Address srcIp, Ip6Address dstIp) { | 1117 | Ip6Address srcIp, Ip6Address dstIp) { |
1118 | assertThat(type, anyOf( | 1118 | assertThat(type, anyOf( |
1119 | is(ICMP6.NEIGHBOR_SOLICITATION), | 1119 | is(ICMP6.NEIGHBOR_SOLICITATION), | ... | ... |
... | @@ -47,7 +47,7 @@ public class NettyMessagingManager extends NettyMessaging { | ... | @@ -47,7 +47,7 @@ public class NettyMessagingManager extends NettyMessaging { |
47 | @Activate | 47 | @Activate |
48 | public void activate() throws Exception { | 48 | public void activate() throws Exception { |
49 | ControllerNode localNode = clusterMetadataService.getLocalNode(); | 49 | ControllerNode localNode = clusterMetadataService.getLocalNode(); |
50 | - getTLSParameters(); | 50 | + getTlsParameters(); |
51 | super.start(new Endpoint(localNode.ip(), localNode.tcpPort())); | 51 | super.start(new Endpoint(localNode.ip(), localNode.tcpPort())); |
52 | log.info("Started"); | 52 | log.info("Started"); |
53 | } | 53 | } |
... | @@ -58,29 +58,29 @@ public class NettyMessagingManager extends NettyMessaging { | ... | @@ -58,29 +58,29 @@ public class NettyMessagingManager extends NettyMessaging { |
58 | log.info("Stopped"); | 58 | log.info("Stopped"); |
59 | } | 59 | } |
60 | 60 | ||
61 | - private void getTLSParameters() { | 61 | + private void getTlsParameters() { |
62 | String tempString = System.getProperty("enableNettyTLS"); | 62 | String tempString = System.getProperty("enableNettyTLS"); |
63 | - enableNettyTLS = Strings.isNullOrEmpty(tempString) ? TLS_DISABLED : Boolean.parseBoolean(tempString); | 63 | + enableNettyTls = Strings.isNullOrEmpty(tempString) ? TLS_DISABLED : Boolean.parseBoolean(tempString); |
64 | - log.info("enableNettyTLS = {}", enableNettyTLS); | 64 | + log.info("enableNettyTLS = {}", enableNettyTls); |
65 | - if (enableNettyTLS) { | 65 | + if (enableNettyTls) { |
66 | ksLocation = System.getProperty("javax.net.ssl.keyStore"); | 66 | ksLocation = System.getProperty("javax.net.ssl.keyStore"); |
67 | if (Strings.isNullOrEmpty(ksLocation)) { | 67 | if (Strings.isNullOrEmpty(ksLocation)) { |
68 | - enableNettyTLS = TLS_DISABLED; | 68 | + enableNettyTls = TLS_DISABLED; |
69 | return; | 69 | return; |
70 | } | 70 | } |
71 | tsLocation = System.getProperty("javax.net.ssl.trustStore"); | 71 | tsLocation = System.getProperty("javax.net.ssl.trustStore"); |
72 | if (Strings.isNullOrEmpty(tsLocation)) { | 72 | if (Strings.isNullOrEmpty(tsLocation)) { |
73 | - enableNettyTLS = TLS_DISABLED; | 73 | + enableNettyTls = TLS_DISABLED; |
74 | return; | 74 | return; |
75 | } | 75 | } |
76 | ksPwd = System.getProperty("javax.net.ssl.keyStorePassword").toCharArray(); | 76 | ksPwd = System.getProperty("javax.net.ssl.keyStorePassword").toCharArray(); |
77 | if (MIN_KS_LENGTH > ksPwd.length) { | 77 | if (MIN_KS_LENGTH > ksPwd.length) { |
78 | - enableNettyTLS = TLS_DISABLED; | 78 | + enableNettyTls = TLS_DISABLED; |
79 | return; | 79 | return; |
80 | } | 80 | } |
81 | tsPwd = System.getProperty("javax.net.ssl.trustStorePassword").toCharArray(); | 81 | tsPwd = System.getProperty("javax.net.ssl.trustStorePassword").toCharArray(); |
82 | if (MIN_KS_LENGTH > tsPwd.length) { | 82 | if (MIN_KS_LENGTH > tsPwd.length) { |
83 | - enableNettyTLS = TLS_DISABLED; | 83 | + enableNettyTls = TLS_DISABLED; |
84 | return; | 84 | return; |
85 | } | 85 | } |
86 | } | 86 | } | ... | ... |
... | @@ -1040,7 +1040,7 @@ public class GossipDeviceStore | ... | @@ -1040,7 +1040,7 @@ public class GossipDeviceStore |
1040 | 1040 | ||
1041 | checkArgument(!providerDescs.isEmpty(), "No device descriptions supplied"); | 1041 | checkArgument(!providerDescs.isEmpty(), "No device descriptions supplied"); |
1042 | 1042 | ||
1043 | - ProviderId primary = pickPrimaryPID(providerDescs); | 1043 | + ProviderId primary = pickPrimaryPid(providerDescs); |
1044 | 1044 | ||
1045 | DeviceDescriptions desc = providerDescs.get(primary); | 1045 | DeviceDescriptions desc = providerDescs.get(primary); |
1046 | 1046 | ||
... | @@ -1103,7 +1103,7 @@ public class GossipDeviceStore | ... | @@ -1103,7 +1103,7 @@ public class GossipDeviceStore |
1103 | private Port composePort(Device device, PortNumber number, | 1103 | private Port composePort(Device device, PortNumber number, |
1104 | Map<ProviderId, DeviceDescriptions> descsMap) { | 1104 | Map<ProviderId, DeviceDescriptions> descsMap) { |
1105 | 1105 | ||
1106 | - ProviderId primary = pickPrimaryPID(descsMap); | 1106 | + ProviderId primary = pickPrimaryPid(descsMap); |
1107 | DeviceDescriptions primDescs = descsMap.get(primary); | 1107 | DeviceDescriptions primDescs = descsMap.get(primary); |
1108 | // if no primary, assume not enabled | 1108 | // if no primary, assume not enabled |
1109 | boolean isEnabled = false; | 1109 | boolean isEnabled = false; |
... | @@ -1149,7 +1149,7 @@ public class GossipDeviceStore | ... | @@ -1149,7 +1149,7 @@ public class GossipDeviceStore |
1149 | /** | 1149 | /** |
1150 | * @return primary ProviderID, or randomly chosen one if none exists | 1150 | * @return primary ProviderID, or randomly chosen one if none exists |
1151 | */ | 1151 | */ |
1152 | - private ProviderId pickPrimaryPID( | 1152 | + private ProviderId pickPrimaryPid( |
1153 | Map<ProviderId, DeviceDescriptions> providerDescs) { | 1153 | Map<ProviderId, DeviceDescriptions> providerDescs) { |
1154 | ProviderId fallBackPrimary = null; | 1154 | ProviderId fallBackPrimary = null; |
1155 | for (Entry<ProviderId, DeviceDescriptions> e : providerDescs.entrySet()) { | 1155 | for (Entry<ProviderId, DeviceDescriptions> e : providerDescs.entrySet()) { |
... | @@ -1165,7 +1165,7 @@ public class GossipDeviceStore | ... | @@ -1165,7 +1165,7 @@ public class GossipDeviceStore |
1165 | 1165 | ||
1166 | private DeviceDescriptions getPrimaryDescriptions( | 1166 | private DeviceDescriptions getPrimaryDescriptions( |
1167 | Map<ProviderId, DeviceDescriptions> providerDescs) { | 1167 | Map<ProviderId, DeviceDescriptions> providerDescs) { |
1168 | - ProviderId pid = pickPrimaryPID(providerDescs); | 1168 | + ProviderId pid = pickPrimaryPid(providerDescs); |
1169 | return providerDescs.get(pid); | 1169 | return providerDescs.get(pid); |
1170 | } | 1170 | } |
1171 | 1171 | ... | ... |
... | @@ -232,7 +232,7 @@ public class GossipDeviceStoreTest { | ... | @@ -232,7 +232,7 @@ public class GossipDeviceStoreTest { |
232 | if (expected == actual) { | 232 | if (expected == actual) { |
233 | return; | 233 | return; |
234 | } | 234 | } |
235 | - assertEquals(expected.deviceURI(), actual.deviceURI()); | 235 | + assertEquals(expected.deviceUri(), actual.deviceUri()); |
236 | assertEquals(expected.hwVersion(), actual.hwVersion()); | 236 | assertEquals(expected.hwVersion(), actual.hwVersion()); |
237 | assertEquals(expected.manufacturer(), actual.manufacturer()); | 237 | assertEquals(expected.manufacturer(), actual.manufacturer()); |
238 | assertEquals(expected.serialNumber(), actual.serialNumber()); | 238 | assertEquals(expected.serialNumber(), actual.serialNumber()); |
... | @@ -247,7 +247,7 @@ public class GossipDeviceStoreTest { | ... | @@ -247,7 +247,7 @@ public class GossipDeviceStoreTest { |
247 | if (expected == actual) { | 247 | if (expected == actual) { |
248 | return; | 248 | return; |
249 | } | 249 | } |
250 | - assertEquals(expected.deviceURI(), actual.deviceURI()); | 250 | + assertEquals(expected.deviceUri(), actual.deviceUri()); |
251 | assertEquals(expected.hwVersion(), actual.hwVersion()); | 251 | assertEquals(expected.hwVersion(), actual.hwVersion()); |
252 | assertEquals(expected.manufacturer(), actual.manufacturer()); | 252 | assertEquals(expected.manufacturer(), actual.manufacturer()); |
253 | assertEquals(expected.serialNumber(), actual.serialNumber()); | 253 | assertEquals(expected.serialNumber(), actual.serialNumber()); | ... | ... |
... | @@ -438,7 +438,7 @@ public final class KryoNamespaces { | ... | @@ -438,7 +438,7 @@ public final class KryoNamespaces { |
438 | DefaultTableStatisticsEntry.class | 438 | DefaultTableStatisticsEntry.class |
439 | ) | 439 | ) |
440 | .register(new DefaultApplicationIdSerializer(), DefaultApplicationId.class) | 440 | .register(new DefaultApplicationIdSerializer(), DefaultApplicationId.class) |
441 | - .register(new URISerializer(), URI.class) | 441 | + .register(new UriSerializer(), URI.class) |
442 | .register(new NodeIdSerializer(), NodeId.class) | 442 | .register(new NodeIdSerializer(), NodeId.class) |
443 | .register(new ProviderIdSerializer(), ProviderId.class) | 443 | .register(new ProviderIdSerializer(), ProviderId.class) |
444 | .register(new DeviceIdSerializer(), DeviceId.class) | 444 | .register(new DeviceIdSerializer(), DeviceId.class) | ... | ... |
... | @@ -15,22 +15,22 @@ | ... | @@ -15,22 +15,22 @@ |
15 | */ | 15 | */ |
16 | package org.onosproject.store.serializers; | 16 | package org.onosproject.store.serializers; |
17 | 17 | ||
18 | -import java.net.URI; | ||
19 | - | ||
20 | import com.esotericsoftware.kryo.Kryo; | 18 | import com.esotericsoftware.kryo.Kryo; |
21 | import com.esotericsoftware.kryo.Serializer; | 19 | import com.esotericsoftware.kryo.Serializer; |
22 | import com.esotericsoftware.kryo.io.Input; | 20 | import com.esotericsoftware.kryo.io.Input; |
23 | import com.esotericsoftware.kryo.io.Output; | 21 | import com.esotericsoftware.kryo.io.Output; |
24 | 22 | ||
23 | +import java.net.URI; | ||
24 | + | ||
25 | /** | 25 | /** |
26 | * Serializer for {@link URI}. | 26 | * Serializer for {@link URI}. |
27 | */ | 27 | */ |
28 | -public class URISerializer extends Serializer<URI> { | 28 | +public class UriSerializer extends Serializer<URI> { |
29 | 29 | ||
30 | /** | 30 | /** |
31 | * Creates {@link URI} serializer instance. | 31 | * Creates {@link URI} serializer instance. |
32 | */ | 32 | */ |
33 | - public URISerializer() { | 33 | + public UriSerializer() { |
34 | super(false); | 34 | super(false); |
35 | } | 35 | } |
36 | 36 | ... | ... |
... | @@ -53,7 +53,7 @@ import java.util.concurrent.atomic.AtomicBoolean; | ... | @@ -53,7 +53,7 @@ import java.util.concurrent.atomic.AtomicBoolean; |
53 | * while it sends *all* ports (both tap and WDM ports, i.e., OCh and OMS) in the experimenter port desc stats reply. | 53 | * while it sends *all* ports (both tap and WDM ports, i.e., OCh and OMS) in the experimenter port desc stats reply. |
54 | * | 54 | * |
55 | */ | 55 | */ |
56 | -public class OFOpticalSwitchImplLINC13 | 56 | +public class OfOpticalSwitchImplLinc13 |
57 | extends AbstractOpenFlowSwitch implements OpenFlowOpticalSwitch { | 57 | extends AbstractOpenFlowSwitch implements OpenFlowOpticalSwitch { |
58 | 58 | ||
59 | private final AtomicBoolean driverHandshakeComplete = new AtomicBoolean(false); | 59 | private final AtomicBoolean driverHandshakeComplete = new AtomicBoolean(false); | ... | ... |
... | @@ -61,7 +61,7 @@ | ... | @@ -61,7 +61,7 @@ |
61 | manufacturer="FlowForwarding.org" hwVersion="Unknown" | 61 | manufacturer="FlowForwarding.org" hwVersion="Unknown" |
62 | swVersion="LINC-OE OpenFlow Software Switch 1.1"> | 62 | swVersion="LINC-OE OpenFlow Software Switch 1.1"> |
63 | <behaviour api="org.onosproject.openflow.controller.driver.OpenFlowSwitchDriver" | 63 | <behaviour api="org.onosproject.openflow.controller.driver.OpenFlowSwitchDriver" |
64 | - impl="org.onosproject.driver.handshaker.OFOpticalSwitchImplLINC13"/> | 64 | + impl="org.onosproject.driver.handshaker.OfOpticalSwitchImplLinc13"/> |
65 | </driver> | 65 | </driver> |
66 | <driver name="corsa" | 66 | <driver name="corsa" |
67 | manufacturer="Corsa" hwVersion="Corsa Element" swVersion="2.3.1"> | 67 | manufacturer="Corsa" hwVersion="Corsa Element" swVersion="2.3.1"> | ... | ... |
... | @@ -31,7 +31,7 @@ import java.util.Random; | ... | @@ -31,7 +31,7 @@ import java.util.Random; |
31 | * if one path goes through an edge in risk group 1, the other path will go | 31 | * if one path goes through an edge in risk group 1, the other path will go |
32 | * through no edges in risk group 1. | 32 | * through no edges in risk group 1. |
33 | */ | 33 | */ |
34 | -public class SRLGGraphSearch<V extends Vertex, E extends Edge<V>> | 34 | +public class SrlgGraphSearch<V extends Vertex, E extends Edge<V>> |
35 | extends AbstractGraphPathSearch<V, E> { | 35 | extends AbstractGraphPathSearch<V, E> { |
36 | 36 | ||
37 | static final int ITERATIONS = 100; | 37 | static final int ITERATIONS = 100; |
... | @@ -55,7 +55,7 @@ public class SRLGGraphSearch<V extends Vertex, E extends Edge<V>> | ... | @@ -55,7 +55,7 @@ public class SRLGGraphSearch<V extends Vertex, E extends Edge<V>> |
55 | * @param groups the number of disjoint risk groups | 55 | * @param groups the number of disjoint risk groups |
56 | * @param grouping map linking edges to integral group assignments | 56 | * @param grouping map linking edges to integral group assignments |
57 | */ | 57 | */ |
58 | - public SRLGGraphSearch(int groups, Map<E, Integer> grouping) { | 58 | + public SrlgGraphSearch(int groups, Map<E, Integer> grouping) { |
59 | numGroups = groups; | 59 | numGroups = groups; |
60 | riskGrouping = grouping; | 60 | riskGrouping = grouping; |
61 | } | 61 | } |
... | @@ -67,7 +67,7 @@ public class SRLGGraphSearch<V extends Vertex, E extends Edge<V>> | ... | @@ -67,7 +67,7 @@ public class SRLGGraphSearch<V extends Vertex, E extends Edge<V>> |
67 | * @param grouping map linking edges to object group assignments, | 67 | * @param grouping map linking edges to object group assignments, |
68 | * with same-group status linked to equality | 68 | * with same-group status linked to equality |
69 | */ | 69 | */ |
70 | - public SRLGGraphSearch(Map<E, Object> grouping) { | 70 | + public SrlgGraphSearch(Map<E, Object> grouping) { |
71 | if (grouping == null) { | 71 | if (grouping == null) { |
72 | useSuurballe = true; | 72 | useSuurballe = true; |
73 | return; | 73 | return; | ... | ... |
... | @@ -42,8 +42,8 @@ public class TarjanGraphSearch<V extends Vertex, E extends Edge<V>> | ... | @@ -42,8 +42,8 @@ public class TarjanGraphSearch<V extends Vertex, E extends Edge<V>> |
42 | * </p> | 42 | * </p> |
43 | */ | 43 | */ |
44 | @Override | 44 | @Override |
45 | - public SCCResult<V, E> search(Graph<V, E> graph, EdgeWeight<V, E> weight) { | 45 | + public SccResult<V, E> search(Graph<V, E> graph, EdgeWeight<V, E> weight) { |
46 | - SCCResult<V, E> result = new SCCResult<>(graph); | 46 | + SccResult<V, E> result = new SccResult<>(graph); |
47 | for (V vertex : graph.getVertexes()) { | 47 | for (V vertex : graph.getVertexes()) { |
48 | VertexData data = result.data(vertex); | 48 | VertexData data = result.data(vertex); |
49 | if (data == null) { | 49 | if (data == null) { |
... | @@ -64,7 +64,7 @@ public class TarjanGraphSearch<V extends Vertex, E extends Edge<V>> | ... | @@ -64,7 +64,7 @@ public class TarjanGraphSearch<V extends Vertex, E extends Edge<V>> |
64 | */ | 64 | */ |
65 | private VertexData<V> connect(Graph<V, E> graph, V vertex, | 65 | private VertexData<V> connect(Graph<V, E> graph, V vertex, |
66 | EdgeWeight<V, E> weight, | 66 | EdgeWeight<V, E> weight, |
67 | - SCCResult<V, E> result) { | 67 | + SccResult<V, E> result) { |
68 | VertexData<V> data = result.addData(vertex); | 68 | VertexData<V> data = result.addData(vertex); |
69 | 69 | ||
70 | // Scan through all egress edges of the current vertex. | 70 | // Scan through all egress edges of the current vertex. |
... | @@ -99,7 +99,7 @@ public class TarjanGraphSearch<V extends Vertex, E extends Edge<V>> | ... | @@ -99,7 +99,7 @@ public class TarjanGraphSearch<V extends Vertex, E extends Edge<V>> |
99 | /** | 99 | /** |
100 | * Graph search result augmented with SCC vertexData. | 100 | * Graph search result augmented with SCC vertexData. |
101 | */ | 101 | */ |
102 | - public static final class SCCResult<V extends Vertex, E extends Edge<V>> | 102 | + public static final class SccResult<V extends Vertex, E extends Edge<V>> |
103 | implements Result { | 103 | implements Result { |
104 | 104 | ||
105 | private final Graph<V, E> graph; | 105 | private final Graph<V, E> graph; |
... | @@ -110,7 +110,7 @@ public class TarjanGraphSearch<V extends Vertex, E extends Edge<V>> | ... | @@ -110,7 +110,7 @@ public class TarjanGraphSearch<V extends Vertex, E extends Edge<V>> |
110 | private final Map<V, VertexData<V>> vertexData = new HashMap<>(); | 110 | private final Map<V, VertexData<V>> vertexData = new HashMap<>(); |
111 | private final List<VertexData<V>> visited = new ArrayList<>(); | 111 | private final List<VertexData<V>> visited = new ArrayList<>(); |
112 | 112 | ||
113 | - private SCCResult(Graph<V, E> graph) { | 113 | + private SccResult(Graph<V, E> graph) { |
114 | this.graph = graph; | 114 | this.graph = graph; |
115 | } | 115 | } |
116 | 116 | ||
... | @@ -189,7 +189,7 @@ public class TarjanGraphSearch<V extends Vertex, E extends Edge<V>> | ... | @@ -189,7 +189,7 @@ public class TarjanGraphSearch<V extends Vertex, E extends Edge<V>> |
189 | return Collections.unmodifiableSet(edges); | 189 | return Collections.unmodifiableSet(edges); |
190 | } | 190 | } |
191 | 191 | ||
192 | - public SCCResult<V, E> build() { | 192 | + public SccResult<V, E> build() { |
193 | clusterVertexes = Collections.unmodifiableList(clusterVertexes); | 193 | clusterVertexes = Collections.unmodifiableList(clusterVertexes); |
194 | clusterEdges = Collections.unmodifiableList(clusterEdges); | 194 | clusterEdges = Collections.unmodifiableList(clusterEdges); |
195 | return this; | 195 | return this; | ... | ... |
... | @@ -31,11 +31,11 @@ import static org.onlab.graph.GraphPathSearch.ALL_PATHS; | ... | @@ -31,11 +31,11 @@ import static org.onlab.graph.GraphPathSearch.ALL_PATHS; |
31 | /** | 31 | /** |
32 | * Test of the Suurballe backup path algorithm. | 32 | * Test of the Suurballe backup path algorithm. |
33 | */ | 33 | */ |
34 | -public class SRLGGraphSearchTest extends BreadthFirstSearchTest { | 34 | +public class SrlgGraphSearchTest extends BreadthFirstSearchTest { |
35 | 35 | ||
36 | @Override | 36 | @Override |
37 | protected AbstractGraphPathSearch<TestVertex, TestEdge> graphSearch() { | 37 | protected AbstractGraphPathSearch<TestVertex, TestEdge> graphSearch() { |
38 | - return new SRLGGraphSearch<>(null); | 38 | + return new SrlgGraphSearch<>(null); |
39 | } | 39 | } |
40 | 40 | ||
41 | public void setDefaultWeights() { | 41 | public void setDefaultWeights() { |
... | @@ -64,7 +64,7 @@ public class SRLGGraphSearchTest extends BreadthFirstSearchTest { | ... | @@ -64,7 +64,7 @@ public class SRLGGraphSearchTest extends BreadthFirstSearchTest { |
64 | riskProfile.put(bC, 0); | 64 | riskProfile.put(bC, 0); |
65 | riskProfile.put(aD, 1); | 65 | riskProfile.put(aD, 1); |
66 | riskProfile.put(dC, 1); | 66 | riskProfile.put(dC, 1); |
67 | - SRLGGraphSearch<TestVertex, TestEdge> search = new SRLGGraphSearch<>(2, riskProfile); | 67 | + SrlgGraphSearch<TestVertex, TestEdge> search = new SrlgGraphSearch<>(2, riskProfile); |
68 | Set<Path<TestVertex, TestEdge>> paths = search.search(graph, A, C, weight, ALL_PATHS).paths(); | 68 | Set<Path<TestVertex, TestEdge>> paths = search.search(graph, A, C, weight, ALL_PATHS).paths(); |
69 | System.out.println("\n\n\n" + paths + "\n\n\n"); | 69 | System.out.println("\n\n\n" + paths + "\n\n\n"); |
70 | assertEquals("one disjoint path pair found", 1, paths.size()); | 70 | assertEquals("one disjoint path pair found", 1, paths.size()); |
... | @@ -105,7 +105,7 @@ public class SRLGGraphSearchTest extends BreadthFirstSearchTest { | ... | @@ -105,7 +105,7 @@ public class SRLGGraphSearchTest extends BreadthFirstSearchTest { |
105 | riskProfile.put(dC, 1); | 105 | riskProfile.put(dC, 1); |
106 | riskProfile.put(cE, 2); | 106 | riskProfile.put(cE, 2); |
107 | riskProfile.put(bE, 3); | 107 | riskProfile.put(bE, 3); |
108 | - SRLGGraphSearch<TestVertex, TestEdge> search = new SRLGGraphSearch<>(4, riskProfile); | 108 | + SrlgGraphSearch<TestVertex, TestEdge> search = new SrlgGraphSearch<>(4, riskProfile); |
109 | search.search(graph, A, E, weight, ALL_PATHS).paths(); | 109 | search.search(graph, A, E, weight, ALL_PATHS).paths(); |
110 | } | 110 | } |
111 | 111 | ||
... | @@ -127,7 +127,7 @@ public class SRLGGraphSearchTest extends BreadthFirstSearchTest { | ... | @@ -127,7 +127,7 @@ public class SRLGGraphSearchTest extends BreadthFirstSearchTest { |
127 | riskProfile.put(dE, 3); | 127 | riskProfile.put(dE, 3); |
128 | riskProfile.put(aC, 4); | 128 | riskProfile.put(aC, 4); |
129 | riskProfile.put(cE, 5); | 129 | riskProfile.put(cE, 5); |
130 | - SRLGGraphSearch<TestVertex, TestEdge> search = new SRLGGraphSearch<>(6, riskProfile); | 130 | + SrlgGraphSearch<TestVertex, TestEdge> search = new SrlgGraphSearch<>(6, riskProfile); |
131 | Set<Path<TestVertex, TestEdge>> paths = search.search(graph, A, E, weight, ALL_PATHS).paths(); | 131 | Set<Path<TestVertex, TestEdge>> paths = search.search(graph, A, E, weight, ALL_PATHS).paths(); |
132 | assertTrue("> one disjoint path pair found", paths.size() >= 1); | 132 | assertTrue("> one disjoint path pair found", paths.size() >= 1); |
133 | checkIsDisjoint(paths.iterator().next(), riskProfile); | 133 | checkIsDisjoint(paths.iterator().next(), riskProfile); |
... | @@ -147,7 +147,7 @@ public class SRLGGraphSearchTest extends BreadthFirstSearchTest { | ... | @@ -147,7 +147,7 @@ public class SRLGGraphSearchTest extends BreadthFirstSearchTest { |
147 | riskProfile.put(bC, 0); | 147 | riskProfile.put(bC, 0); |
148 | riskProfile.put(aD, 1); | 148 | riskProfile.put(aD, 1); |
149 | riskProfile.put(dC, 0); | 149 | riskProfile.put(dC, 0); |
150 | - SRLGGraphSearch<TestVertex, TestEdge> search = new SRLGGraphSearch<>(2, riskProfile); | 150 | + SrlgGraphSearch<TestVertex, TestEdge> search = new SrlgGraphSearch<>(2, riskProfile); |
151 | Set<Path<TestVertex, TestEdge>> paths = search.search(graph, A, C, weight, ALL_PATHS).paths(); | 151 | Set<Path<TestVertex, TestEdge>> paths = search.search(graph, A, C, weight, ALL_PATHS).paths(); |
152 | System.out.println(paths); | 152 | System.out.println(paths); |
153 | assertTrue("no disjoint path pairs found", paths.size() == 0); | 153 | assertTrue("no disjoint path pairs found", paths.size() == 0); |
... | @@ -167,7 +167,7 @@ public class SRLGGraphSearchTest extends BreadthFirstSearchTest { | ... | @@ -167,7 +167,7 @@ public class SRLGGraphSearchTest extends BreadthFirstSearchTest { |
167 | riskProfile.put(bC, 0); | 167 | riskProfile.put(bC, 0); |
168 | riskProfile.put(aD, 1); | 168 | riskProfile.put(aD, 1); |
169 | riskProfile.put(dC, 0); | 169 | riskProfile.put(dC, 0); |
170 | - SRLGGraphSearch<TestVertex, TestEdge> search = new SRLGGraphSearch<>(2, riskProfile); | 170 | + SrlgGraphSearch<TestVertex, TestEdge> search = new SrlgGraphSearch<>(2, riskProfile); |
171 | Set<Path<TestVertex, TestEdge>> paths = search.search(graph, A, E, weight, ALL_PATHS).paths(); | 171 | Set<Path<TestVertex, TestEdge>> paths = search.search(graph, A, E, weight, ALL_PATHS).paths(); |
172 | assertTrue("no disjoint path pairs found", paths.size() == 0); | 172 | assertTrue("no disjoint path pairs found", paths.size() == 0); |
173 | } | 173 | } | ... | ... |
... | @@ -19,20 +19,20 @@ import org.junit.Test; | ... | @@ -19,20 +19,20 @@ import org.junit.Test; |
19 | 19 | ||
20 | import static com.google.common.collect.ImmutableSet.of; | 20 | import static com.google.common.collect.ImmutableSet.of; |
21 | import static org.junit.Assert.assertEquals; | 21 | import static org.junit.Assert.assertEquals; |
22 | -import static org.onlab.graph.TarjanGraphSearch.SCCResult; | 22 | +import static org.onlab.graph.TarjanGraphSearch.SccResult; |
23 | 23 | ||
24 | /** | 24 | /** |
25 | * Tarjan graph search tests. | 25 | * Tarjan graph search tests. |
26 | */ | 26 | */ |
27 | public class TarjanGraphSearchTest extends GraphTest { | 27 | public class TarjanGraphSearchTest extends GraphTest { |
28 | 28 | ||
29 | - private void validate(SCCResult<TestVertex, TestEdge> result, int cc) { | 29 | + private void validate(SccResult<TestVertex, TestEdge> result, int cc) { |
30 | System.out.println("Cluster count: " + result.clusterVertexes().size()); | 30 | System.out.println("Cluster count: " + result.clusterVertexes().size()); |
31 | System.out.println("Clusters: " + result.clusterVertexes()); | 31 | System.out.println("Clusters: " + result.clusterVertexes()); |
32 | assertEquals("incorrect cluster count", cc, result.clusterCount()); | 32 | assertEquals("incorrect cluster count", cc, result.clusterCount()); |
33 | } | 33 | } |
34 | 34 | ||
35 | - private void validate(SCCResult<TestVertex, TestEdge> result, | 35 | + private void validate(SccResult<TestVertex, TestEdge> result, |
36 | int i, int vc, int ec) { | 36 | int i, int vc, int ec) { |
37 | assertEquals("incorrect cluster count", vc, result.clusterVertexes().get(i).size()); | 37 | assertEquals("incorrect cluster count", vc, result.clusterVertexes().get(i).size()); |
38 | assertEquals("incorrect edge count", ec, result.clusterEdges().get(i).size()); | 38 | assertEquals("incorrect edge count", ec, result.clusterEdges().get(i).size()); |
... | @@ -42,7 +42,7 @@ public class TarjanGraphSearchTest extends GraphTest { | ... | @@ -42,7 +42,7 @@ public class TarjanGraphSearchTest extends GraphTest { |
42 | public void basic() { | 42 | public void basic() { |
43 | graph = new AdjacencyListsGraph<>(vertexes(), edges()); | 43 | graph = new AdjacencyListsGraph<>(vertexes(), edges()); |
44 | TarjanGraphSearch<TestVertex, TestEdge> gs = new TarjanGraphSearch<>(); | 44 | TarjanGraphSearch<TestVertex, TestEdge> gs = new TarjanGraphSearch<>(); |
45 | - SCCResult<TestVertex, TestEdge> result = gs.search(graph, null); | 45 | + SccResult<TestVertex, TestEdge> result = gs.search(graph, null); |
46 | validate(result, 6); | 46 | validate(result, 6); |
47 | } | 47 | } |
48 | 48 | ||
... | @@ -59,7 +59,7 @@ public class TarjanGraphSearchTest extends GraphTest { | ... | @@ -59,7 +59,7 @@ public class TarjanGraphSearchTest extends GraphTest { |
59 | new TestEdge(H, A, 1))); | 59 | new TestEdge(H, A, 1))); |
60 | 60 | ||
61 | TarjanGraphSearch<TestVertex, TestEdge> gs = new TarjanGraphSearch<>(); | 61 | TarjanGraphSearch<TestVertex, TestEdge> gs = new TarjanGraphSearch<>(); |
62 | - SCCResult<TestVertex, TestEdge> result = gs.search(graph, null); | 62 | + SccResult<TestVertex, TestEdge> result = gs.search(graph, null); |
63 | validate(result, 1); | 63 | validate(result, 1); |
64 | validate(result, 0, 8, 8); | 64 | validate(result, 0, 8, 8); |
65 | } | 65 | } |
... | @@ -76,7 +76,7 @@ public class TarjanGraphSearchTest extends GraphTest { | ... | @@ -76,7 +76,7 @@ public class TarjanGraphSearchTest extends GraphTest { |
76 | new TestEdge(G, H, 1), | 76 | new TestEdge(G, H, 1), |
77 | new TestEdge(H, E, 1))); | 77 | new TestEdge(H, E, 1))); |
78 | TarjanGraphSearch<TestVertex, TestEdge> gs = new TarjanGraphSearch<>(); | 78 | TarjanGraphSearch<TestVertex, TestEdge> gs = new TarjanGraphSearch<>(); |
79 | - SCCResult<TestVertex, TestEdge> result = gs.search(graph, null); | 79 | + SccResult<TestVertex, TestEdge> result = gs.search(graph, null); |
80 | validate(result, 2); | 80 | validate(result, 2); |
81 | validate(result, 0, 4, 4); | 81 | validate(result, 0, 4, 4); |
82 | validate(result, 1, 4, 4); | 82 | validate(result, 1, 4, 4); |
... | @@ -95,7 +95,7 @@ public class TarjanGraphSearchTest extends GraphTest { | ... | @@ -95,7 +95,7 @@ public class TarjanGraphSearchTest extends GraphTest { |
95 | new TestEdge(H, E, 1), | 95 | new TestEdge(H, E, 1), |
96 | new TestEdge(B, E, 1))); | 96 | new TestEdge(B, E, 1))); |
97 | TarjanGraphSearch<TestVertex, TestEdge> gs = new TarjanGraphSearch<>(); | 97 | TarjanGraphSearch<TestVertex, TestEdge> gs = new TarjanGraphSearch<>(); |
98 | - SCCResult<TestVertex, TestEdge> result = gs.search(graph, null); | 98 | + SccResult<TestVertex, TestEdge> result = gs.search(graph, null); |
99 | validate(result, 2); | 99 | validate(result, 2); |
100 | validate(result, 0, 4, 4); | 100 | validate(result, 0, 4, 4); |
101 | validate(result, 1, 4, 4); | 101 | validate(result, 1, 4, 4); |
... | @@ -116,7 +116,7 @@ public class TarjanGraphSearchTest extends GraphTest { | ... | @@ -116,7 +116,7 @@ public class TarjanGraphSearchTest extends GraphTest { |
116 | new TestEdge(E, B, -1))); | 116 | new TestEdge(E, B, -1))); |
117 | 117 | ||
118 | TarjanGraphSearch<TestVertex, TestEdge> gs = new TarjanGraphSearch<>(); | 118 | TarjanGraphSearch<TestVertex, TestEdge> gs = new TarjanGraphSearch<>(); |
119 | - SCCResult<TestVertex, TestEdge> result = gs.search(graph, weight); | 119 | + SccResult<TestVertex, TestEdge> result = gs.search(graph, weight); |
120 | validate(result, 2); | 120 | validate(result, 2); |
121 | validate(result, 0, 4, 4); | 121 | validate(result, 0, 4, 4); |
122 | validate(result, 1, 4, 4); | 122 | validate(result, 1, 4, 4); | ... | ... |
... | @@ -47,7 +47,7 @@ public class HexStringTest { | ... | @@ -47,7 +47,7 @@ public class HexStringTest { |
47 | } | 47 | } |
48 | 48 | ||
49 | @Test | 49 | @Test |
50 | - public void testToLongMSB() { | 50 | + public void testToLongMsb() { |
51 | String dpidStr = "ca:7c:5e:d1:64:7a:95:9b"; | 51 | String dpidStr = "ca:7c:5e:d1:64:7a:95:9b"; |
52 | long valid = -3856102927509056101L; | 52 | long valid = -3856102927509056101L; |
53 | long testLong = HexString.toLong(dpidStr); | 53 | long testLong = HexString.toLong(dpidStr); | ... | ... |
... | @@ -15,6 +15,10 @@ | ... | @@ -15,6 +15,10 @@ |
15 | */ | 15 | */ |
16 | package org.onlab.netty; | 16 | package org.onlab.netty; |
17 | 17 | ||
18 | +import com.google.common.cache.Cache; | ||
19 | +import com.google.common.cache.CacheBuilder; | ||
20 | +import com.google.common.cache.RemovalListener; | ||
21 | +import com.google.common.cache.RemovalNotification; | ||
18 | import io.netty.bootstrap.Bootstrap; | 22 | import io.netty.bootstrap.Bootstrap; |
19 | import io.netty.bootstrap.ServerBootstrap; | 23 | import io.netty.bootstrap.ServerBootstrap; |
20 | import io.netty.buffer.PooledByteBufAllocator; | 24 | import io.netty.buffer.PooledByteBufAllocator; |
... | @@ -34,11 +38,20 @@ import io.netty.channel.nio.NioEventLoopGroup; | ... | @@ -34,11 +38,20 @@ import io.netty.channel.nio.NioEventLoopGroup; |
34 | import io.netty.channel.socket.SocketChannel; | 38 | import io.netty.channel.socket.SocketChannel; |
35 | import io.netty.channel.socket.nio.NioServerSocketChannel; | 39 | import io.netty.channel.socket.nio.NioServerSocketChannel; |
36 | import io.netty.channel.socket.nio.NioSocketChannel; | 40 | import io.netty.channel.socket.nio.NioSocketChannel; |
41 | +import org.apache.commons.pool.KeyedPoolableObjectFactory; | ||
42 | +import org.apache.commons.pool.impl.GenericKeyedObjectPool; | ||
43 | +import org.onosproject.store.cluster.messaging.Endpoint; | ||
44 | +import org.onosproject.store.cluster.messaging.MessagingService; | ||
45 | +import org.slf4j.Logger; | ||
46 | +import org.slf4j.LoggerFactory; | ||
37 | 47 | ||
48 | +import javax.net.ssl.KeyManagerFactory; | ||
49 | +import javax.net.ssl.SSLContext; | ||
50 | +import javax.net.ssl.SSLEngine; | ||
51 | +import javax.net.ssl.TrustManagerFactory; | ||
38 | import java.io.FileInputStream; | 52 | import java.io.FileInputStream; |
39 | import java.io.IOException; | 53 | import java.io.IOException; |
40 | import java.security.KeyStore; | 54 | import java.security.KeyStore; |
41 | - | ||
42 | import java.util.Map; | 55 | import java.util.Map; |
43 | import java.util.concurrent.CompletableFuture; | 56 | import java.util.concurrent.CompletableFuture; |
44 | import java.util.concurrent.ConcurrentHashMap; | 57 | import java.util.concurrent.ConcurrentHashMap; |
... | @@ -51,23 +64,6 @@ import java.util.concurrent.atomic.AtomicLong; | ... | @@ -51,23 +64,6 @@ import java.util.concurrent.atomic.AtomicLong; |
51 | import java.util.function.Consumer; | 64 | import java.util.function.Consumer; |
52 | import java.util.function.Function; | 65 | import java.util.function.Function; |
53 | 66 | ||
54 | -import org.apache.commons.pool.KeyedPoolableObjectFactory; | ||
55 | -import org.apache.commons.pool.impl.GenericKeyedObjectPool; | ||
56 | -import org.onosproject.store.cluster.messaging.Endpoint; | ||
57 | -import org.onosproject.store.cluster.messaging.MessagingService; | ||
58 | -import org.slf4j.Logger; | ||
59 | -import org.slf4j.LoggerFactory; | ||
60 | - | ||
61 | -import com.google.common.cache.Cache; | ||
62 | -import com.google.common.cache.CacheBuilder; | ||
63 | -import com.google.common.cache.RemovalListener; | ||
64 | -import com.google.common.cache.RemovalNotification; | ||
65 | - | ||
66 | -import javax.net.ssl.KeyManagerFactory; | ||
67 | -import javax.net.ssl.SSLContext; | ||
68 | -import javax.net.ssl.SSLEngine; | ||
69 | -import javax.net.ssl.TrustManagerFactory; | ||
70 | - | ||
71 | /** | 67 | /** |
72 | * Implementation of MessagingService based on <a href="http://netty.io/">Netty</a> framework. | 68 | * Implementation of MessagingService based on <a href="http://netty.io/">Netty</a> framework. |
73 | */ | 69 | */ |
... | @@ -102,7 +98,7 @@ public class NettyMessaging implements MessagingService { | ... | @@ -102,7 +98,7 @@ public class NettyMessaging implements MessagingService { |
102 | private Class<? extends Channel> clientChannelClass; | 98 | private Class<? extends Channel> clientChannelClass; |
103 | 99 | ||
104 | protected static final boolean TLS_DISABLED = false; | 100 | protected static final boolean TLS_DISABLED = false; |
105 | - protected boolean enableNettyTLS = TLS_DISABLED; | 101 | + protected boolean enableNettyTls = TLS_DISABLED; |
106 | 102 | ||
107 | protected String ksLocation; | 103 | protected String ksLocation; |
108 | protected String tsLocation; | 104 | protected String tsLocation; |
... | @@ -259,8 +255,8 @@ public class NettyMessaging implements MessagingService { | ... | @@ -259,8 +255,8 @@ public class NettyMessaging implements MessagingService { |
259 | b.option(ChannelOption.ALLOCATOR, PooledByteBufAllocator.DEFAULT); | 255 | b.option(ChannelOption.ALLOCATOR, PooledByteBufAllocator.DEFAULT); |
260 | b.group(serverGroup, clientGroup); | 256 | b.group(serverGroup, clientGroup); |
261 | b.channel(serverChannelClass); | 257 | b.channel(serverChannelClass); |
262 | - if (enableNettyTLS) { | 258 | + if (enableNettyTls) { |
263 | - b.childHandler(new SSLServerCommunicationChannelInitializer()); | 259 | + b.childHandler(new SslServerCommunicationChannelInitializer()); |
264 | } else { | 260 | } else { |
265 | b.childHandler(new OnosCommunicationChannelInitializer()); | 261 | b.childHandler(new OnosCommunicationChannelInitializer()); |
266 | } | 262 | } |
... | @@ -303,8 +299,8 @@ public class NettyMessaging implements MessagingService { | ... | @@ -303,8 +299,8 @@ public class NettyMessaging implements MessagingService { |
303 | // http://normanmaurer.me/presentations/2014-facebook-eng-netty/slides.html#37.0 | 299 | // http://normanmaurer.me/presentations/2014-facebook-eng-netty/slides.html#37.0 |
304 | bootstrap.channel(clientChannelClass); | 300 | bootstrap.channel(clientChannelClass); |
305 | bootstrap.option(ChannelOption.SO_KEEPALIVE, true); | 301 | bootstrap.option(ChannelOption.SO_KEEPALIVE, true); |
306 | - if (enableNettyTLS) { | 302 | + if (enableNettyTls) { |
307 | - bootstrap.handler(new SSLClientCommunicationChannelInitializer()); | 303 | + bootstrap.handler(new SslClientCommunicationChannelInitializer()); |
308 | } else { | 304 | } else { |
309 | bootstrap.handler(new OnosCommunicationChannelInitializer()); | 305 | bootstrap.handler(new OnosCommunicationChannelInitializer()); |
310 | } | 306 | } |
... | @@ -325,7 +321,7 @@ public class NettyMessaging implements MessagingService { | ... | @@ -325,7 +321,7 @@ public class NettyMessaging implements MessagingService { |
325 | } | 321 | } |
326 | } | 322 | } |
327 | 323 | ||
328 | - private class SSLServerCommunicationChannelInitializer extends ChannelInitializer<SocketChannel> { | 324 | + private class SslServerCommunicationChannelInitializer extends ChannelInitializer<SocketChannel> { |
329 | 325 | ||
330 | private final ChannelHandler dispatcher = new InboundMessageDispatcher(); | 326 | private final ChannelHandler dispatcher = new InboundMessageDispatcher(); |
331 | private final ChannelHandler encoder = new MessageEncoder(); | 327 | private final ChannelHandler encoder = new MessageEncoder(); |
... | @@ -345,15 +341,15 @@ public class NettyMessaging implements MessagingService { | ... | @@ -345,15 +341,15 @@ public class NettyMessaging implements MessagingService { |
345 | SSLContext serverContext = SSLContext.getInstance("TLS"); | 341 | SSLContext serverContext = SSLContext.getInstance("TLS"); |
346 | serverContext.init(kmf.getKeyManagers(), tmFactory.getTrustManagers(), null); | 342 | serverContext.init(kmf.getKeyManagers(), tmFactory.getTrustManagers(), null); |
347 | 343 | ||
348 | - SSLEngine serverSSLEngine = serverContext.createSSLEngine(); | 344 | + SSLEngine serverSslEngine = serverContext.createSSLEngine(); |
349 | 345 | ||
350 | - serverSSLEngine.setNeedClientAuth(true); | 346 | + serverSslEngine.setNeedClientAuth(true); |
351 | - serverSSLEngine.setUseClientMode(false); | 347 | + serverSslEngine.setUseClientMode(false); |
352 | - serverSSLEngine.setEnabledProtocols(serverSSLEngine.getSupportedProtocols()); | 348 | + serverSslEngine.setEnabledProtocols(serverSslEngine.getSupportedProtocols()); |
353 | - serverSSLEngine.setEnabledCipherSuites(serverSSLEngine.getSupportedCipherSuites()); | 349 | + serverSslEngine.setEnabledCipherSuites(serverSslEngine.getSupportedCipherSuites()); |
354 | - serverSSLEngine.setEnableSessionCreation(true); | 350 | + serverSslEngine.setEnableSessionCreation(true); |
355 | 351 | ||
356 | - channel.pipeline().addLast("ssl", new io.netty.handler.ssl.SslHandler(serverSSLEngine)) | 352 | + channel.pipeline().addLast("ssl", new io.netty.handler.ssl.SslHandler(serverSslEngine)) |
357 | .addLast("encoder", encoder) | 353 | .addLast("encoder", encoder) |
358 | .addLast("decoder", new MessageDecoder()) | 354 | .addLast("decoder", new MessageDecoder()) |
359 | .addLast("handler", dispatcher); | 355 | .addLast("handler", dispatcher); |
... | @@ -361,7 +357,7 @@ public class NettyMessaging implements MessagingService { | ... | @@ -361,7 +357,7 @@ public class NettyMessaging implements MessagingService { |
361 | 357 | ||
362 | } | 358 | } |
363 | 359 | ||
364 | - private class SSLClientCommunicationChannelInitializer extends ChannelInitializer<SocketChannel> { | 360 | + private class SslClientCommunicationChannelInitializer extends ChannelInitializer<SocketChannel> { |
365 | 361 | ||
366 | private final ChannelHandler dispatcher = new InboundMessageDispatcher(); | 362 | private final ChannelHandler dispatcher = new InboundMessageDispatcher(); |
367 | private final ChannelHandler encoder = new MessageEncoder(); | 363 | private final ChannelHandler encoder = new MessageEncoder(); |
... | @@ -381,14 +377,14 @@ public class NettyMessaging implements MessagingService { | ... | @@ -381,14 +377,14 @@ public class NettyMessaging implements MessagingService { |
381 | SSLContext clientContext = SSLContext.getInstance("TLS"); | 377 | SSLContext clientContext = SSLContext.getInstance("TLS"); |
382 | clientContext.init(kmf.getKeyManagers(), tmFactory.getTrustManagers(), null); | 378 | clientContext.init(kmf.getKeyManagers(), tmFactory.getTrustManagers(), null); |
383 | 379 | ||
384 | - SSLEngine clientSSLEngine = clientContext.createSSLEngine(); | 380 | + SSLEngine clientSslEngine = clientContext.createSSLEngine(); |
385 | 381 | ||
386 | - clientSSLEngine.setUseClientMode(true); | 382 | + clientSslEngine.setUseClientMode(true); |
387 | - clientSSLEngine.setEnabledProtocols(clientSSLEngine.getSupportedProtocols()); | 383 | + clientSslEngine.setEnabledProtocols(clientSslEngine.getSupportedProtocols()); |
388 | - clientSSLEngine.setEnabledCipherSuites(clientSSLEngine.getSupportedCipherSuites()); | 384 | + clientSslEngine.setEnabledCipherSuites(clientSslEngine.getSupportedCipherSuites()); |
389 | - clientSSLEngine.setEnableSessionCreation(true); | 385 | + clientSslEngine.setEnableSessionCreation(true); |
390 | 386 | ||
391 | - channel.pipeline().addLast("ssl", new io.netty.handler.ssl.SslHandler(clientSSLEngine)) | 387 | + channel.pipeline().addLast("ssl", new io.netty.handler.ssl.SslHandler(clientSslEngine)) |
392 | .addLast("encoder", encoder) | 388 | .addLast("encoder", encoder) |
393 | .addLast("decoder", new MessageDecoder()) | 389 | .addLast("decoder", new MessageDecoder()) |
394 | .addLast("handler", dispatcher); | 390 | .addLast("handler", dispatcher); | ... | ... |
... | @@ -327,7 +327,7 @@ class ConfigProvider implements DeviceProvider, LinkProvider, HostProvider { | ... | @@ -327,7 +327,7 @@ class ConfigProvider implements DeviceProvider, LinkProvider, HostProvider { |
327 | String value = annotations.value("optical.waves").trim(); | 327 | String value = annotations.value("optical.waves").trim(); |
328 | try { | 328 | try { |
329 | int numChls = Integer.parseInt(value); | 329 | int numChls = Integer.parseInt(value); |
330 | - updateOMSPorts(numChls, src, dst); | 330 | + updateOmsPorts(numChls, src, dst); |
331 | } catch (NumberFormatException e) { | 331 | } catch (NumberFormatException e) { |
332 | log.warn("Invalid channel ({}), can't configure port(s)", value); | 332 | log.warn("Invalid channel ({}), can't configure port(s)", value); |
333 | return; | 333 | return; |
... | @@ -373,7 +373,7 @@ class ConfigProvider implements DeviceProvider, LinkProvider, HostProvider { | ... | @@ -373,7 +373,7 @@ class ConfigProvider implements DeviceProvider, LinkProvider, HostProvider { |
373 | } | 373 | } |
374 | } | 374 | } |
375 | 375 | ||
376 | - private void updateOMSPorts(int numChls, ConnectPoint srcCp, ConnectPoint dstCp) { | 376 | + private void updateOmsPorts(int numChls, ConnectPoint srcCp, ConnectPoint dstCp) { |
377 | // round down to largest slot that allows numChl channels to fit into C band range | 377 | // round down to largest slot that allows numChl channels to fit into C band range |
378 | ChannelSpacing chl = null; | 378 | ChannelSpacing chl = null; |
379 | Frequency perChl = TOTAL.floorDivision(numChls); | 379 | Frequency perChl = TOTAL.floorDivision(numChls); | ... | ... |
-
Please register or login to post a comment