Fix Sonar errors: public data members in classes
Change-Id: I7aca37d5553436167ac6e7b2206392f88bddc118
diff --git a/src/main/java/org/onosproject/segmentrouting/SegmentRoutingManager.java b/src/main/java/org/onosproject/segmentrouting/SegmentRoutingManager.java
index 9c5b37b..01a09e4 100644
--- a/src/main/java/org/onosproject/segmentrouting/SegmentRoutingManager.java
+++ b/src/main/java/org/onosproject/segmentrouting/SegmentRoutingManager.java
@@ -179,8 +179,8 @@
IcmpHandler icmpHandler = null;
IpHandler ipHandler = null;
RoutingRulePopulator routingRulePopulator = null;
- public ApplicationId appId;
- public DeviceConfiguration deviceConfiguration = null;
+ ApplicationId appId;
+ DeviceConfiguration deviceConfiguration = null;
DefaultRoutingHandler defaultRoutingHandler = null;
private TunnelHandler tunnelHandler = null;
@@ -215,17 +215,17 @@
/**
* Per device next objective ID store with (device id + neighbor set) as key.
*/
- public EventuallyConsistentMap<NeighborSetNextObjectiveStoreKey, Integer>
+ EventuallyConsistentMap<NeighborSetNextObjectiveStoreKey, Integer>
nsNextObjStore = null;
/**
* Per device next objective ID store with (device id + subnet) as key.
*/
- public EventuallyConsistentMap<VlanNextObjectiveStoreKey, Integer>
+ EventuallyConsistentMap<VlanNextObjectiveStoreKey, Integer>
vlanNextObjStore = null;
/**
* Per device next objective ID store with (device id + port) as key.
*/
- public EventuallyConsistentMap<PortNextObjectiveStoreKey, Integer>
+ EventuallyConsistentMap<PortNextObjectiveStoreKey, Integer>
portNextObjStore = null;
private EventuallyConsistentMap<String, Tunnel> tunnelStore = null;
@@ -500,6 +500,51 @@
}
/**
+ * Extracts the application ID from the manager.
+ *
+ * @return application ID
+ */
+ public ApplicationId appId() {
+ return appId;
+ }
+
+ /**
+ * Returns the device configuration.
+ *
+ * @return device configuration
+ */
+ public DeviceConfiguration deviceConfiguration() {
+ return deviceConfiguration;
+ }
+
+ /**
+ * Per device next objective ID store with (device id + neighbor set) as key.
+ *
+ * @return next objective ID store
+ */
+ public EventuallyConsistentMap<NeighborSetNextObjectiveStoreKey, Integer> nsNextObjStore() {
+ return nsNextObjStore;
+ }
+
+ /**
+ * Per device next objective ID store with (device id + subnet) as key.
+ *
+ * @return vlan next object store
+ */
+ public EventuallyConsistentMap<VlanNextObjectiveStoreKey, Integer> vlanNextObjStore() {
+ return vlanNextObjStore;
+ }
+
+ /**
+ * Per device next objective ID store with (device id + port) as key.
+ *
+ * @return port next object store.
+ */
+ public EventuallyConsistentMap<PortNextObjectiveStoreKey, Integer> portNextObjStore() {
+ return portNextObjStore;
+ }
+
+ /**
* Returns the MPLS-ECMP configuration.
*
* @return MPLS-ECMP value
diff --git a/src/main/java/org/onosproject/segmentrouting/config/DeviceConfiguration.java b/src/main/java/org/onosproject/segmentrouting/config/DeviceConfiguration.java
index bd0db54..490bf4f 100644
--- a/src/main/java/org/onosproject/segmentrouting/config/DeviceConfiguration.java
+++ b/src/main/java/org/onosproject/segmentrouting/config/DeviceConfiguration.java
@@ -698,7 +698,7 @@
private boolean isSuppressedPort(ConnectPoint connectPoint) {
SegmentRoutingAppConfig appConfig = srManager.cfgService
- .getConfig(srManager.appId, SegmentRoutingAppConfig.class);
+ .getConfig(srManager.appId(), SegmentRoutingAppConfig.class);
if (appConfig != null && appConfig.suppressSubnet().contains(connectPoint)) {
log.info("Interface configuration on port {} is ignored", connectPoint);
return true;
diff --git a/src/main/java/org/onosproject/segmentrouting/grouphandler/DefaultGroupHandler.java b/src/main/java/org/onosproject/segmentrouting/grouphandler/DefaultGroupHandler.java
index fe33f6c..e73a0d8 100644
--- a/src/main/java/org/onosproject/segmentrouting/grouphandler/DefaultGroupHandler.java
+++ b/src/main/java/org/onosproject/segmentrouting/grouphandler/DefaultGroupHandler.java
@@ -126,9 +126,9 @@
+ " Skipping value assignment in DefaultGroupHandler");
}
this.flowObjectiveService = flowObjService;
- this.nsNextObjStore = srManager.nsNextObjStore;
- this.vlanNextObjStore = srManager.vlanNextObjStore;
- this.portNextObjStore = srManager.portNextObjStore;
+ this.nsNextObjStore = srManager.nsNextObjStore();
+ this.vlanNextObjStore = srManager.vlanNextObjStore();
+ this.portNextObjStore = srManager.portNextObjStore();
this.srManager = srManager;
populateNeighborMaps();
diff --git a/src/main/java/org/onosproject/segmentrouting/pwaas/L2TunnelHandler.java b/src/main/java/org/onosproject/segmentrouting/pwaas/L2TunnelHandler.java
index 74ddae5..72c7eac 100644
--- a/src/main/java/org/onosproject/segmentrouting/pwaas/L2TunnelHandler.java
+++ b/src/main/java/org/onosproject/segmentrouting/pwaas/L2TunnelHandler.java
@@ -811,7 +811,7 @@
.addCondition(Criteria.matchVlanId(outerTag))
.withPriority(SegmentRoutingService.DEFAULT_PRIORITY)
.permit()
- .fromApp(srManager.appId);
+ .fromApp(srManager.appId());
}
/**
@@ -844,7 +844,7 @@
trafficTreatment.setOutput(egressPort);
return DefaultForwardingObjective.builder()
- .fromApp(srManager.appId)
+ .fromApp(srManager.appId())
.makePermanent()
.nextStep(nextId)
.withPriority(SegmentRoutingService.DEFAULT_PRIORITY)
@@ -872,7 +872,7 @@
trafficSelector.matchInPort(inPort);
return DefaultForwardingObjective.builder()
- .fromApp(srManager.appId)
+ .fromApp(srManager.appId())
.makePermanent()
.nextStep(nextId)
.withPriority(SegmentRoutingService.DEFAULT_PRIORITY)
@@ -905,7 +905,7 @@
nextObjBuilder = DefaultNextObjective
.builder()
.withType(NextObjective.Type.SIMPLE)
- .fromApp(srManager.appId);
+ .fromApp(srManager.appId());
// The pw label is the bottom of stack. It has to
// be different -1.
if (l2Tunnel.pwLabel().toInt() == MplsLabel.MAX_MPLS) {
@@ -928,7 +928,7 @@
MplsLabel srLabel;
try {
srLabel = MplsLabel.mplsLabel(
- srManager.deviceConfiguration.getIPv4SegmentId(egressId)
+ srManager.deviceConfiguration().getIPv4SegmentId(egressId)
);
} catch (DeviceConfigNotFoundException e) {
log.warn("Sr label not configured");
@@ -942,7 +942,7 @@
MacAddress ingressMac;
try {
ingressMac = srManager
- .deviceConfiguration
+ .deviceConfiguration()
.getDeviceMac(srcCp.deviceId());
} catch (DeviceConfigNotFoundException e) {
log.warn("Was not able to find the ingress mac");
@@ -952,7 +952,7 @@
MacAddress neighborMac;
try {
neighborMac = srManager
- .deviceConfiguration
+ .deviceConfiguration()
.getDeviceMac(dstCp.deviceId());
} catch (DeviceConfigNotFoundException e) {
log.warn("Was not able to find the neighbor mac");
@@ -965,7 +965,7 @@
nextObjBuilder = DefaultNextObjective
.builder()
.withType(NextObjective.Type.SIMPLE)
- .fromApp(srManager.appId);
+ .fromApp(srManager.appId());
}
treatmentBuilder.setOutput(srcCp.port());
nextObjBuilder.addTreatment(treatmentBuilder.build());