SR refactoring
- Remove unused data structure
- Remove duplicated function calls in rerouteNetwork()
Change-Id: If2ceefa290dcdf9adb67e6317b60debc05166767
diff --git a/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/SegmentRoutingManager.java b/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/SegmentRoutingManager.java
index 69a8079..2b21d8c 100644
--- a/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/SegmentRoutingManager.java
+++ b/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/SegmentRoutingManager.java
@@ -88,7 +88,6 @@
import org.onosproject.segmentrouting.grouphandler.NextNeighbors;
import org.onosproject.segmentrouting.storekey.DestinationSetNextObjectiveStoreKey;
import org.onosproject.segmentrouting.storekey.PortNextObjectiveStoreKey;
-import org.onosproject.segmentrouting.storekey.SubnetAssignedVidStoreKey;
import org.onosproject.segmentrouting.storekey.VlanNextObjectiveStoreKey;
import org.onosproject.segmentrouting.storekey.XConnectStoreKey;
import org.onosproject.segmentrouting.pwaas.L2TunnelHandler;
@@ -406,7 +405,6 @@
.register(KryoNamespaces.API)
.register(DestinationSetNextObjectiveStoreKey.class,
VlanNextObjectiveStoreKey.class,
- SubnetAssignedVidStoreKey.class,
DestinationSet.class,
NextNeighbors.class,
Tunnel.class,
@@ -492,12 +490,6 @@
@Override
public void rerouteNetwork() {
cfgListener.configureNetwork();
- for (Device device : deviceService.getDevices()) {
- if (mastershipService.isLocalMaster(device.id())) {
- defaultRoutingHandler.populatePortAddressingRules(device.id());
- }
- }
- defaultRoutingHandler.startPopulationProcess();
}
@Override
diff --git a/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/storekey/SubnetAssignedVidStoreKey.java b/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/storekey/SubnetAssignedVidStoreKey.java
deleted file mode 100644
index 8cd104e..0000000
--- a/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/storekey/SubnetAssignedVidStoreKey.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * Copyright 2016-present Open Networking Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.onosproject.segmentrouting.storekey;
-
-import org.onlab.packet.IpPrefix;
-import org.onosproject.net.DeviceId;
-
-import java.util.Objects;
-
-/**
- * Key of assigned VLAN ID store.
- */
-public class SubnetAssignedVidStoreKey {
- private final DeviceId deviceId;
- private final IpPrefix subnet;
-
- /**
- * Constructs the key of per subnet VLAN ID store.
- *
- * @param deviceId device ID of the VLAN cross-connection
- * @param subnet subnet information
- */
- public SubnetAssignedVidStoreKey(DeviceId deviceId, IpPrefix subnet) {
- this.deviceId = deviceId;
- this.subnet = subnet;
- }
-
- /**
- * Default constructor for Kryo.
- */
- protected SubnetAssignedVidStoreKey() {
- this.deviceId = null;
- this.subnet = null;
- }
-
- /**
- * Returns the device identification used to create this key.
- *
- * @return the device identifier
- */
- public DeviceId deviceId() {
- return deviceId;
- }
-
- /**
- * Returns the subnet information used to create this key.
- *
- * @return the subnet
- */
- public IpPrefix subnet() {
- return subnet;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
- if (!(o instanceof SubnetAssignedVidStoreKey)) {
- return false;
- }
- SubnetAssignedVidStoreKey that =
- (SubnetAssignedVidStoreKey) o;
- return (Objects.equals(this.deviceId, that.deviceId) &&
- Objects.equals(this.subnet, that.subnet));
- }
-
- @Override
- public int hashCode() {
- int result = 17;
- result = 31 * result + Objects.hashCode(deviceId)
- + Objects.hashCode(subnet);
- return result;
- }
-
- @Override
- public String toString() {
- return "Device: " + deviceId + " Subnet: " + subnet;
- }
-
-}