aboutsummaryrefslogtreecommitdiffstats
path: root/framework/src/onos/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/config
diff options
context:
space:
mode:
Diffstat (limited to 'framework/src/onos/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/config')
-rw-r--r--framework/src/onos/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/config/NetworkConfig.java19
-rw-r--r--framework/src/onos/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/config/NetworkConfigException.java15
-rw-r--r--framework/src/onos/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/config/NetworkConfigManager.java29
-rw-r--r--framework/src/onos/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/config/NetworkConfigService.java15
-rw-r--r--framework/src/onos/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/config/PktLinkConfig.java17
-rw-r--r--framework/src/onos/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/config/SegmentRouterConfig.java23
6 files changed, 104 insertions, 14 deletions
diff --git a/framework/src/onos/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/config/NetworkConfig.java b/framework/src/onos/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/config/NetworkConfig.java
index 6ae0779e..0c7749e6 100644
--- a/framework/src/onos/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/config/NetworkConfig.java
+++ b/framework/src/onos/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/config/NetworkConfig.java
@@ -1,3 +1,18 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * 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.config;
import java.util.ArrayList;
@@ -30,8 +45,8 @@ public class NetworkConfig {
* Default constructor.
*/
public NetworkConfig() {
- switches = new ArrayList<SwitchConfig>();
- links = new ArrayList<LinkConfig>();
+ switches = new ArrayList<>();
+ links = new ArrayList<>();
}
@JsonProperty("comment")
diff --git a/framework/src/onos/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/config/NetworkConfigException.java b/framework/src/onos/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/config/NetworkConfigException.java
index 91942216..0c0dac86 100644
--- a/framework/src/onos/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/config/NetworkConfigException.java
+++ b/framework/src/onos/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/config/NetworkConfigException.java
@@ -1,3 +1,18 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * 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.config;
import org.onosproject.net.DeviceId;
diff --git a/framework/src/onos/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/config/NetworkConfigManager.java b/framework/src/onos/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/config/NetworkConfigManager.java
index 44e4f1c6..f034f372 100644
--- a/framework/src/onos/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/config/NetworkConfigManager.java
+++ b/framework/src/onos/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/config/NetworkConfigManager.java
@@ -1,3 +1,18 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * 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.config;
import java.io.File;
@@ -135,7 +150,7 @@ public class NetworkConfigManager implements NetworkConfigService {
@Override
public List<SwitchConfig> getConfiguredAllowedSwitches() {
- List<SwitchConfig> allowed = new ArrayList<SwitchConfig>();
+ List<SwitchConfig> allowed = new ArrayList<>();
for (SwitchConfig swc : configuredSwitches.values()) {
if (swc.isAllowed()) {
allowed.add(swc);
@@ -146,7 +161,7 @@ public class NetworkConfigManager implements NetworkConfigService {
@Override
public List<LinkConfig> getConfiguredAllowedLinks() {
- List<LinkConfig> allowed = new ArrayList<LinkConfig>();
+ List<LinkConfig> allowed = new ArrayList<>();
for (LinkConfig lkc : configuredLinks.values()) {
if (lkc.isAllowed()) {
allowed.add(lkc);
@@ -244,8 +259,8 @@ public class NetworkConfigManager implements NetworkConfigService {
}
private void validateSwitchConfig(List<SwitchConfig> swConfList) {
- Set<DeviceId> swDpids = new HashSet<DeviceId>();
- Set<String> swNames = new HashSet<String>();
+ Set<DeviceId> swDpids = new HashSet<>();
+ Set<String> swNames = new HashSet<>();
for (SwitchConfig swc : swConfList) {
if (swc.getNodeDpid() == null || swc.getDpid() == null) {
throw new NetworkConfigException.DpidNotSpecified(swc.getName());
@@ -315,9 +330,9 @@ public class NetworkConfigManager implements NetworkConfigService {
*/
public void init() {
loadNetworkConfig();
- configuredSwitches = new ConcurrentHashMap<DeviceId, SwitchConfig>();
- configuredLinks = new ConcurrentHashMap<Link, LinkConfig>();
- nameToDpid = new HashMap<String, DeviceId>();
+ configuredSwitches = new ConcurrentHashMap<>();
+ configuredLinks = new ConcurrentHashMap<>();
+ nameToDpid = new HashMap<>();
parseNetworkConfig();
}
}
diff --git a/framework/src/onos/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/config/NetworkConfigService.java b/framework/src/onos/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/config/NetworkConfigService.java
index 56855271..afbb0fcc 100644
--- a/framework/src/onos/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/config/NetworkConfigService.java
+++ b/framework/src/onos/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/config/NetworkConfigService.java
@@ -1,3 +1,18 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * 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.config;
import java.util.List;
diff --git a/framework/src/onos/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/config/PktLinkConfig.java b/framework/src/onos/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/config/PktLinkConfig.java
index c66ac3c7..3c51fa9d 100644
--- a/framework/src/onos/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/config/PktLinkConfig.java
+++ b/framework/src/onos/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/config/PktLinkConfig.java
@@ -1,3 +1,18 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * 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.config;
import java.util.List;
@@ -33,7 +48,7 @@ public class PktLinkConfig extends LinkConfig {
type = lkc.getType();
allowed = lkc.isAllowed();
params = lkc.getParams();
- publishAttributes = new ConcurrentHashMap<String, String>();
+ publishAttributes = new ConcurrentHashMap<>();
parseParams();
validateParams();
setPublishAttributes();
diff --git a/framework/src/onos/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/config/SegmentRouterConfig.java b/framework/src/onos/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/config/SegmentRouterConfig.java
index 4775c77f..c8d4a54a 100644
--- a/framework/src/onos/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/config/SegmentRouterConfig.java
+++ b/framework/src/onos/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/config/SegmentRouterConfig.java
@@ -1,3 +1,18 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * 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.config;
import java.io.IOException;
@@ -52,9 +67,9 @@ public class SegmentRouterConfig extends SwitchConfig {
this.setLongitude(swc.getLongitude());
this.setParams(swc.getParams());
this.setAllowed(swc.isAllowed());
- publishAttributes = new ConcurrentHashMap<String, String>();
- adjacencySids = new ArrayList<AdjacencySid>();
- subnets = new ArrayList<Subnet>();
+ publishAttributes = new ConcurrentHashMap<>();
+ adjacencySids = new ArrayList<>();
+ subnets = new ArrayList<>();
parseParams();
validateParams();
setPublishAttributes();
@@ -267,7 +282,7 @@ public class SegmentRouterConfig extends SwitchConfig {
} else if (fe.getKey().equals("ports")) {
if (fe.getValue().isArray()) {
Iterator<JsonNode> i = fe.getValue().elements();
- ports = new ArrayList<Integer>();
+ ports = new ArrayList<>();
while (i.hasNext()) {
ports.add(i.next().asInt());
}