Pruned old ACTN, Gluon, netconf client
Change-Id: I8119f80957ed89074d5fa92ea7fa4fafd29909b1
diff --git a/apps/actn-mdsc/tetunnel-ctl/src/main/java/org/onosproject/actn/mdsc/tetunnelctl/TeTunnelCtl.java b/apps/actn-mdsc/tetunnel-ctl/src/main/java/org/onosproject/actn/mdsc/tetunnelctl/TeTunnelCtl.java
deleted file mode 100644
index c725a01..0000000
--- a/apps/actn-mdsc/tetunnel-ctl/src/main/java/org/onosproject/actn/mdsc/tetunnelctl/TeTunnelCtl.java
+++ /dev/null
@@ -1,347 +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.actn.mdsc.tetunnelctl;
-
-import com.google.common.collect.Lists;
-import org.osgi.service.component.annotations.Activate;
-import org.osgi.service.component.annotations.Component;
-import org.osgi.service.component.annotations.Deactivate;
-import org.osgi.service.component.annotations.Reference;
-import org.osgi.service.component.annotations.ReferenceCardinality;
-import org.onosproject.actn.mdsc.pce.TeTunnelPceService;
-import org.onosproject.incubator.net.tunnel.Tunnel;
-import org.onosproject.incubator.net.tunnel.TunnelAdminService;
-import org.onosproject.incubator.net.tunnel.TunnelEvent;
-import org.onosproject.incubator.net.tunnel.TunnelId;
-import org.onosproject.incubator.net.tunnel.TunnelListener;
-import org.onosproject.incubator.net.tunnel.TunnelService;
-import org.onosproject.tetopology.management.api.TeTopology;
-import org.onosproject.tetopology.management.api.TeTopologyKey;
-import org.onosproject.tetopology.management.api.TeTopologyService;
-import org.onosproject.tetopology.management.api.node.TeNodeKey;
-import org.onosproject.tetopology.management.api.node.TtpKey;
-import org.onosproject.tetunnel.api.TeTunnelAdminService;
-import org.onosproject.tetunnel.api.TeTunnelService;
-import org.onosproject.tetunnel.api.tunnel.DefaultTeTunnel;
-import org.onosproject.tetunnel.api.tunnel.TeTunnel;
-import org.onosproject.tetunnel.api.tunnel.TeTunnelKey;
-import org.onosproject.tetunnel.api.tunnel.path.TePath;
-import org.onosproject.tetunnel.api.tunnel.path.TeRouteSubobject;
-import org.onosproject.tetunnel.api.tunnel.path.TeRouteUnnumberedLink;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.util.Collection;
-import java.util.List;
-import java.util.Objects;
-
-/**
- * TE Tunnel controller/processor which manages TE tunnel processing.
- * <p>
- * For example, when creating a cross-domain tunnel from a MDSC, the
- * processor will call a relevant PCE to get an end-to-end cross-domain path,
- * then spits the path into segment tunnels(domain tunnels), and then informs
- * PNCs to setup domain tunnels respectively.
- */
-@Component(immediate = true)
-public class TeTunnelCtl {
-
- private static final Logger log = LoggerFactory.getLogger(TeTunnelCtl.class);
-
- private final TunnelListener tunnelListener = new InternalTunnelListener();
-
- @Reference(cardinality = ReferenceCardinality.MANDATORY)
- protected TunnelService tunnelService;
-
- @Reference(cardinality = ReferenceCardinality.MANDATORY)
- protected TunnelAdminService tunnelAdminService;
-
- @Reference(cardinality = ReferenceCardinality.MANDATORY)
- protected TeTunnelService teTunnelService;
-
- @Reference(cardinality = ReferenceCardinality.MANDATORY)
- protected TeTunnelAdminService teTunnelAdminService;
-
- @Reference(cardinality = ReferenceCardinality.MANDATORY)
- protected TeTopologyService teTopologyService;
-
- @Reference(cardinality = ReferenceCardinality.MANDATORY)
- protected TeTunnelPceService teTunnelPceService;
-
- @Activate
- protected void activate() {
- tunnelService.addListener(tunnelListener);
-
- log.info("Started");
- }
-
- @Deactivate
- protected void deactivate() {
- tunnelService.removeListener(tunnelListener);
-
- log.info("Stopped");
- }
-
- private void addTeTunnel(TeTunnel teTunnel) {
- if (teTunnel == null) {
- return;
- }
-
- Tunnel tunnel = tunnelService.queryTunnel(
- teTunnelService.getTunnelId(teTunnel.teTunnelKey()));
- if (tunnel == null) {
- log.error("tunnel does not exist, {}", teTunnel.teTunnelKey());
- return;
- }
- if (tunnel.state() != Tunnel.State.INIT) {
- log.error("tunnel state error, {}, {}", teTunnel.teTunnelKey(),
- tunnel.state());
- return;
- }
- tunnelAdminService.updateTunnelState(tunnel, Tunnel.State.ESTABLISHING);
-
- //TODO support multi-thread
- if (isTeTunnelCrossDomain(teTunnel)) {
- if (!addCrossDomainTeTunnel(teTunnel)) {
- tunnelAdminService.updateTunnelState(tunnel, Tunnel.State.FAILED);
- }
- }
- /*
- * "else" is to do nothing.
- * When adding a single domain tunnel, the TunnelManager will call
- * tunnel providers, then the providers will pass the request to
- * the domain controller. Nothing to do here.
- */
- }
-
- private boolean isTeTunnelCrossDomain(TeTunnel teTunnel) {
- TeTopology srcTopo = teTopologyService.teTopology(
- teTopologyService.teNode(teTunnel.srcNode())
- .underlayTeTopologyId());
- TeTopology dstTopo = teTopologyService.teTopology(
- teTopologyService.teNode(teTunnel.dstNode())
- .underlayTeTopologyId());
- return (srcTopo != null && dstTopo != null
- && srcTopo.ownerId().equals(dstTopo.ownerId()));
- }
-
- private boolean addCrossDomainTeTunnel(TeTunnel teTunnel) {
- List<TeRouteSubobject> route = null;
- TePath primaryPath = teTunnel.primaryPaths().get(0);
- if (primaryPath != null &&
- primaryPath.type() == TePath.Type.EXPLICIT) {
- route = primaryPath.explicitRoute();
- } else {
- Collection<List<TeRouteSubobject>> routes =
- teTunnelPceService.computePaths(teTunnel);
- if (routes == null || routes.isEmpty()) {
- log.error("no available route for {}",
- teTunnel.teTunnelKey());
- return false;
- }
-
- //FIXME: try other pce when failed?
- route = routes.iterator().next();
- }
-
- if (route == null) {
- log.error("no available route for {}",
- teTunnel.teTunnelKey());
- return false;
- }
-
- return spitRoute(teTunnel, route);
- }
-
- //spits route to segment tunnels
- private boolean spitRoute(TeTunnel teTunnel, List<TeRouteSubobject> route) {
- List<TeTunnelKey> segmentTunnels = Lists.newArrayList();
- boolean success = true;
- TeNodeKey srcNode = teTunnel.srcNode();
- TtpKey srcTp = teTunnel.srcTp();
- TeNodeKey dstNode = null;
- TtpKey dstTp = null;
-
- for (TeRouteSubobject teRouteSubobject : route) {
- if (!(teRouteSubobject instanceof TeRouteUnnumberedLink)) {
- log.error("unsupported type {}", teRouteSubobject.type());
- success = false;
- break;
- }
-
- TeRouteUnnumberedLink teRouteUnnumberedLink =
- (TeRouteUnnumberedLink) teRouteSubobject;
- dstNode = teRouteUnnumberedLink.node();
- dstTp = teRouteUnnumberedLink.ttp();
- if (Objects.equals(srcNode, dstNode) &&
- Objects.equals(srcTp, dstTp)) {
- continue;
- }
- if (Objects.equals(srcNode, dstNode)) {
- if (!addSegmentTunnel(segmentTunnels, teTunnel,
- srcNode, srcTp, dstNode, dstTp)) {
- success = false;
- break;
- }
- }
-
- srcNode = dstNode;
- srcTp = dstTp;
- }
-
- if (success && !(Objects.equals(dstNode, teTunnel.dstNode()) &&
- Objects.equals(dstTp, teTunnel.dstTp()))) {
- srcNode = dstNode;
- srcTp = dstTp;
- dstNode = teTunnel.dstNode();
- dstTp = teTunnel.dstTp();
- if (!addSegmentTunnel(segmentTunnels, teTunnel,
- srcNode, srcTp, dstNode, dstTp)) {
- success = false;
- }
- }
-
- if (!success) {
- // roll back segment tunnels
- for (TeTunnelKey key : segmentTunnels) {
- teTunnelAdminService.removeTeTunnel(key);
- }
- } else {
- teTunnelAdminService.setSegmentTunnel(teTunnel.teTunnelKey(),
- segmentTunnels);
- }
- return success;
- }
-
- private boolean addSegmentTunnel(List<TeTunnelKey> segmentTunnels,
- TeTunnel teTunnel,
- TeNodeKey srcNode, TtpKey srcTp,
- TeNodeKey dstNode, TtpKey dstTp) {
- TeTunnelKey teTunnelKey = getNextTeTunnelKey(srcNode.teTopologyKey());
- TeTunnel teTunnelSegment = DefaultTeTunnel.builder()
- .teTunnelKey(teTunnelKey)
- .srcNode(srcNode)
- .dstNode(dstNode)
- .srcTp(srcTp)
- .dstTp(dstTp)
- .adminState(teTunnel.adminStatus())
- .lspProtectionType(teTunnel.lspProtectionType())
- .type(teTunnel.type())
- .build();
- TunnelId tunnelId =
- teTunnelAdminService.createTeTunnel(teTunnelSegment);
- if (tunnelId == null) {
- log.error("failed to create segment tunnel: {},{},{},{}",
- srcNode, srcTp, dstNode, dstTp);
- return false;
- }
- segmentTunnels.add(teTunnelKey);
- return true;
- }
-
- private TeTunnelKey getNextTeTunnelKey(TeTopologyKey key) {
- //FIXME need a better way to get a te tunnel id
- long teTunnelId = teTunnelService.getTeTunnels(key).size() + 1L;
- return new TeTunnelKey(key, teTunnelId);
- }
-
- private void updateTeTunnel(TeTunnel teTunnel, Tunnel tunnel) {
- if (teTunnel == null) {
- return;
- }
-
- if (tunnel.state() == Tunnel.State.ESTABLISHED) {
- tunnelEstablished(teTunnel);
- } else if (tunnel.state() == Tunnel.State.REMOVING) {
- removingTunnel(teTunnel);
- }
-
- //TODO update TE tunnel content
- }
-
- private void tunnelEstablished(TeTunnel teTunnel) {
- TeTunnel e2eTeTunnel = retriveE2eTunnel(teTunnel);
- if (e2eTeTunnel != null) {
- boolean goodToContinue = true;
- for (TeTunnelKey key : e2eTeTunnel.segmentTunnels()) {
- goodToContinue = checkSegmentTunnel(key);
- if (!goodToContinue) {
- break;
- }
- }
-
- if (goodToContinue) {
- tunnelAdminService.updateTunnelState(
- tunnelService.queryTunnel(
- teTunnelService.getTunnelId(
- teTunnel.teTunnelKey())),
- Tunnel.State.ESTABLISHED
- );
- }
- }
- }
-
- private TeTunnel retriveE2eTunnel(TeTunnel segmentTunnel) {
- return teTunnelService.getTeTunnel(segmentTunnel.e2eTunnelKey());
- }
-
- private boolean checkSegmentTunnel(TeTunnelKey key) {
- Tunnel segmentTunnel = tunnelService.queryTunnel(
- teTunnelService.getTunnelId(key));
- if (segmentTunnel == null ||
- segmentTunnel.state() != Tunnel.State.ESTABLISHED) {
- return false;
- }
- return true;
- }
-
- private void removingTunnel(TeTunnel teTunnel) {
- List<TeTunnelKey> segmentTunnels = teTunnel.segmentTunnels();
- if (segmentTunnels != null && !segmentTunnels.isEmpty()) {
- for (TeTunnelKey key : segmentTunnels) {
- teTunnelAdminService.removeTeTunnel(key);
- }
- }
- }
-
- // Listens on tunnel events.
- private class InternalTunnelListener implements TunnelListener {
- @Override
- public void event(TunnelEvent event) {
- switch (event.type()) {
- case TUNNEL_ADDED:
- addTunnel(event.subject());
- break;
- case TUNNEL_UPDATED:
- updateTunnel(event.subject());
- break;
- //TODO: TE Tunnel remove/... event process
- default:
- log.warn("unknown event: {}", event.type());
- break;
- }
- }
-
- private void addTunnel(Tunnel tunnel) {
- addTeTunnel(teTunnelService.getTeTunnel(tunnel.tunnelId()));
- }
-
- private void updateTunnel(Tunnel tunnel) {
- updateTeTunnel(teTunnelService.getTeTunnel(tunnel.tunnelId()),
- tunnel);
- }
- }
-}
diff --git a/apps/actn-mdsc/tetunnel-ctl/src/main/java/org/onosproject/actn/mdsc/tetunnelctl/package-info.java b/apps/actn-mdsc/tetunnel-ctl/src/main/java/org/onosproject/actn/mdsc/tetunnelctl/package-info.java
deleted file mode 100644
index e42b23e..0000000
--- a/apps/actn-mdsc/tetunnel-ctl/src/main/java/org/onosproject/actn/mdsc/tetunnelctl/package-info.java
+++ /dev/null
@@ -1,20 +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.
- */
-
-/**
- * TE Tunnel controller/processor which manages TE tunnel processing.
- */
-package org.onosproject.actn.mdsc.tetunnelctl;
\ No newline at end of file
diff --git a/apps/actn-mdsc/tetunnel-pce/src/main/java/org/onosproject/actn/mdsc/pce/TeTunnelPce.java b/apps/actn-mdsc/tetunnel-pce/src/main/java/org/onosproject/actn/mdsc/pce/TeTunnelPce.java
deleted file mode 100644
index dfc5ea3..0000000
--- a/apps/actn-mdsc/tetunnel-pce/src/main/java/org/onosproject/actn/mdsc/pce/TeTunnelPce.java
+++ /dev/null
@@ -1,58 +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.actn.mdsc.pce;
-
-import org.onosproject.tetunnel.api.tunnel.TeTunnel;
-import org.onosproject.tetunnel.api.tunnel.path.TeRouteSubobject;
-
-import java.util.Collection;
-import java.util.List;
-
-/**
- * PCE which calculates paths for TE tunnels.
- */
-public interface TeTunnelPce {
-
- static final int PRIORITY_HIGHEST = 255;
- static final int PRIORITY_HIGH = PRIORITY_HIGHEST * 3 / 4;
- static final int PRIORITY_MEDIUM = PRIORITY_HIGHEST / 2;
- static final int PRIORITY_LOW = PRIORITY_HIGHEST / 4;
- static final int PRIORITY_LOWEST = 0;
-
- /**
- * Returns priority of this PCE.
- *
- * @return priority of this PCE
- */
- int getPriority();
-
- /**
- * Signifies whether this PCE is suitable for the specified TE tunnel.
- *
- * @param teTunnel tunnel to check
- * @return true if this PCE can calculate path for the TE tunnel
- */
- boolean isSuitable(TeTunnel teTunnel);
-
- /**
- * Calculates available paths for the specified TE tunnel.
- *
- * @param teTunnel tunnel information to be calculated
- * @return available paths for the specified TE tunnel
- */
- Collection<List<TeRouteSubobject>> computePaths(TeTunnel teTunnel);
-}
diff --git a/apps/actn-mdsc/tetunnel-pce/src/main/java/org/onosproject/actn/mdsc/pce/TeTunnelPceService.java b/apps/actn-mdsc/tetunnel-pce/src/main/java/org/onosproject/actn/mdsc/pce/TeTunnelPceService.java
deleted file mode 100644
index a912c88..0000000
--- a/apps/actn-mdsc/tetunnel-pce/src/main/java/org/onosproject/actn/mdsc/pce/TeTunnelPceService.java
+++ /dev/null
@@ -1,58 +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.actn.mdsc.pce;
-
-import org.onosproject.tetunnel.api.tunnel.TeTunnel;
-import org.onosproject.tetunnel.api.tunnel.path.TeRouteSubobject;
-
-import java.util.Collection;
-import java.util.List;
-
-/**
- * TE tunnel PCE management API.
- */
-public interface TeTunnelPceService {
-
- /**
- * Calculates available paths for the specified TE tunnel.
- * <p>
- * PCE which is suitable for the specified TE tunnel and with the highest
- * priority will be chosen for the path calculation.
- *
- * @param teTunnel tunnel information to be calculated
- * @return available paths for the specified TE tunnel
- */
- Collection<List<TeRouteSubobject>> computePaths(TeTunnel teTunnel);
-
- /**
- * Calculates available paths for the specified TE tunnel with specified
- * PCE.
- *
- * @param teTunnel tunnel information to be calculated
- * @param pce PCE to be used for path calculation
- * @return available paths for the specified TE tunnel
- */
- Collection<List<TeRouteSubobject>> computePaths(TeTunnel teTunnel,
- TeTunnelPce pce);
-
- /**
- * Registers a new pce.
- *
- * @param pce new PCE to be registered.
- */
- void registerPce(TeTunnelPce pce);
-}
diff --git a/apps/actn-mdsc/tetunnel-pce/src/main/java/org/onosproject/actn/mdsc/pce/impl/DefaultTeTunnelPce.java b/apps/actn-mdsc/tetunnel-pce/src/main/java/org/onosproject/actn/mdsc/pce/impl/DefaultTeTunnelPce.java
deleted file mode 100644
index 3ff5d96..0000000
--- a/apps/actn-mdsc/tetunnel-pce/src/main/java/org/onosproject/actn/mdsc/pce/impl/DefaultTeTunnelPce.java
+++ /dev/null
@@ -1,45 +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.actn.mdsc.pce.impl;
-
-import org.onosproject.actn.mdsc.pce.TeTunnelPce;
-import org.onosproject.tetunnel.api.tunnel.TeTunnel;
-import org.onosproject.tetunnel.api.tunnel.path.TeRouteSubobject;
-
-import java.util.Collection;
-import java.util.List;
-
-/**
- * Default implementation of TE tunnel PCE.
- */
-class DefaultTeTunnelPce implements TeTunnelPce {
- @Override
- public int getPriority() {
- return PRIORITY_LOWEST - 1;
- }
-
- @Override
- public boolean isSuitable(TeTunnel teTunnel) {
- return true;
- }
-
- @Override
- public Collection<List<TeRouteSubobject>> computePaths(TeTunnel teTunnel) {
- //TODO
- return null;
- }
-}
diff --git a/apps/actn-mdsc/tetunnel-pce/src/main/java/org/onosproject/actn/mdsc/pce/impl/TeTunnelPceManager.java b/apps/actn-mdsc/tetunnel-pce/src/main/java/org/onosproject/actn/mdsc/pce/impl/TeTunnelPceManager.java
deleted file mode 100644
index a87aaa9..0000000
--- a/apps/actn-mdsc/tetunnel-pce/src/main/java/org/onosproject/actn/mdsc/pce/impl/TeTunnelPceManager.java
+++ /dev/null
@@ -1,89 +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.actn.mdsc.pce.impl;
-
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.Lists;
-import org.osgi.service.component.annotations.Activate;
-import org.osgi.service.component.annotations.Component;
-import org.osgi.service.component.annotations.Deactivate;
-import org.onosproject.actn.mdsc.pce.TeTunnelPce;
-import org.onosproject.actn.mdsc.pce.TeTunnelPceService;
-import org.onosproject.tetunnel.api.tunnel.TeTunnel;
-import org.onosproject.tetunnel.api.tunnel.path.TeRouteSubobject;
-import org.slf4j.Logger;
-import static org.slf4j.LoggerFactory.getLogger;
-
-import java.util.Collection;
-import java.util.List;
-
-/**
- * Implementation of Te Tunnel PCE service.
- */
-@Component(immediate = true, service = TeTunnelPceService.class)
-public class TeTunnelPceManager implements TeTunnelPceService {
-
- private static final Logger log = getLogger(TeTunnelPceManager.class);
-
- private List<TeTunnelPce> pces = Lists.newLinkedList();
-
- @Activate
- protected void activate() {
- pces.add(0, new DefaultTeTunnelPce());
- log.info("Started");
- }
-
- @Deactivate
- protected void deactivate() {
- log.info("Stopped");
- }
-
- @Override
- public Collection<List<TeRouteSubobject>> computePaths(TeTunnel teTunnel) {
- TeTunnelPce pce = null;
- synchronized (pces) {
- for (TeTunnelPce p : pces) {
- if (p.isSuitable(teTunnel)) {
- pce = p;
- }
- }
- }
- if (pce != null) {
- return pce.computePaths(teTunnel);
- } else {
- return ImmutableList.of();
- }
- }
-
- @Override
- public Collection<List<TeRouteSubobject>> computePaths(TeTunnel teTunnel,
- TeTunnelPce pce) {
- return pce == null ? null : pce.computePaths(teTunnel);
- }
-
- @Override
- public void registerPce(TeTunnelPce pce) {
- synchronized (pces) {
- int index = 0;
- while (pces.get(index).getPriority() > pce.getPriority()) {
- index++;
- }
-
- pces.add(index, pce);
- }
- }
-}
diff --git a/apps/actn-mdsc/tetunnel-pce/src/main/java/org/onosproject/actn/mdsc/pce/impl/package-info.java b/apps/actn-mdsc/tetunnel-pce/src/main/java/org/onosproject/actn/mdsc/pce/impl/package-info.java
deleted file mode 100644
index 670d279..0000000
--- a/apps/actn-mdsc/tetunnel-pce/src/main/java/org/onosproject/actn/mdsc/pce/impl/package-info.java
+++ /dev/null
@@ -1,20 +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.
- */
-
-/**
- * Implementation of TE tunnel PCE service.
- */
-package org.onosproject.actn.mdsc.pce.impl;
\ No newline at end of file
diff --git a/apps/actn-mdsc/tetunnel-pce/src/main/java/org/onosproject/actn/mdsc/pce/package-info.java b/apps/actn-mdsc/tetunnel-pce/src/main/java/org/onosproject/actn/mdsc/pce/package-info.java
deleted file mode 100644
index 3e6de36..0000000
--- a/apps/actn-mdsc/tetunnel-pce/src/main/java/org/onosproject/actn/mdsc/pce/package-info.java
+++ /dev/null
@@ -1,20 +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.
- */
-
-/**
- * PCE service which calculates paths for TE tunnels.
- */
-package org.onosproject.actn.mdsc.pce;
\ No newline at end of file
diff --git a/apps/gluon/BUILD b/apps/gluon/BUILD
deleted file mode 100644
index 4e4099f..0000000
--- a/apps/gluon/BUILD
+++ /dev/null
@@ -1,29 +0,0 @@
-COMPILE_DEPS = CORE_DEPS + JACKSON + CLI + [
- "@httpclient_osgi//jar",
- "@httpcore_osgi//jar",
- "@org_apache_httpcomponents_httpasyncclient_osgi//jar",
- "@org_apache_httpcomponents_httpcore_nio//jar",
- "@org_apache_karaf_jaas//jar",
-]
-
-BUNDLES = [
- ":onos-apps-gluon",
- "@httpclient_osgi//jar",
- "@httpcore_osgi//jar",
- "@org_apache_httpcomponents_httpasyncclient_osgi//jar",
- "@org_apache_httpcomponents_httpcore_nio//jar",
-]
-
-osgi_jar_with_tests(
- karaf_command_packages = ["org.onosproject.gluon.rsc.cli"],
- deps = COMPILE_DEPS,
-)
-
-onos_app(
- app_name = "org.onosproject.gluon",
- category = "Monitoring",
- description = "To fetch data from Gluon Server over Http session.",
- included_bundles = BUNDLES,
- title = "Gluon Shim",
- url = "http://onosproject.org",
-)
diff --git a/apps/gluon/src/main/java/org/onosproject/gluon/manager/GluonManager.java b/apps/gluon/src/main/java/org/onosproject/gluon/manager/GluonManager.java
deleted file mode 100644
index 1d8b32a..0000000
--- a/apps/gluon/src/main/java/org/onosproject/gluon/manager/GluonManager.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * Copyright 2017-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.gluon.manager;
-
-import org.osgi.service.component.annotations.Activate;
-import org.osgi.service.component.annotations.Component;
-import org.osgi.service.component.annotations.Deactivate;
-import org.osgi.service.component.annotations.Reference;
-import org.osgi.service.component.annotations.ReferenceCardinality;
-import org.onosproject.core.CoreService;
-import org.onosproject.gluon.rsc.GluonConfig;
-import org.onosproject.gluon.rsc.GluonServer;
-import org.onosproject.net.config.ConfigFactory;
-import org.onosproject.net.config.NetworkConfigRegistry;
-import org.onosproject.net.config.basics.SubjectFactories;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.util.LinkedHashMap;
-import java.util.Map;
-
-/**
- * Gluon Shim Application.
- */
-@Component(immediate = true)
-public class GluonManager {
-
- private final Logger log = LoggerFactory.getLogger(getClass());
- private static final String APP_ID = "org.onosproject.gluon";
-
- @Reference(cardinality = ReferenceCardinality.MANDATORY)
- protected CoreService coreService;
-
- @Reference(cardinality = ReferenceCardinality.MANDATORY)
- protected NetworkConfigRegistry configRegistry;
-
-
- private final ConfigFactory configFactory =
- new ConfigFactory(SubjectFactories.APP_SUBJECT_FACTORY,
- GluonConfig.class, "gluon") {
- @Override
- public GluonConfig createConfig() {
- return new GluonConfig();
- }
- };
-
- private static Map<String, GluonServer> serverMap = new LinkedHashMap<>();
-
- @Activate
- public void activate() {
- coreService.registerApplication(APP_ID);
- configRegistry.registerConfigFactory(configFactory);
- log.info("Gluon app Started");
- }
-
- @Deactivate
- public void deactivate() {
- configRegistry.unregisterConfigFactory(configFactory);
- log.info("Gluon app Stopped");
- }
-
- /**
- * Creating gluon server object.
- *
- * @param etcduri server url
- * @param targetProtonKey server key type, default net-l3vpn
- * @param mode server mode start or stop
- * @param version running server version
- */
- public static void createServer(String etcduri, String targetProtonKey,
- String mode, String version) {
- new GluonServer(etcduri, targetProtonKey, mode, version);
- }
-
- /**
- * Deleting gluon server from server list.
- *
- * @param etcduri server url
- */
- public static void deleteServer(String etcduri) {
- for (Map.Entry<String, GluonServer> server : serverMap.entrySet()) {
- if (etcduri.equals(server.getKey())) {
- serverMap.remove(etcduri);
- return;
- }
- }
- }
-
- /**
- * Add server into map.
- *
- * @param etcduri server url
- * @param gluonObject store server object
- */
- public static void addServer(String etcduri, GluonServer gluonObject) {
- serverMap.put(etcduri, gluonObject);
- }
-
- /**
- * Returns serverMap size.
- *
- * @return total number of servers
- */
- public static int getTotalServers() {
- return serverMap.size();
- }
-
- /**
- * Returns all server IPs.
- *
- * @return serverMap
- */
- public static Map<String, GluonServer> getAllServersIP() {
- return serverMap;
- }
-
-
-}
\ No newline at end of file
diff --git a/apps/gluon/src/main/java/org/onosproject/gluon/manager/package-info.java b/apps/gluon/src/main/java/org/onosproject/gluon/manager/package-info.java
deleted file mode 100644
index d20ea1a..0000000
--- a/apps/gluon/src/main/java/org/onosproject/gluon/manager/package-info.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright 2017-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.
- */
-
-/**
- * Gluon Shim Application manager class.
- */
-package org.onosproject.gluon.manager;
\ No newline at end of file
diff --git a/apps/gluon/src/main/java/org/onosproject/gluon/rsc/GluonConfig.java b/apps/gluon/src/main/java/org/onosproject/gluon/rsc/GluonConfig.java
deleted file mode 100644
index 70f944a..0000000
--- a/apps/gluon/src/main/java/org/onosproject/gluon/rsc/GluonConfig.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Copyright 2017-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.gluon.rsc;
-
-import com.fasterxml.jackson.databind.JsonNode;
-import org.onosproject.net.config.Config;
-
-/**
- * Representation of a Etcd response.
- */
-public class GluonConfig extends Config<String> {
- public String action;
- public String key;
- public JsonNode value;
- long modifiedIndex;
- long createdIndex;
-
- public GluonConfig() {
- }
-
- /**
- * Gluon configuration data model.
- *
- * @param action operation type
- * @param key proton key
- * @param value proton value
- * @param mIndex modified time
- * @param cIndex created time
- */
- public GluonConfig(String action, String key, JsonNode value, long mIndex,
- long cIndex) {
- this.action = action;
- this.key = key;
- this.value = value;
- this.modifiedIndex = mIndex;
- this.createdIndex = cIndex;
- }
-
- /**
- * Sets the etcdresponse used by network config.
- *
- * @param gluonConfig Etcdresponse data after parsing
- */
- public void setEtcdResponse(GluonConfig gluonConfig) {
- object.put(gluonConfig.key, gluonConfig.value);
- }
-
- @Override
- public String toString() {
- return "GluonConfig{" +
- "action='" + action + '\'' +
- ", key='" + key + '\'' +
- ", value=" + value +
- ", modifiedIndex=" + modifiedIndex +
- ", createdIndex=" + createdIndex +
- '}';
- }
-}
diff --git a/apps/gluon/src/main/java/org/onosproject/gluon/rsc/GluonConstants.java b/apps/gluon/src/main/java/org/onosproject/gluon/rsc/GluonConstants.java
deleted file mode 100644
index 3b41030..0000000
--- a/apps/gluon/src/main/java/org/onosproject/gluon/rsc/GluonConstants.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * Copyright 2017-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.gluon.rsc;
-
-/**
- * Gluon application related constants.
- */
-
-public final class GluonConstants {
-
- protected GluonConstants() {
- }
-
- /**
- * String constants.
- */
- public static final String KEYS = "/keys";
- public static final String PROTON = "/proton/";
- public static final String MODE_STOP = "stop";
- public static final String MODE_START = "start";
- public static final String ACTION_SET = "set";
- public static final String ACTION_GET = "get";
- public static final String ACTION_DEL = "delete";
- public static final String GLUON_HTTP = "http://";
- public static final String KEY_TYPE = "net-l3vpn";
- public static final String GLUON_ACTION = "action";
- public static final String GLUON_KEY = "key";
- public static final String GLUON_NODE = "node";
- public static final String GLUON_NODES = "nodes";
- public static final String GLUON_VALUE = "value";
- public static final String GLUON_MOD_INDEX = "modifiedIndex";
- public static final String GLUON_CREATE_INDEX = "createdIndex";
- public static final String GLUON_DEFAULT_PORT = "2379";
-
- /**
- * INFO Constants.
- */
- public static final String BATCH_SERVICE_STATUS =
- "executorBatchService shutdown status: {}";
- public static final String REAL_TIME_SERVICE_STATUS =
- "executorRealTimeService shutdown status: {}";
- public static final String SERVER_RUNNING =
- "Server is already running";
- public static final String ACTIVE_SERVER =
- "Number of active servers: {}";
- public static final String NO_SUBKEYS_AVAIL =
- "No subKeys available. Nothing to smooth";
- public static final String SERVER_STOPPED =
- "Server has stopped successfully";
- public static final String NO_SERVER_AVAIL =
- "Server is unavailable";
- public static final String NO_SERVER_AVAIL_ON_PORT =
- "Server is unavailable on specified port";
- public static final String REAL_TIME_PROCESSING =
- "Started Real time etcd monitoring for {}";
- public static final String BATCH_PROCESSING =
- "Started Batch time etcd monitoring for {}";
- public static final String BATCH_QUERING =
- "Sending Batch time etcd request for {}";
- public static final String BATCH_STOPPED =
- "Stopped Batch time etcd monitoring for {}";
- public static final String REAL_TIME_RECEIVED =
- "Received RealTime etcd monitor data {}";
- public static final String BATCH_RECEIVED =
- "Received batch etcd monitor data {}";
- public static final String SUBKEYS_RECEIVED =
- "Recieved subkeys {}";
- public static final String INVALID_ACTION =
- "Invalid action has been received";
- public static final String DATA_UPDATED =
- "Gluon data updated to network config datastore";
- public static final String DATA_REMOVED =
- "Gluon data removed from network config datastore";
- public static final String SERVER_POOL =
- "Server IP is not available in server pool";
- public static final String PROTON_KEY_SUPPORT =
- "Currently only net-l3vpn type supported";
- public static final String WRONG_INPUT = "Either server is not available " +
- "or wrong input";
- public static final String WRONG_INPUT_TYPE = "Wrong format type";
- public static final String INVALID_MODE = "Invalid mode";
- public static final String WRONG_IP_FORMAT = "Wrong IP address format";
- public static final String INVALID_RANGE = "Wrong port range <1-65535>";
- public static final String PROCESSING_FAILED = "Error occurred while " +
- "processing";
-
- /**
- * ERROR Constants.
- */
- public static final String E_BATCH_PROCESSING =
- "Batch mode etcd monitor failed with error {}";
- public static final String E_BATCH_PROCESSING_URL =
- "Batch mode etcd monitor failed for {}";
- public static final String E_SUBKEYS_PROCESSING =
- "Error observed while fetching subkeys for {}";
- public static final String E_REAL_TIME_PROCESSING =
- "Real time etcd monitor failed with error {}";
- public static final String E_CLIENT_STOP =
- "http client unable to stop with error {}";
-
- /**
- * Integer Constants.
- */
- public static final int STATUS_CODE = 200;
-
-}
diff --git a/apps/gluon/src/main/java/org/onosproject/gluon/rsc/GluonServer.java b/apps/gluon/src/main/java/org/onosproject/gluon/rsc/GluonServer.java
deleted file mode 100644
index 031ba69..0000000
--- a/apps/gluon/src/main/java/org/onosproject/gluon/rsc/GluonServer.java
+++ /dev/null
@@ -1,537 +0,0 @@
-/*
- * Copyright 2017-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.gluon.rsc;
-
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import org.apache.http.HttpResponse;
-import org.apache.http.StatusLine;
-import org.apache.http.client.HttpClient;
-import org.apache.http.client.config.RequestConfig;
-import org.apache.http.client.methods.HttpGet;
-import org.apache.http.concurrent.FutureCallback;
-import org.apache.http.impl.client.HttpClientBuilder;
-import org.apache.http.impl.nio.client.CloseableHttpAsyncClient;
-import org.apache.http.impl.nio.client.HttpAsyncClients;
-import org.apache.http.util.EntityUtils;
-import org.onlab.osgi.DefaultServiceDirectory;
-import org.onosproject.net.config.NetworkConfigService;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.IOException;
-import java.net.URI;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-
-import static org.onlab.util.Tools.groupedThreads;
-import static org.onosproject.gluon.manager.GluonManager.addServer;
-import static org.onosproject.gluon.manager.GluonManager.deleteServer;
-import static org.onosproject.gluon.manager.GluonManager.getAllServersIP;
-import static org.onosproject.gluon.rsc.GluonConstants.ACTION_DEL;
-import static org.onosproject.gluon.rsc.GluonConstants.ACTION_GET;
-import static org.onosproject.gluon.rsc.GluonConstants.ACTION_SET;
-import static org.onosproject.gluon.rsc.GluonConstants.ACTIVE_SERVER;
-import static org.onosproject.gluon.rsc.GluonConstants.BATCH_PROCESSING;
-import static org.onosproject.gluon.rsc.GluonConstants.BATCH_QUERING;
-import static org.onosproject.gluon.rsc.GluonConstants.BATCH_RECEIVED;
-import static org.onosproject.gluon.rsc.GluonConstants.BATCH_SERVICE_STATUS;
-import static org.onosproject.gluon.rsc.GluonConstants.BATCH_STOPPED;
-import static org.onosproject.gluon.rsc.GluonConstants.DATA_REMOVED;
-import static org.onosproject.gluon.rsc.GluonConstants.DATA_UPDATED;
-import static org.onosproject.gluon.rsc.GluonConstants.E_BATCH_PROCESSING;
-import static org.onosproject.gluon.rsc.GluonConstants.E_BATCH_PROCESSING_URL;
-import static org.onosproject.gluon.rsc.GluonConstants.E_CLIENT_STOP;
-import static org.onosproject.gluon.rsc.GluonConstants.E_REAL_TIME_PROCESSING;
-import static org.onosproject.gluon.rsc.GluonConstants.E_SUBKEYS_PROCESSING;
-import static org.onosproject.gluon.rsc.GluonConstants.GLUON_ACTION;
-import static org.onosproject.gluon.rsc.GluonConstants.GLUON_CREATE_INDEX;
-import static org.onosproject.gluon.rsc.GluonConstants.GLUON_KEY;
-import static org.onosproject.gluon.rsc.GluonConstants.GLUON_MOD_INDEX;
-import static org.onosproject.gluon.rsc.GluonConstants.GLUON_NODE;
-import static org.onosproject.gluon.rsc.GluonConstants.GLUON_NODES;
-import static org.onosproject.gluon.rsc.GluonConstants.GLUON_VALUE;
-import static org.onosproject.gluon.rsc.GluonConstants.INVALID_ACTION;
-import static org.onosproject.gluon.rsc.GluonConstants.KEYS;
-import static org.onosproject.gluon.rsc.GluonConstants.MODE_START;
-import static org.onosproject.gluon.rsc.GluonConstants.MODE_STOP;
-import static org.onosproject.gluon.rsc.GluonConstants.NO_SERVER_AVAIL;
-import static org.onosproject.gluon.rsc.GluonConstants.NO_SUBKEYS_AVAIL;
-import static org.onosproject.gluon.rsc.GluonConstants.PROCESSING_FAILED;
-import static org.onosproject.gluon.rsc.GluonConstants.PROTON;
-import static org.onosproject.gluon.rsc.GluonConstants.REAL_TIME_PROCESSING;
-import static org.onosproject.gluon.rsc.GluonConstants.REAL_TIME_RECEIVED;
-import static org.onosproject.gluon.rsc.GluonConstants.REAL_TIME_SERVICE_STATUS;
-import static org.onosproject.gluon.rsc.GluonConstants.SERVER_RUNNING;
-import static org.onosproject.gluon.rsc.GluonConstants.SERVER_STOPPED;
-import static org.onosproject.gluon.rsc.GluonConstants.STATUS_CODE;
-import static org.onosproject.gluon.rsc.GluonConstants.SUBKEYS_RECEIVED;
-
-
-public class GluonServer {
-
- private String protonKeyUri;
- private String serverUri;
-
- private CloseableHttpAsyncClient httpClient;
-
- //store gluon server supported subkeys
- private List<String> subKeys = new LinkedList<>();
-
- // Lists of gluon servers
- public Map<String, GluonServer> serverMap = getAllServersIP();
-
- private final Logger log = LoggerFactory.getLogger(getClass());
-
- // Real time executor thread
- private final ExecutorService executorRealTimeService = Executors
- .newSingleThreadExecutor(groupedThreads("EtcdRealTimeMonitor",
- "executor-%d", log));
- // Batch executor thread
- private final ExecutorService executorBatchService = Executors
- .newSingleThreadExecutor(groupedThreads("EtcdBatchMonitor",
- "executor-%d", log));
-
- // Statistics counter
- private int setCount = 0;
- private int delCount = 0;
- private int getCount = 0;
- // Server etcd version
- public String version;
-
- /**
- * To get Gluon server running version, needs to create at-least one object.
- */
- public GluonServer() {
- }
-
- /**
- * Realising server functionality.
- *
- * @param etcduri server url
- * @param targetProtonKey server key type, default net-l3vpn
- * @param mode server mode start or stop
- * @param version running server version
- */
- public GluonServer(String etcduri, String targetProtonKey,
- String mode, String version) {
- this.version = version;
-
- switch (mode) {
- // Handling stop mode
- case MODE_STOP:
- // return if server is not available into the server list
- if (!serverMap.containsKey(etcduri)) {
- log.debug(NO_SERVER_AVAIL);
- return;
- }
- try {
- // stop batch service executor thread
- log.debug(BATCH_SERVICE_STATUS,
- executorBatchService.isShutdown());
- executorBatchService.shutdown();
- // stop real time service executor thread
- log.debug(REAL_TIME_SERVICE_STATUS,
- executorRealTimeService.isShutdown());
- executorRealTimeService.shutdown();
- // closing http client
- httpClient.close();
- } catch (IOException io) {
- log.error(E_CLIENT_STOP, io.getMessage());
- }
- // deletes server from gluon server list
- deleteServer(etcduri);
- log.debug(SERVER_STOPPED);
- return;
- // Handling start mode
- case MODE_START:
- if (serverMap.containsKey(etcduri)) {
- //Returns user CLI if server is already running
- // and logs all server info into log files
- log.info(SERVER_RUNNING);
- log.debug(ACTIVE_SERVER, serverMap.size());
- return;
- }
- // Store gluon manager object and gluon server url
- addServer(etcduri, this);
- // Preparing server uri
- serverUri = etcduri + "/v2" + KEYS;
- // Preparing server subkeys uri
- protonKeyUri = PROTON + targetProtonKey;
- // Starts http client
- RequestConfig requestConfig = RequestConfig.custom().build();
- httpClient = HttpAsyncClients.custom()
- .setDefaultRequestConfig(requestConfig).build();
- httpClient.start();
-
- // Start thread to handle and process RealTime data
- handleRealTimeData(null);
-
- // Start thread to handle and process batch data,
- // iff subkeys are available
- getAllProtonSubkeys(serverUri + protonKeyUri);
- if (getProtonSubkeys().isEmpty()) {
- log.debug(NO_SUBKEYS_AVAIL);
- return;
- }
- // handle RealTime data
- handleBatchData(0);
- return;
- default:
- log.debug(INVALID_ACTION);
-
- }
- }
-
- /**
- * Handles real time data which is received from Gluon server.
- *
- * @param index, It will be used in recursive call of
- * real time monitoring method.
- * modified index receive from GluonConfig config file
- */
- private void handleRealTimeData(Long index) {
- String realTimeUri = serverUri + protonKeyUri +
- "/?wait=true&recursive=true";
- if (index != null) {
- realTimeUri += "&waitIndex=" + index;
- }
- HttpGet request = new HttpGet(URI.create(realTimeUri));
- log.info(REAL_TIME_PROCESSING, realTimeUri);
- // Starts real time executor thread
- executorRealTimeService.execute(new Runnable() {
- public void run() {
- try {
- httpClient.execute(
- request, new FutureCallback<HttpResponse>() {
-
- @Override
- public void completed(HttpResponse result) {
- StatusLine statusLine =
- result.getStatusLine();
- int statusCode = statusLine.getStatusCode();
- if (statusCode ==
- STATUS_CODE &&
- result.getEntity() != null) {
- try {
- String json = EntityUtils
- .toString(result.getEntity());
- GluonConfig response =
- processRealTimeResponse(json);
- // Recursive call to handle
- // real time data
- handleRealTimeData(
- response.modifiedIndex + 1);
- } catch (IOException e) {
- failed(e);
- }
- } else {
- log.error(E_REAL_TIME_PROCESSING);
- }
- }
-
- @Override
- public void cancelled() {
- log.debug("Nothing to do with " +
- "this overridden method");
- }
-
- @Override
- public void failed(Exception e) {
- log.error(E_REAL_TIME_PROCESSING,
- e.getMessage());
- }
- });
- } catch (Exception e) {
- log.error(E_REAL_TIME_PROCESSING, e.getMessage());
- }
- }
- });
- }
-
-
- /**
- * Handles batch data which is received from Gluon server.
- *
- * @param subKeyIndex gets all proton subkey value
- */
- private void handleBatchData(int subKeyIndex) {
- String currBatchUri = serverUri + getProtonSubkeys().get(subKeyIndex);
- HttpGet request = new HttpGet(URI.create(currBatchUri));
-
- if (0 == subKeyIndex) {
- log.debug(BATCH_PROCESSING, protonKeyUri);
- }
- log.info(BATCH_QUERING, currBatchUri);
- // Starts batch executor thread
- executorBatchService.execute(new Runnable() {
- public void run() {
- try {
- httpClient.execute(request, new FutureCallback<HttpResponse>() {
- @Override
- public void completed(HttpResponse result) {
- StatusLine statusLine = result.getStatusLine();
- int statusCode = statusLine.getStatusCode();
- if (statusCode == STATUS_CODE &&
- result.getEntity() != null) {
- try {
- String json = EntityUtils
- .toString(result.getEntity());
- processBatchResponse(json);
- // Stop batch executor thread
- // once all gluon server subkeys processed
- if (subKeyIndex ==
- ((getProtonSubkeys().size()) - 1)) {
- cancelled();
- return;
- }
-
- handleBatchData(subKeyIndex + 1);
- } catch (IOException e) {
- failed(e);
- }
- } else {
- log.error(E_BATCH_PROCESSING_URL, currBatchUri);
- }
- }
-
- @Override
- public void cancelled() {
- executorBatchService.shutdown();
- log.debug(BATCH_STOPPED, protonKeyUri);
- }
-
- @Override
- public void failed(Exception e) {
- log.error(E_BATCH_PROCESSING, e.getMessage());
- }
- });
- } catch (Exception e) {
- log.error(E_BATCH_PROCESSING, e.getMessage());
- }
- }
- });
- }
-
- /**
- * Parse and process real time json data which is received from Gluon server.
- *
- * @param result real time json data
- * @return GluonConfig response
- */
- public GluonConfig processRealTimeResponse(String result) {
- ObjectMapper mapper = new ObjectMapper();
- GluonConfig response = null;
- try {
- log.info(REAL_TIME_RECEIVED, result);
- JsonNode jsonNode = mapper.readTree(result);
- String action = jsonNode.get(GLUON_ACTION).asText();
- String key = jsonNode.get(GLUON_NODE).get(GLUON_KEY).asText();
- long mIndex = jsonNode.get(GLUON_NODE)
- .get(GLUON_MOD_INDEX).asLong();
- long cIndex = jsonNode.get(GLUON_NODE)
- .get(GLUON_CREATE_INDEX).asLong();
- if (action.equals(ACTION_SET)) {
- String value = jsonNode.get(GLUON_NODE)
- .get(GLUON_VALUE).asText();
- JsonNode modifyValue = mapper.readTree(value.replace("\\", ""));
- response = new GluonConfig(action, key, modifyValue, mIndex,
- cIndex);
- setCount++;
- } else if (action.equals(ACTION_DEL)) {
- response = new GluonConfig(action, key, null, mIndex, cIndex);
- delCount++;
- } else {
- log.debug(INVALID_ACTION);
- }
- } catch (IOException e) {
- log.error(E_REAL_TIME_PROCESSING, e.getMessage());
- }
- processEtcdResponse(response);
- return response;
- }
-
- /**
- * Parse and process batch json data which is received from Gluon server.
- *
- * @param result batch json data
- * @return GluonConfig response
- */
- public GluonConfig processBatchResponse(String result) {
- ObjectMapper mapper = new ObjectMapper();
- GluonConfig response = null;
- try {
- log.debug(BATCH_RECEIVED, result);
- JsonNode jsonNode = mapper.readTree(result);
- log.info("JSON NODE VALUE ARE: {}", jsonNode);
- String action = jsonNode.get(GLUON_ACTION).asText();
- JsonNode nodes = jsonNode.get(GLUON_NODE).get(GLUON_NODES);
- if (null != nodes) {
- for (JsonNode confNode : nodes) {
- String key = confNode.get(GLUON_KEY).asText();
- long mIndex = confNode.get(GLUON_MOD_INDEX).asLong();
- long cIndex = confNode.get(GLUON_CREATE_INDEX).asLong();
- String value = confNode.get(GLUON_VALUE).asText();
- log.info("JSON NODE VALUE ARE 2: {}", value);
- JsonNode modifyValue = mapper.readTree(value.replace("\\", ""));
- log.info("JSON NODE MODIFY VALUE ARE 2: {}", modifyValue);
- response = new GluonConfig(action, key,
- modifyValue, mIndex, cIndex);
- getCount++;
- processEtcdResponse(response);
-
- }
- }
- } catch (IOException e) {
- log.error(E_BATCH_PROCESSING, e.getMessage());
- }
- return response;
- }
-
- /**
- * Gets all the proton subkeys from Gluon server.
- *
- * @param subKeyUrl get every proton subkey Url
- */
- public void getAllProtonSubkeys(String subKeyUrl) {
- HttpClient client = HttpClientBuilder.create().build();
- HttpGet request = new HttpGet(subKeyUrl);
- ObjectMapper mapper = new ObjectMapper();
- try {
- HttpResponse result = client.execute(request);
- StatusLine statusLine = result.getStatusLine();
- int statusCode = statusLine.getStatusCode();
- if (statusCode == STATUS_CODE && result.getEntity() != null) {
- String json = EntityUtils
- .toString(result.getEntity());
- log.debug(SUBKEYS_RECEIVED, json);
- JsonNode jsonNode = mapper.readTree(json);
- JsonNode nodes = jsonNode.get(GLUON_NODE).get(GLUON_NODES);
-
- for (JsonNode confNode : nodes) {
- String key = confNode.get(GLUON_KEY).asText();
- storeProtonSubkey(key);
- }
- }
- } catch (IOException e) {
- log.error(E_SUBKEYS_PROCESSING, subKeyUrl);
- }
- return;
- }
-
- /**
- * Gets all the proton subkeys from Gluon server.
- *
- * @param uri get every proton subkey Url
- * @return version server version
- */
- public String getGluonServerVersion(String uri) {
- HttpClient client = HttpClientBuilder.create().build();
- HttpGet request = new HttpGet(uri);
- ObjectMapper mapper = new ObjectMapper();
- String version = null;
- try {
- HttpResponse result = client.execute(request);
- StatusLine statusLine = result.getStatusLine();
- int statusCode = statusLine.getStatusCode();
- if (statusCode == STATUS_CODE && result.getEntity() != null) {
- String json = EntityUtils
- .toString(result.getEntity());
- JsonNode jsonNode = mapper.readTree(json);
- version = jsonNode.get("etcdserver").asText();
- }
- } catch (IOException e) {
- log.error(PROCESSING_FAILED);
- }
- return version;
- }
-
- /**
- * Gluon data updating and deleting into/from NetworkConfig datastore.
- * config.apply will raise GluonConfig.class event for add,
- * get and delete operations.
- *
- * @param gluonConfigMessage Etcdresponse data after parsing
- */
- public void processEtcdResponse(GluonConfig gluonConfigMessage) {
-
- NetworkConfigService configService =
- DefaultServiceDirectory.getService(NetworkConfigService.class);
- if (gluonConfigMessage.action.equals(ACTION_SET) ||
- gluonConfigMessage.action.equals(ACTION_GET)) {
- GluonConfig config = configService
- .addConfig(gluonConfigMessage.key, GluonConfig.class);
- config.setEtcdResponse(gluonConfigMessage);
- config.apply();
- log.info(DATA_UPDATED);
- } else if (gluonConfigMessage.action.equals(ACTION_DEL)) {
- configService.removeConfig(gluonConfigMessage.key,
- GluonConfig.class);
- log.info(DATA_REMOVED);
- } else {
- log.info(INVALID_ACTION);
- }
- }
-
- /**
- * Returns set statistics.
- *
- * @return setCount
- */
- public int getSetCount() {
- return setCount;
- }
-
- /**
- * Returns get statistics.
- *
- * @return getCount
- */
- public int getGetCount() {
- return getCount;
- }
-
- /**
- * Returns delete statistics.
- *
- * @return delCount
- */
- public int getDelCount() {
- return delCount;
- }
-
- /**
- * Returns proton subkeys.
- *
- * @return subkeys
- */
- public List<String> getProtonSubkeys() {
- return subKeys;
- }
-
- /**
- * store proton subkeys.
- *
- * @param keys proton subkey
- */
- public void storeProtonSubkey(String keys) {
- subKeys.add(keys);
- }
-}
-
diff --git a/apps/gluon/src/main/java/org/onosproject/gluon/rsc/cli/GluonServerCommand.java b/apps/gluon/src/main/java/org/onosproject/gluon/rsc/cli/GluonServerCommand.java
deleted file mode 100644
index e5fdab7..0000000
--- a/apps/gluon/src/main/java/org/onosproject/gluon/rsc/cli/GluonServerCommand.java
+++ /dev/null
@@ -1,233 +0,0 @@
-/*
- * Copyright 2017-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.gluon.rsc.cli;
-
-import org.apache.karaf.shell.api.action.Command;
-import org.apache.karaf.shell.api.action.Option;
-import org.apache.karaf.shell.api.action.lifecycle.Service;
-import org.onosproject.cli.AbstractShellCommand;
-import org.onosproject.gluon.rsc.GluonServer;
-
-import java.io.IOException;
-import java.net.InetAddress;
-import java.net.URL;
-import java.net.URLConnection;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import static org.onosproject.gluon.manager.GluonManager.createServer;
-import static org.onosproject.gluon.rsc.GluonConstants.GLUON_DEFAULT_PORT;
-import static org.onosproject.gluon.rsc.GluonConstants.GLUON_HTTP;
-import static org.onosproject.gluon.rsc.GluonConstants.INVALID_MODE;
-import static org.onosproject.gluon.rsc.GluonConstants.INVALID_RANGE;
-import static org.onosproject.gluon.rsc.GluonConstants.KEY_TYPE;
-import static org.onosproject.gluon.rsc.GluonConstants.MODE_START;
-import static org.onosproject.gluon.rsc.GluonConstants.MODE_STOP;
-import static org.onosproject.gluon.rsc.GluonConstants.NO_SERVER_AVAIL;
-import static org.onosproject.gluon.rsc.GluonConstants.NO_SERVER_AVAIL_ON_PORT;
-import static org.onosproject.gluon.rsc.GluonConstants.PROTON_KEY_SUPPORT;
-import static org.onosproject.gluon.rsc.GluonConstants.WRONG_INPUT;
-import static org.onosproject.gluon.rsc.GluonConstants.WRONG_INPUT_TYPE;
-import static org.onosproject.gluon.rsc.GluonConstants.WRONG_IP_FORMAT;
-
-
-/**
- * To monitor Gluon etcd server.
- */
-@Service
-@Command(scope = "onos", name = "gluon",
- description = "Support for reading Gluon data via etcd client")
-public class GluonServerCommand extends AbstractShellCommand {
-
- @Option(name = "-m", aliases = "--mode",
- description = "Gluon server monitoring mode: start; stop",
- required = false, multiValued = false)
- String mode = MODE_START;
-
- @Option(name = "-i", aliases = "--server-ip",
- description = "Gluon server ip address",
- required = true, multiValued = false)
- String ipAddress = null;
-
- @Option(name = "-p", aliases = "--port", description = "Gluon server port",
- required = false, multiValued = false)
- String port = GLUON_DEFAULT_PORT;
-
- @Option(name = "-k", aliases = "--key",
- description = "Proton key : net-l3vpn",
- required = false, multiValued = false)
- String protonKey = KEY_TYPE;
-
- public String version = null;
-
- @Override
- protected void doExecute() {
- try {
- if (ipAddress != null && isValidIP(ipAddress) && isValidPort(port)
- && isValidMode(mode) && isValidProtonKey(protonKey)
- && isSeverReachable()) {
- String url = GLUON_HTTP + ipAddress + ":" + port;
- if (isEtcdSeverAvailable()) {
- //Gets gluon server running version
- version = gluonServerVersion();
- createServer(url, protonKey, mode, version);
- } else {
- log.info(NO_SERVER_AVAIL_ON_PORT);
- return;
- }
- } else {
- log.info(WRONG_INPUT);
- }
- } catch (Exception e) {
- print(null, e.getMessage());
- }
- }
-
- /**
- * Returns boolean if given IP format is valid.
- *
- * @param ipAddr Ip Address
- * @return boolean
- */
- public boolean isValidIP(String ipAddr) {
- boolean isIPaddrValid;
- Pattern pattern = Pattern.compile("^(\\d{1,3})\\" +
- ".(\\d{1,3})\\" +
- ".(\\d{1,3})\\.(\\d{1,3})$");
- Matcher matcher = pattern.matcher(ipAddr);
- if (matcher.find()) {
- isIPaddrValid = true;
- } else {
- print(WRONG_IP_FORMAT);
- isIPaddrValid = false;
- }
- return isIPaddrValid;
- }
-
- /**
- * Returns boolean if given port value is valid.
- *
- * @param portValue port number
- * @return boolean
- */
- public boolean isValidPort(String portValue) {
- boolean isPortValid = false;
- try {
- Integer portNum = Integer.parseInt(portValue);
- if (portNum >= 0 && portNum <= 65535) {
- isPortValid = true;
- } else {
- print(INVALID_RANGE);
- isPortValid = false;
- }
- } catch (NumberFormatException nfe) {
- print(WRONG_INPUT_TYPE);
- }
- return isPortValid;
- }
-
- /**
- * Returns boolean if given mode is valid.
- *
- * @param mode server mode
- * @return boolean
- */
- public boolean isValidMode(String mode) {
- boolean isValidMode;
- if (mode.equalsIgnoreCase(MODE_START) ||
- mode.equalsIgnoreCase(MODE_STOP)) {
- isValidMode = true;
- } else {
- print(INVALID_MODE);
- isValidMode = false;
- }
- return isValidMode;
- }
-
- /**
- * Returns boolean if given mode is valid.
- *
- * @param key key
- * @return boolean
- */
- public boolean isValidProtonKey(String key) {
- boolean isValidProtonKey = true;
- if (!KEY_TYPE.equalsIgnoreCase(key)) {
- print(PROTON_KEY_SUPPORT);
- isValidProtonKey = false;
- }
- return isValidProtonKey;
- }
-
- /**
- * Returns version of gluon server.
- *
- * @return String
- */
-
- public String gluonServerVersion() {
- String serverUrl = GLUON_HTTP + this.ipAddress + ":" +
- this.port + "/version";
- GluonServer gluonServer = new GluonServer();
- String gluonversion = gluonServer.getGluonServerVersion(serverUrl);
- String[] versionArray = gluonversion.split("\\.");
- version = versionArray[0];
- return version;
- }
-
- /**
- * Returns reachability of Gluon server.
- *
- * @return isSeverReachable
- */
- public boolean isSeverReachable() {
- boolean isSeverReachable = false;
- try {
- InetAddress inet = InetAddress.getByName(ipAddress);
- if (inet.isReachable(5000)) {
- isSeverReachable = true;
- } else {
- isSeverReachable = false;
- print(NO_SERVER_AVAIL);
- }
- } catch (IOException e) {
- isSeverReachable = false;
- log.error("Check server process is failed with {} ",
- e.getMessage());
- }
- return isSeverReachable;
- }
-
- /**
- * Returns availability of Gluon server.
- *
- * @return isServerAvailable
- */
- public boolean isEtcdSeverAvailable() {
- String serverUrl = GLUON_HTTP + ipAddress + ":" + port;
- boolean isServerAvailable;
- try {
- URL url = new URL(serverUrl);
- URLConnection connection = url.openConnection();
- connection.connect();
- isServerAvailable = true;
- } catch (IOException e) {
- print(NO_SERVER_AVAIL_ON_PORT);
- isServerAvailable = false;
- }
- return isServerAvailable;
- }
-}
diff --git a/apps/gluon/src/main/java/org/onosproject/gluon/rsc/cli/GluonServerListCommand.java b/apps/gluon/src/main/java/org/onosproject/gluon/rsc/cli/GluonServerListCommand.java
deleted file mode 100644
index a4df5ce..0000000
--- a/apps/gluon/src/main/java/org/onosproject/gluon/rsc/cli/GluonServerListCommand.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * Copyright 2017-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.gluon.rsc.cli;
-
-import org.apache.karaf.shell.api.action.Command;
-import org.apache.karaf.shell.api.action.Option;
-import org.apache.karaf.shell.api.action.lifecycle.Service;
-import org.onosproject.cli.AbstractShellCommand;
-import org.onosproject.gluon.manager.GluonManager;
-import org.onosproject.gluon.rsc.GluonServer;
-
-import java.util.Map;
-
-import static org.onosproject.gluon.manager.GluonManager.getAllServersIP;
-import static org.onosproject.gluon.rsc.GluonConstants.ACTIVE_SERVER;
-import static org.onosproject.gluon.rsc.GluonConstants.GLUON_DEFAULT_PORT;
-import static org.onosproject.gluon.rsc.GluonConstants.GLUON_HTTP;
-import static org.onosproject.gluon.rsc.GluonConstants.SERVER_POOL;
-
-/**
- * Supports for querying Gluon Servers list and statistics.
- */
-@Service
-@Command(scope = "onos", name = "gluon-server-list",
- description = "Gluon server list")
-public class GluonServerListCommand extends AbstractShellCommand {
-
- @Option(name = "-i", aliases = "--server-ip",
- description = "Supports for querying Gluon server statistics",
- required = false, multiValued = false)
- String ipAddress = null;
-
- @Option(name = "-p", aliases = "--port", description = "Gluon server port",
- required = false, multiValued = false)
- String port = GLUON_DEFAULT_PORT;
-
- protected Map<String, GluonServer> serverMap = getAllServersIP();
-
- private static final String SERVER_STATISTICS =
- "Server %s details:\nVersion: %s\nPort: %s\nReal time data:\n" +
- "\tSet Statistics : %s\n\tDelete Statistics: %s\n" +
- "Batch data:\n\tGet Statistics : %s";
-
-
- @Override
- protected void doExecute() {
- try {
- String serverUrl = GLUON_HTTP + ipAddress + ":" + port;
- if (ipAddress != null && checkServerPool(serverUrl)) {
- for (Map.Entry<String,
- GluonServer> server : serverMap.entrySet()) {
-
- if (serverUrl.equals(server.getKey())) {
- //Gets Etcd object reference
- GluonServer gluonServer = server.getValue();
- //Gets Etcd version from server list
- print(SERVER_STATISTICS, ipAddress, gluonServer.version,
- port, gluonServer.getSetCount(),
- gluonServer.getDelCount(),
- gluonServer.getGetCount());
- }
- }
- } else {
- int totalServers = GluonManager.getTotalServers();
- log.info(ACTIVE_SERVER, totalServers);
- print("Number of active servers: " + totalServers);
- printServersIP();
- }
- } catch (Exception e) {
- print(null, e.getMessage());
- }
- }
-
- /**
- * Prints all servers IPs in table format.
- */
- protected void printServersIP() {
- int countServer = 1;
- for (Map.Entry<String, GluonServer> server : serverMap.entrySet()) {
- String serverUrl = server.getKey();
- String[] serverIP = serverUrl.split("//");
- print("Server %d: %s", countServer, serverIP[1]);
- countServer++;
- }
- }
-
- /**
- * Returns boolean if given IP available in server pool.
- *
- * @param ipAddr Ip Address
- * @return boolean
- */
- protected boolean checkServerPool(String ipAddr) {
- boolean isServerAvailable;
- if (serverMap.containsKey(ipAddr)) {
- isServerAvailable = true;
- } else {
- print(SERVER_POOL);
- isServerAvailable = false;
- }
- return isServerAvailable;
- }
-}
diff --git a/apps/gluon/src/main/java/org/onosproject/gluon/rsc/cli/package-info.java b/apps/gluon/src/main/java/org/onosproject/gluon/rsc/cli/package-info.java
deleted file mode 100644
index 274ff4d..0000000
--- a/apps/gluon/src/main/java/org/onosproject/gluon/rsc/cli/package-info.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright 2017-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.
- */
-
-/**
- * Gluon Shim Application Command line interface package.
- */
-package org.onosproject.gluon.rsc.cli;
\ No newline at end of file
diff --git a/apps/gluon/src/main/java/org/onosproject/gluon/rsc/package-info.java b/apps/gluon/src/main/java/org/onosproject/gluon/rsc/package-info.java
deleted file mode 100644
index f2506ea..0000000
--- a/apps/gluon/src/main/java/org/onosproject/gluon/rsc/package-info.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright 2017-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.
- */
-
-/**
- * Gluon Shim Application resource package.
- */
-package org.onosproject.gluon.rsc;
\ No newline at end of file
diff --git a/apps/iptopology-api/BUILD b/apps/iptopology-api/BUILD
deleted file mode 100644
index f72e3bc..0000000
--- a/apps/iptopology-api/BUILD
+++ /dev/null
@@ -1,3 +0,0 @@
-osgi_jar_with_tests(
- deps = CORE_DEPS,
-)
diff --git a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/AreaId.java b/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/AreaId.java
deleted file mode 100644
index 7235a2b..0000000
--- a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/AreaId.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright 2015-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.iptopology.api;
-
-import org.onlab.util.Identifier;
-
-/**
- * Area identifier class (32 Bit Area-ID).
- */
-public class AreaId extends Identifier<Integer> {
- /**
- * Constructor to set area identifier.
- *
- * @param areaId area id
- */
- public AreaId(int areaId) {
- super(areaId);
- }
-
- /**
- * obtain area identifier.
- *
- * @return area identifier
- */
- public int areaId() {
- return identifier;
- }
-}
\ No newline at end of file
diff --git a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/AsNumber.java b/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/AsNumber.java
deleted file mode 100644
index 2c10717..0000000
--- a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/AsNumber.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright 2015-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.iptopology.api;
-
-import static com.google.common.base.MoreObjects.toStringHelper;
-
-import java.util.Objects;
-
-/**
- * Autonomous system Number class (32 Bit ASNumber).
- */
-public class AsNumber {
- private final int asNum;
-
- /**
- * Constructor to set As number.
- *
- * @param asNum As number
- */
- public AsNumber(int asNum) {
- this.asNum = asNum;
- }
-
- /**
- * Obtain autonomous system number.
- *
- * @return autonomous system number
- */
- public int asNum() {
- return asNum;
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(asNum);
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
-
- if (obj instanceof AsNumber) {
- AsNumber other = (AsNumber) obj;
- return Objects.equals(asNum, other.asNum);
- }
- return false;
- }
-
- @Override
- public String toString() {
- return toStringHelper(this)
- .add("asNum", asNum)
- .toString();
- }
-}
\ No newline at end of file
diff --git a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/Color.java b/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/Color.java
deleted file mode 100644
index 7060eecb..0000000
--- a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/Color.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright 2015-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.iptopology.api;
-
-import static com.google.common.base.MoreObjects.toStringHelper;
-
-import java.util.Objects;
-
-/**
- * Represents administrative group color.
- * bit mask - least significant bit is referred to as 'group 0',
- * and the most significant bit is referred to as 'group 31'
- */
-public class Color {
- private final int color;
-
- /**
- * Constructor to initialize its parameter.
- *
- * @param color assigned by the network administrator
- */
- public Color(int color) {
- this.color = color;
- }
-
- /**
- * Obtains administrative group.
- *
- * @return administrative group
- */
- public int color() {
- return color;
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(color);
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
-
- if (obj instanceof Color) {
- Color other = (Color) obj;
- return Objects.equals(color, other.color);
- }
- return false;
- }
-
- @Override
- public String toString() {
- return toStringHelper(this)
- .add("color", color)
- .toString();
- }
-}
\ No newline at end of file
diff --git a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/DefaultDeviceIntf.java b/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/DefaultDeviceIntf.java
deleted file mode 100644
index e16f9c4..0000000
--- a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/DefaultDeviceIntf.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Copyright 2015-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.iptopology.api;
-
-import static com.google.common.base.MoreObjects.toStringHelper;
-
-import java.util.Objects;
-
-import org.onosproject.net.Element;
-
-/**
- * Default Device interface implementation.
- */
-public class DefaultDeviceIntf implements DeviceIntf {
-
- private final Element element;
- private final DeviceInterface deviceInterface;
-
- /**
- * Constructor to initialize device interface parameters.
- *
- * @param element parent network element
- * @param deviceInterface device interface
- */
- public DefaultDeviceIntf(Element element, DeviceInterface deviceInterface) {
- this.element = element;
- this.deviceInterface = deviceInterface;
- }
-
- @Override
- public Element element() {
- return element;
- }
-
- @Override
- public DeviceInterface deviceInterface() {
- return deviceInterface;
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(element, deviceInterface);
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
-
- if (obj instanceof DefaultDeviceIntf) {
- final DefaultDeviceIntf other = (DefaultDeviceIntf) obj;
- return Objects.equals(this.element.id(), other.element.id())
- && Objects.equals(this.deviceInterface, other.deviceInterface);
- }
- return false;
- }
-
- @Override
- public String toString() {
- return toStringHelper(this)
- .add("element", element.id())
- .add("deviceInterface", deviceInterface)
- .toString();
- }
-}
\ No newline at end of file
diff --git a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/DefaultDevicePrefix.java b/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/DefaultDevicePrefix.java
deleted file mode 100644
index fd0dfd3..0000000
--- a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/DefaultDevicePrefix.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Copyright 2015-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.iptopology.api;
-
-import org.onosproject.net.AbstractAnnotated;
-import org.onosproject.net.Annotations;
-import org.onosproject.net.Element;
-
-import java.util.Objects;
-
-import static com.google.common.base.MoreObjects.toStringHelper;
-
-/**
- * Default Device prefix implementation.
- */
-public class DefaultDevicePrefix extends AbstractAnnotated implements DevicePrefix {
-
- private final Element element;
- private final PrefixIdentifier prefixIdentifier;
- private final PrefixTed prefixTed;
-
- /**
- * Creates a network device prefix attributed to the specified element.
- *
- * @param element parent network element
- * @param prefixIdentifier prefix identifier
- * @param prefixTed prefid traffic engineering parameters
- * @param annotations optional key/value annotations
- */
- public DefaultDevicePrefix(Element element, PrefixIdentifier prefixIdentifier,
- PrefixTed prefixTed, Annotations... annotations) {
- super(annotations);
- this.element = element;
- this.prefixIdentifier = prefixIdentifier;
- this.prefixTed = prefixTed;
- }
-
- @Override
- public Element element() {
- return element;
- }
-
- @Override
- public PrefixIdentifier prefixIdentifier() {
- return prefixIdentifier;
- }
-
- @Override
- public PrefixTed prefixTed() {
- return prefixTed;
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(element, prefixIdentifier, prefixTed);
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
- if (obj instanceof DefaultDevicePrefix) {
- final DefaultDevicePrefix other = (DefaultDevicePrefix) obj;
- return Objects.equals(this.element.id(), other.element.id()) &&
- Objects.equals(this.prefixIdentifier, other.prefixIdentifier) &&
- Objects.equals(this.prefixTed, other.prefixTed) &&
- Objects.equals(this.annotations(), other.annotations());
- }
- return false;
- }
-
- @Override
- public String toString() {
- return toStringHelper(this)
- .omitNullValues()
- .add("element", element.id())
- .add("prefixIdentifier", prefixIdentifier)
- .add("prefixTed", prefixTed)
- .toString();
- }
-}
\ No newline at end of file
diff --git a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/DefaultIpDevice.java b/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/DefaultIpDevice.java
deleted file mode 100644
index 113a058..0000000
--- a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/DefaultIpDevice.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * Copyright 2015-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.iptopology.api;
-
-import org.onosproject.net.AbstractElement;
-import org.onosproject.net.Annotations;
-import org.onosproject.net.DeviceId;
-import org.onosproject.net.provider.ProviderId;
-
-import java.util.Objects;
-
-import static com.google.common.base.MoreObjects.toStringHelper;
-
-/**
- * Default ip device model implementation.
- */
-public class DefaultIpDevice extends AbstractElement implements IpDevice {
-
- private final Type type;
- private final IpDeviceIdentifier deviceIdentifier;
- private final DeviceTed deviceTed;
-
-
- /**
- * For Serialization.
- */
- private DefaultIpDevice() {
- this.type = null;
- this.deviceIdentifier = null;
- this.deviceTed = null;
- }
-
- /**
- * Creates a network element attributed to the specified provider.
- *
- * @param providerId identity of the provider
- * @param id device identifier
- * @param type device type
- * @param deviceIdentifier provides device identifier details
- * @param deviceTed device traffic engineering parameters
- * @param annotations optional key/value annotations
- */
- public DefaultIpDevice(ProviderId providerId, DeviceId id, Type type,
- IpDeviceIdentifier deviceIdentifier, DeviceTed deviceTed,
- Annotations... annotations) {
- super(providerId, id, annotations);
- this.type = type;
- this.deviceIdentifier = deviceIdentifier;
- this.deviceTed = deviceTed;
- }
-
- @Override
- public DeviceId id() {
- return (DeviceId) id;
- }
-
- @Override
- public Type type() {
- return type;
- }
-
- @Override
- public IpDeviceIdentifier deviceIdentifier() {
- return deviceIdentifier;
- }
-
- @Override
- public DeviceTed deviceTed() {
- return deviceTed; }
-
- @Override
- public int hashCode() {
- return Objects.hash(type, deviceIdentifier, deviceTed);
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
-
- if (obj instanceof DefaultIpDevice) {
- final DefaultIpDevice other = (DefaultIpDevice) obj;
- return Objects.equals(this.id, other.id) &&
- Objects.equals(this.type, other.type) &&
- Objects.equals(this.deviceIdentifier, other.deviceIdentifier) &&
- Objects.equals(this.deviceTed, other.deviceTed);
- }
- return false;
- }
- @Override
- public String toString() {
- return toStringHelper(this)
- .omitNullValues()
- .add("id", id)
- .add("deviceIdentifier", deviceIdentifier)
- .add("deviceTed", deviceTed)
- .toString();
- }
-}
\ No newline at end of file
diff --git a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/DefaultIpLink.java b/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/DefaultIpLink.java
deleted file mode 100644
index 6c71bc0..0000000
--- a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/DefaultIpLink.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * Copyright 2015-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.iptopology.api;
-
-import org.onosproject.net.AbstractModel;
-import org.onosproject.net.Annotations;
-import org.onosproject.net.provider.ProviderId;
-
-import java.util.Objects;
-
-import static com.google.common.base.MoreObjects.toStringHelper;
-
-/**
- * This class provides Link identifier and link ted details.
- */
-public class DefaultIpLink extends AbstractModel implements IpLink {
-
- private final TerminationPoint src;
- private final TerminationPoint dst;
- private final IpLinkIdentifier linkIdentifier;
- private final LinkTed linkTed;
-
- /**
- * Constructor to initialize its parameters.
- *
- * @param providerId provider identification
- * @param src link source termination point
- * @param dst link destination termination point
- * @param linkIdentifier provides link identifier details
- * @param linkTed provides link traffic engineering details
- * @param annotations optional key/value annotations
- */
- public DefaultIpLink(ProviderId providerId, TerminationPoint src, TerminationPoint dst,
- IpLinkIdentifier linkIdentifier, LinkTed linkTed,
- Annotations... annotations) {
- super(providerId, annotations);
- this.src = src;
- this.dst = dst;
- this.linkIdentifier = linkIdentifier;
- this.linkTed = linkTed;
- }
-
- @Override
- public TerminationPoint src() {
- return src;
- }
-
- @Override
- public TerminationPoint dst() {
- return dst;
- }
-
- @Override
- public IpLinkIdentifier linkIdentifier() {
- return linkIdentifier;
- }
-
- @Override
- public LinkTed linkTed() {
- return linkTed;
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(src, dst, linkIdentifier, linkTed);
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
- if (obj instanceof DefaultIpLink) {
- final DefaultIpLink other = (DefaultIpLink) obj;
- return Objects.equals(this.src, other.src) &&
- Objects.equals(this.dst, other.dst) &&
- Objects.equals(this.linkIdentifier, other.linkIdentifier) &&
- Objects.equals(this.linkTed, other.linkTed);
- }
- return false;
- }
-
- @Override
- public String toString() {
- return toStringHelper(this)
- .omitNullValues()
- .add("src", src)
- .add("dst", dst)
- .add("linkIdentifier", linkIdentifier)
- .add("linkTed", linkTed)
- .toString();
- }
-}
\ No newline at end of file
diff --git a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/DeviceInterface.java b/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/DeviceInterface.java
deleted file mode 100644
index c7e60dc..0000000
--- a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/DeviceInterface.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Copyright 2015-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.iptopology.api;
-
-import java.util.Objects;
-
-import org.onlab.packet.Ip4Address;
-import org.onlab.packet.Ip6Address;
-
-import com.google.common.base.MoreObjects;
-
-/**
- * Representation of device interface.
- */
-public class DeviceInterface {
- private final Ip4Address ip4Address;
- private final Ip6Address ip6Address;
- private final InterfaceIdentifier interfaceId;
-
- /**
- * Constructor to initialize its parameter.
- *
- * @param ip4Address ipv4 interface address
- * @param ip6Address ipv6 interface address
- * @param interfaceId interface Identifier
- */
- public DeviceInterface(Ip4Address ip4Address, Ip6Address ip6Address, InterfaceIdentifier interfaceId) {
- this.ip4Address = ip4Address;
- this.ip6Address = ip6Address;
- this.interfaceId = interfaceId;
- }
-
- /**
- * obtains ipv4 address of an interface.
- *
- * @return ipv4 interface address
- */
- public Ip4Address ip4Address() {
- return ip4Address;
- }
-
- /**
- * obtains ipv6 interface address.
- *
- * @return ipv6 interface address
- */
- public Ip6Address ip6Address() {
- return ip6Address;
- }
-
- /**
- * obtains interface identifier.
- *
- * @return interface identifier
- */
- public InterfaceIdentifier interfaceId() {
- return interfaceId;
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(ip4Address, ip6Address, interfaceId);
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
- if (obj instanceof DeviceInterface) {
- final DeviceInterface other = (DeviceInterface) obj;
- return Objects.equals(this.ip4Address, other.ip4Address)
- && Objects.equals(this.ip6Address, other.ip6Address)
- && Objects.equals(this.interfaceId, other.interfaceId);
- }
- return false;
- }
-
- @Override
- public String toString() {
- return MoreObjects.toStringHelper(this)
- .add("ip4Address", ip4Address)
- .add("ip6Address", ip6Address)
- .add("interfaceId", interfaceId)
- .toString();
- }
-}
\ No newline at end of file
diff --git a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/DeviceIntf.java b/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/DeviceIntf.java
deleted file mode 100644
index ef7ceb0..0000000
--- a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/DeviceIntf.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright 2015-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.iptopology.api;
-
-import org.onosproject.net.Element;
-
-/**
- * Abstraction of Device interface.
- */
-public interface DeviceIntf {
- /**
- * Returns the parent network element to which this interface belongs.
- *
- * @return parent network element
- */
- Element element();
-
- /**
- * Returns device interface details.
- *
- * @return device interface details
- */
- DeviceInterface deviceInterface();
-}
\ No newline at end of file
diff --git a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/DevicePrefix.java b/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/DevicePrefix.java
deleted file mode 100644
index 54116b8..0000000
--- a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/DevicePrefix.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright 2015-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.iptopology.api;
-
-import org.onosproject.net.Annotated;
-import org.onosproject.net.Element;
-
-/**
- * Abstraction of Device Prefix.
- */
-public interface DevicePrefix extends Annotated {
-
- /**
- * Returns the parent network element to which this port belongs.
- *
- * @return parent network element
- */
- Element element();
-
- /**
- * Returns prefix identifier details.
- *
- * @return prefix identifier details
- */
- PrefixIdentifier prefixIdentifier();
-
- /**
- * Returns prefix Traffic engineering parameters.
- *
- * @return prefix Traffic engineering parameters
- */
- PrefixTed prefixTed();
-}
\ No newline at end of file
diff --git a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/DeviceTed.java b/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/DeviceTed.java
deleted file mode 100644
index 8ad7d7b..0000000
--- a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/DeviceTed.java
+++ /dev/null
@@ -1,173 +0,0 @@
-/*
- * Copyright 2015-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.iptopology.api;
-
-import static com.google.common.base.MoreObjects.toStringHelper;
-
-import java.util.Iterator;
-import java.util.List;
-import java.util.Objects;
-
-import org.onlab.packet.Ip4Address;
-import org.onlab.packet.Ip6Address;
-
-/**
- * Represents Device Traffic Engineering parameters.
- */
-public class DeviceTed {
- private final List<Ip4Address> ipv4RouterIds;
- private final List<Ip6Address> ipv6RouterIds;
- private final List<TopologyId> topologyIds;
- private final Position position;
-
- /**
- * Constructor to initialize the parameter fields.
- *
- * @param ipv4RouterIds Router ids of Ipv4
- * @param ipv6RouterIds Router ids of Ipv6
- * @param topologyIds list of multi-topology IDs of the node
- * @param position of router whether it is ABR or ASBR
- */
- public DeviceTed(List<Ip4Address> ipv4RouterIds, List<Ip6Address> ipv6RouterIds,
- List<TopologyId> topologyIds, Position position) {
- this.ipv4RouterIds = ipv4RouterIds;
- this.ipv6RouterIds = ipv6RouterIds;
- this.topologyIds = topologyIds;
- this.position = position;
- }
-
- /**
- * Obtain list of Ipv4 Router id.
- *
- * @return Ipv4 Router ids
- */
- public List<Ip4Address> ipv4RouterIds() {
- return ipv4RouterIds;
- }
-
- /**
- * Obtain list of Ipv6 Router id.
- *
- * @return Ipv6 Router ids
- */
- public List<Ip6Address> ipv6RouterIds() {
- return ipv6RouterIds;
- }
-
- /**
- * Obtain the list of topology ID's.
- *
- * @return list of topology id's
- */
- public List<TopologyId> topologyIds() {
- return topologyIds;
- }
-
-
- /**
- * Obtain position of device in the network.
- *
- * @return position of device in the network
- */
- public Position position() {
- return position;
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(ipv4RouterIds, ipv6RouterIds, topologyIds, position);
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
-
- if (obj instanceof DeviceTed) {
- int countObjSubTlv = 0;
- int countOtherSubTlv = 0;
- int countObjTopologyId = 0;
- int countOtherTopologyId = 0;
- boolean isCommonSubTlv = true;
- boolean isCommonSubTlv6 = true;
- boolean isCommonTopology = true;
- DeviceTed other = (DeviceTed) obj;
- Iterator<Ip4Address> objListIterator = other.ipv4RouterIds.iterator();
- countOtherSubTlv = other.ipv4RouterIds.size();
- countObjSubTlv = ipv4RouterIds.size();
-
- Iterator<Ip6Address> objListIteratorIpv6 = other.ipv6RouterIds.iterator();
- int countOtherSubTlv6 = other.ipv6RouterIds.size();
- int countObjSubTlv6 = ipv6RouterIds.size();
-
- Iterator<TopologyId> topologyId = other.topologyIds.iterator();
- countOtherTopologyId = other.topologyIds.size();
- countObjTopologyId = topologyIds.size();
-
- if (countObjSubTlv != countOtherSubTlv || countOtherSubTlv6 != countObjSubTlv6
- || countObjTopologyId != countOtherTopologyId) {
- return false;
- } else {
- while (objListIterator.hasNext() && isCommonSubTlv) {
- Ip4Address subTlv = objListIterator.next();
- //find index of that element and then get that from the list and then compare
- if (ipv4RouterIds.contains(subTlv) && other.ipv4RouterIds.contains(subTlv)) {
- isCommonSubTlv = Objects.equals(ipv4RouterIds.get(ipv4RouterIds.indexOf(subTlv)),
- other.ipv4RouterIds.get(other.ipv4RouterIds.indexOf(subTlv)));
- } else {
- isCommonSubTlv = false;
- }
- }
- while (objListIteratorIpv6.hasNext() && isCommonSubTlv6) {
- Ip6Address subTlv = objListIteratorIpv6.next();
- //find index of that element and then get that from the list and then compare
- if (ipv6RouterIds.contains(subTlv) && other.ipv6RouterIds.contains(subTlv)) {
- isCommonSubTlv6 = Objects.equals(ipv6RouterIds.get(ipv6RouterIds.indexOf(subTlv)),
- other.ipv6RouterIds.get(other.ipv6RouterIds.indexOf(subTlv)));
- } else {
- isCommonSubTlv6 = false;
- }
- }
- while (topologyId.hasNext() && isCommonTopology) {
- TopologyId subTlv = topologyId.next();
- //find index of that element and then get that from the list and then compare
- if (topologyIds.contains(subTlv) && other.topologyIds.contains(subTlv)) {
- isCommonTopology = Objects.equals(topologyIds.get(topologyIds.indexOf(subTlv)),
- other.topologyIds.get(other.topologyIds.indexOf(subTlv)));
- } else {
- isCommonTopology = false;
- }
- }
- return isCommonSubTlv && isCommonSubTlv6 && isCommonTopology
- && Objects.equals(position, other.position);
- }
- }
- return false;
- }
-
- @Override
- public String toString() {
- return toStringHelper(this)
- .omitNullValues()
- .add("ipv6RouterIds", ipv6RouterIds)
- .add("ipv4RouterIds", ipv4RouterIds)
- .add("topologyIds", topologyIds)
- .add("position", position)
- .toString();
- }
-
-}
\ No newline at end of file
diff --git a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/DomainId.java b/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/DomainId.java
deleted file mode 100644
index b398098..0000000
--- a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/DomainId.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright 2015-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.iptopology.api;
-
-import org.onlab.util.Identifier;
-
-/**
- * Domain Identifier(32 Bit).
- */
-public class DomainId extends Identifier<Integer> {
- /**
- * Constructor to initialize domain identifier.
- *
- * @param domainIdentifier domain identifier
- */
- public DomainId(int domainIdentifier) {
- super(domainIdentifier);
- }
-
- /**
- * Obtain domain identifier.
- *
- * @return domain identifier
- */
- public int domainIdentifier() {
- return identifier;
- }
-}
\ No newline at end of file
diff --git a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/ExtendedRouteTag.java b/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/ExtendedRouteTag.java
deleted file mode 100644
index f2943e5..0000000
--- a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/ExtendedRouteTag.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright 2015-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.iptopology.api;
-
-import static com.google.common.base.MoreObjects.toStringHelper;
-
-import java.util.Objects;
-
-/**
- * Represents the extended igp administrative tags of the prefix.
- */
-public class ExtendedRouteTag {
- private final long extRouteTag;
-
- /**
- * Constructor to initialize its parameter.
- *
- * @param extRouteTag extended ISIS route tag
- */
- public ExtendedRouteTag(long extRouteTag) {
- this.extRouteTag = extRouteTag;
- }
-
- /**
- * Obtains extended igp administrative tags.
- *
- * @return extended igp administrative tags
- */
- public long extRouteTag() {
- return extRouteTag;
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(extRouteTag);
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
-
- if (obj instanceof ExtendedRouteTag) {
- ExtendedRouteTag other = (ExtendedRouteTag) obj;
- return Objects.equals(extRouteTag, other.extRouteTag);
- }
- return false;
- }
-
- @Override
- public String toString() {
- return toStringHelper(this)
- .add("extRouteTag", extRouteTag)
- .toString();
- }
-}
\ No newline at end of file
diff --git a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/IgpFlags.java b/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/IgpFlags.java
deleted file mode 100644
index 0e4274d..0000000
--- a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/IgpFlags.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * Copyright 2015-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.iptopology.api;
-
-import static com.google.common.base.MoreObjects.toStringHelper;
-
-import java.util.Objects;
-
-/**
- * This class provides implementation IS-IS and OSPF flags assigned to the prefix.
- */
-public class IgpFlags {
- private final Boolean isisUpDown;
- private final Boolean ospfNoUnicast;
- private final Boolean ospfLclAddr;
- private final Boolean ospfNssa;
-
- /**
- * Constructor to initialize its parameters.
- *
- * @param isisUpDown IS-IS Up/Down
- * @param ospfNoUnicast OSPF no unicast
- * @param ospfLclAddr OSPF local address
- * @param ospfNssa OSPF propagate NSSA
- */
- public IgpFlags(Boolean isisUpDown, Boolean ospfNoUnicast, Boolean ospfLclAddr,
- Boolean ospfNssa) {
- this.isisUpDown = isisUpDown;
- this.ospfNoUnicast = ospfNoUnicast;
- this.ospfLclAddr = ospfLclAddr;
- this.ospfNssa = ospfNssa;
- }
-
- /**
- * Provides information whether IS-IS is Up/Down.
- *
- * @return IS-IS Up/Down bit enabled or not or null if is not configured
- */
- public Boolean isisUpDown() {
- return isisUpDown;
- }
-
- /**
- * Provides information whether OSPF is unicast or not.
- *
- * @return OSPF no unicast Bit set or not or null if is not configured
- */
- public Boolean ospfNoUnicast() {
- return ospfNoUnicast;
- }
-
- /**
- * Provides information on OSPF local address.
- *
- * @return OSPF local address Bit set or not or null if is not configured
- */
- public Boolean ospfLclAddr() {
- return ospfLclAddr;
- }
-
- /**
- * Provides information on OSPF propagate NSSA.
- *
- * @return OSPF propagate NSSA Bit set or not or null if is not configured
- */
- public Boolean ospfNssa() {
- return ospfNssa;
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(isisUpDown, ospfNoUnicast, ospfLclAddr,
- ospfNssa);
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
-
- if (obj instanceof IgpFlags) {
- IgpFlags other = (IgpFlags) obj;
- return Objects.equals(isisUpDown, other.isisUpDown)
- && Objects.equals(ospfNoUnicast, other.ospfNoUnicast)
- && Objects.equals(ospfLclAddr, other.ospfLclAddr)
- && Objects.equals(ospfNssa, other.ospfNssa);
- }
- return false;
- }
-
- @Override
- public String toString() {
- return toStringHelper(this)
- .add("isisUpDown", isisUpDown)
- .add("ospfNoUnicast", ospfNoUnicast)
- .add("ospfLclAddr", ospfLclAddr)
- .add("ospfNssa", ospfNssa)
- .toString();
- }
-}
\ No newline at end of file
diff --git a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/InterfaceIdentifier.java b/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/InterfaceIdentifier.java
deleted file mode 100644
index daae1b3..0000000
--- a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/InterfaceIdentifier.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Copyright 2015-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.iptopology.api;
-
-import static com.google.common.base.MoreObjects.toStringHelper;
-
-import java.util.Objects;
-
-/**
- * This class provides information on Local Interface Identifier and Remote
- * Interface Identifier of the link.
- */
-public class InterfaceIdentifier {
- private final Integer identifier;
-
- /**
- * Constructor to initialize identifier.
- *
- * @param identifier local/remote interface identifier
- */
- public InterfaceIdentifier(Integer identifier) {
- this.identifier = identifier;
- }
-
- /**
- * Provides the local/remote interface identifier of the link.
- *
- * @return interface identifier
- */
- public Integer identifier() {
- return identifier;
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(identifier);
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
-
- if (obj instanceof InterfaceIdentifier) {
- InterfaceIdentifier other = (InterfaceIdentifier) obj;
- return Objects.equals(identifier, other.identifier);
- }
- return false;
- }
-
- @Override
- public String toString() {
- return toStringHelper(this)
- .add("identifier", identifier)
- .toString();
- }
-}
diff --git a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/IpDevice.java b/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/IpDevice.java
deleted file mode 100644
index 74df3cd..0000000
--- a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/IpDevice.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright 2015-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.iptopology.api;
-
-import org.onosproject.net.DeviceId;
-import org.onosproject.net.Element;
-
-/**
- * Abstraction of Ip Device.
- */
-public interface IpDevice extends Element {
- /**
- ** Enum type to store Device Type.
- */
- enum Type {
- /**
- * Signifies that the device is pseudo device.
- */
- PSEUDO,
-
- /**
- * Signifies that the device is non-pseudo device.
- */
- NONPSEUDO
- }
-
- /**
- * Obtains device id.
- *
- * @return device id
- */
- @Override
- DeviceId id();
-
- /**
- * Obtains device type.
- *
- * @return device type
- */
- Type type();
-
- /**
- * Obtains Device identifier details.
- *
- * @return identifier of the device
- */
- IpDeviceIdentifier deviceIdentifier();
-
- /**
- * Obtains the traffic engineering parameters of the device.
- *
- * @return traffic engineering parameters of the device
- */
- DeviceTed deviceTed();
-}
\ No newline at end of file
diff --git a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/IpDeviceIdentifier.java b/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/IpDeviceIdentifier.java
deleted file mode 100644
index 4371390..0000000
--- a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/IpDeviceIdentifier.java
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- * Copyright 2015-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.iptopology.api;
-
-import static com.google.common.base.MoreObjects.toStringHelper;
-
-import java.util.Objects;
-
-/**
- * Represents IP Device Identifiers.
- */
-public class IpDeviceIdentifier {
-
- private final RouteDistinguisher routeDish;
- private final RouteInstance routeInstance;
- private final AsNumber asNum;
- private final DomainId domainIdentifier;
- private final AreaId areaId;
- private final RouteIdentifier routerIdentifier;
-
- /**
- * Constructor to initialize parameters.
- *
- * @param routeDish routing distinguisher instance
- * @param routeInstance routing protocol instance
- * @param asNum AS number
- * @param domainIdentifier BGP-LS domain
- * @param areaId Area ID
- * @param routerIdentifier IGP router ID
- */
- public IpDeviceIdentifier(RouteDistinguisher routeDish, RouteInstance routeInstance, AsNumber asNum,
- DomainId domainIdentifier, AreaId areaId, RouteIdentifier routerIdentifier) {
- this.routeDish = routeDish;
- this.areaId = areaId;
- this.asNum = asNum;
- this.domainIdentifier = domainIdentifier;
- this.routeInstance = routeInstance;
- this.routerIdentifier = routerIdentifier;
- }
-
- /**
- * Obtains Route Distinguisher of Ip Device.
- *
- * @return Area ID
- */
- public RouteDistinguisher routeDish() {
- return routeDish;
- }
-
- /**
- * Obtains Area ID if Ip Device.
- *
- * @return Area ID
- */
- public AreaId areaId() {
- return areaId;
- }
-
- /**
- * Obtains AS number of Ip Device.
- *
- * @return AS number
- */
- public AsNumber asNum() {
- return asNum;
- }
-
- /**
- * Obtains domain identifier of Ip Device.
- *
- * @return domain identifier
- */
- public DomainId domainIdentifier() {
- return domainIdentifier;
- }
-
- /**
- * Obtains Router id of Ip Device.
- *
- * @return Router id
- */
- public RouteIdentifier routerIdentifier() {
- return routerIdentifier;
- }
-
- /**
- * Obtains routing protocol instance.
- *
- * @return routing protocol instance
- */
- public RouteInstance routeInstance() {
- return routeInstance;
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(routeDish, areaId, asNum, domainIdentifier, routerIdentifier, routeInstance);
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
-
- if (obj instanceof IpDeviceIdentifier) {
- IpDeviceIdentifier other = (IpDeviceIdentifier) obj;
- return Objects.equals(areaId, other.areaId) && Objects.equals(asNum, other.asNum)
- && Objects.equals(domainIdentifier, other.domainIdentifier)
- && Objects.equals(routerIdentifier, other.routerIdentifier)
- && Objects.equals(routeInstance, other.routeInstance)
- && Objects.equals(routeDish, other.routeDish);
- }
- return false;
- }
-
- @Override
- public String toString() {
- return toStringHelper(this)
- .omitNullValues()
- .add("areaId", areaId)
- .add("asNum", asNum)
- .add("domainIdentifier", domainIdentifier)
- .add("routerIdentifier", routerIdentifier)
- .add("routeInstance", routeInstance)
- .add("routeDish", routeDish)
- .toString();
- }
-}
\ No newline at end of file
diff --git a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/IpLink.java b/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/IpLink.java
deleted file mode 100644
index 97bfb59..0000000
--- a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/IpLink.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright 2015-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.iptopology.api;
-
-import org.onosproject.net.Annotated;
-import org.onosproject.net.NetworkResource;
-import org.onosproject.net.Provided;
-
-/**
- * Abstraction of a network ip link.
- */
-public interface IpLink extends Annotated, Provided, NetworkResource {
-
- /**
- * Returns source termination point of link.
- *
- * @return source termination point of link
- */
- TerminationPoint src();
-
- /**
- * Returns destination termination point of link.
- *
- * @return destination termination point of link
- */
- TerminationPoint dst();
-
- /**
- * Returns link identifier details.
- *
- * @return link identifier details
- */
- IpLinkIdentifier linkIdentifier();
-
- /**
- * Returns the link traffic engineering parameters.
- *
- * @return links traffic engineering parameters
- */
- LinkTed linkTed();
-}
\ No newline at end of file
diff --git a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/IpLinkIdentifier.java b/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/IpLinkIdentifier.java
deleted file mode 100644
index dca1b94..0000000
--- a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/IpLinkIdentifier.java
+++ /dev/null
@@ -1,161 +0,0 @@
-/*
- * Copyright 2015-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.iptopology.api;
-
-import static com.google.common.base.MoreObjects.toStringHelper;
-
-import java.util.Objects;
-
-import org.onlab.packet.Ip4Address;
-import org.onlab.packet.Ip6Address;
-
-/**
- * Represents Ip Link Identifier.
- */
-public class IpLinkIdentifier {
- private final InterfaceIdentifier localIndentifier;
- private final InterfaceIdentifier remoteIndentifier;
- private final Ip4Address localIpv4Addr;
- private final Ip4Address remoteIpv4Addr;
- private final Ip6Address localIpv6Addr;
- private final Ip6Address remoteIpv6Addr;
- private final TopologyId topologyId;
-
- /**
- * Constructor to initialize its parameters.
- *
- * @param localIndentifier local interface identifier of the link
- * @param remoteIndentifier remote interface identifier of the link
- * @param localIpv4Addr local IPv4 address of the link
- * @param remoteIpv4Addr remote IPv4 address of the link
- * @param localIpv6Addr local IPv6 address of the link
- * @param remoteIpv6Addr remote IPv6 address of the link
- * @param topologyId link topology identifier
- */
- public IpLinkIdentifier(InterfaceIdentifier localIndentifier, InterfaceIdentifier remoteIndentifier,
- Ip4Address localIpv4Addr, Ip4Address remoteIpv4Addr, Ip6Address localIpv6Addr,
- Ip6Address remoteIpv6Addr, TopologyId topologyId) {
- this.localIndentifier = localIndentifier;
- this.remoteIndentifier = remoteIndentifier;
- this.localIpv4Addr = localIpv4Addr;
- this.remoteIpv4Addr = remoteIpv4Addr;
- this.localIpv6Addr = localIpv6Addr;
- this.remoteIpv6Addr = remoteIpv6Addr;
- this.topologyId = topologyId;
- }
-
- /**
- * Obtains link local identifier.
- *
- * @return link local identifier
- */
- public InterfaceIdentifier localIndentifier() {
- return localIndentifier;
- }
-
- /**
- * Obtains link local identifier.
- *
- * @return link local identifier
- */
- public InterfaceIdentifier remoteIndentifier() {
- return remoteIndentifier;
- }
-
- /**
- * Obtains local IPv4 address of the link.
- *
- * @return local IPv4 address of the link
- */
- public Ip4Address localIpv4Addr() {
- return localIpv4Addr;
- }
-
- /**
- * Obtains remote IPv4 address of the link.
- *
- * @return remote IPv4 address of the link
- */
- public Ip4Address remoteIpv4Addr() {
- return remoteIpv4Addr;
- }
-
- /**
- * Obtains local IPv6 address of the link.
- *
- * @return local IPv6 address of the link
- */
- public Ip6Address localIpv6Addr() {
- return localIpv6Addr;
- }
-
- /**
- * Obtains remote IPv6 address of the link.
- *
- * @return remote IPv6 address of the link
- */
- public Ip6Address remoteIpv6Addr() {
- return remoteIpv6Addr;
- }
-
- /**
- * Obtains Topology ID of the link.
- *
- * @return Topology ID of the link
- */
- public TopologyId topologyId() {
- return topologyId;
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(localIndentifier, remoteIndentifier, localIpv4Addr, remoteIpv4Addr,
- localIpv6Addr, remoteIpv6Addr, topologyId);
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
-
- if (obj instanceof IpLinkIdentifier) {
- IpLinkIdentifier other = (IpLinkIdentifier) obj;
- return Objects.equals(topologyId, other.topologyId)
- && Objects.equals(localIndentifier, other.localIndentifier)
- && Objects.equals(remoteIndentifier, other.remoteIndentifier)
- && Objects.equals(localIpv4Addr, other.localIpv4Addr)
- && Objects.equals(remoteIpv4Addr, other.remoteIpv4Addr)
- && Objects.equals(localIpv6Addr, other.localIpv6Addr)
- && Objects.equals(remoteIpv6Addr, other.remoteIpv6Addr);
- }
- return false;
- }
-
- @Override
- public String toString() {
- return toStringHelper(this)
- .omitNullValues()
- .add("localIndentifier", localIndentifier)
- .add("remoteIndentifier", remoteIndentifier)
- .add("localIpv4Addr", localIpv4Addr)
- .add("remoteIpv4Addr", remoteIpv4Addr)
- .add("localIpv6Addr", localIpv6Addr)
- .add("remoteIpv6Addr", remoteIpv6Addr)
- .add("topologyId", topologyId)
- .toString();
- }
-}
\ No newline at end of file
diff --git a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/IpReachability.java b/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/IpReachability.java
deleted file mode 100644
index b16ea27..0000000
--- a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/IpReachability.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright 2015-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.iptopology.api;
-
-import static com.google.common.base.MoreObjects.toStringHelper;
-
-import java.util.Objects;
-
-import org.onlab.packet.IpPrefix;
-
-/**
- * Provides information of IP address prefix in the IGP topology and a router advertises
- * this to each of its BGP nexthop.
- */
-public class IpReachability {
- private final IpPrefix ipPrefix;
-
- /**
- * Constructor to initialize IP prefix.
- *
- * @param ipPrefix IP address prefix
- */
- public IpReachability(IpPrefix ipPrefix) {
- this.ipPrefix = ipPrefix;
- }
-
- /**
- * Provides IP Address prefix reachability.
- *
- * @return IP Address prefix
- */
- public IpPrefix ipPrefix() {
- return ipPrefix;
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(ipPrefix);
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
-
- if (obj instanceof IpReachability) {
- IpReachability other = (IpReachability) obj;
- return Objects.equals(ipPrefix, other.ipPrefix);
- }
- return false;
- }
-
- @Override
- public String toString() {
- return toStringHelper(this)
- .add("ipPrefix", ipPrefix)
- .toString();
- }
-}
\ No newline at end of file
diff --git a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/IsIsPseudonode.java b/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/IsIsPseudonode.java
deleted file mode 100644
index de53d11..0000000
--- a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/IsIsPseudonode.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Copyright 2015-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.iptopology.api;
-
-import static com.google.common.base.MoreObjects.toStringHelper;
-
-import java.util.Objects;
-
-/**
- * Represents the Pseudonode information of device in ISIS domain.
- */
-public class IsIsPseudonode implements RouteIdentifier {
- private final IsoNodeId isoNodeId;
- private final byte psnIdentifier;
- private final ProtocolType type;
-
- /**
- * Constructor to initialize the values.
- *
- * @param isoNodeId ISO system-ID
- * @param psnIdentifier Pseudonode identifier
- * @param type Protocol ID
- */
- public IsIsPseudonode(IsoNodeId isoNodeId, byte psnIdentifier, ProtocolType type) {
- this.isoNodeId = isoNodeId;
- this.psnIdentifier = psnIdentifier;
- this.type = type;
- }
-
- /**
- * Obtains iso system id of Pseudonode of device in ISIS domain.
- *
- * @return ISO system Id
- */
- public IsoNodeId isoNodeId() {
- return isoNodeId;
- }
-
- /**
- * Obtains Pseudonode identifier.
- *
- * @return Pseudonode identifier
- */
- public byte psnIdentifier() {
- return psnIdentifier;
- }
-
- @Override
- public ProtocolType type() {
- return type;
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(isoNodeId, psnIdentifier, type);
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
-
- if (obj instanceof IsIsPseudonode) {
- IsIsPseudonode other = (IsIsPseudonode) obj;
- return Objects.equals(isoNodeId, other.isoNodeId) && Objects.equals(psnIdentifier, other.psnIdentifier)
- && Objects.equals(type, other.type);
- }
- return false;
- }
-
- @Override
- public String toString() {
- return toStringHelper(this)
- .add("isoNodeId", isoNodeId)
- .add("psnIdentifier", psnIdentifier)
- .add("type", type)
- .toString();
- }
-}
\ No newline at end of file
diff --git a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/IsoNodeId.java b/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/IsoNodeId.java
deleted file mode 100644
index e5dc89a..0000000
--- a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/IsoNodeId.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * Copyright 2015-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.iptopology.api;
-
-import static com.google.common.base.MoreObjects.toStringHelper;
-
-import java.util.Arrays;
-import java.util.Objects;
-
-/**
- * Represents ISO system id of the device.
- */
-public class IsoNodeId implements RouteIdentifier {
- private final byte[] isoNodeId;
- private final ProtocolType type;
-
- /**
- * Constructor to initialize the values.
- *
- * @param isoNodeId ISO system-ID
- * @param type Protocol type
- */
- public IsoNodeId(byte[] isoNodeId, ProtocolType type) {
- this.isoNodeId = isoNodeId;
- this.type = type;
- }
-
- /**
- * Obtains ISO system id of the device.
- *
- * @return ISO system id
- */
- public byte[] isoNodeId() {
- return isoNodeId;
- }
-
- @Override
- public ProtocolType type() {
- return type;
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(Arrays.hashCode(isoNodeId), type);
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
-
- if (obj instanceof IsoNodeId) {
- IsoNodeId other = (IsoNodeId) obj;
- return Arrays.equals(isoNodeId, other.isoNodeId) && Objects.equals(type, other.type);
- }
- return false;
- }
-
- /*
- * Get iso node ID in specified string format.
- */
- private String isoNodeIdString() {
- if (isoNodeId != null) {
- int p1 = (int) isoNodeId[0] << 8 | (int) isoNodeId[1];
- int p2 = (int) isoNodeId[2] << 8 | (int) isoNodeId[3];
- int p3 = (int) isoNodeId[4] << 8 | (int) isoNodeId[5];
-
- return String.format("%1$d.%2$d.%3$d", p1, p2, p3);
- }
- return null;
- }
-
- @Override
- public String toString() {
- return toStringHelper(this).omitNullValues()
- .add("isoNodeId", isoNodeIdString())
- .add("type", type)
- .toString();
- }
-}
\ No newline at end of file
diff --git a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/LinkTed.java b/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/LinkTed.java
deleted file mode 100644
index 9ef8781..0000000
--- a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/LinkTed.java
+++ /dev/null
@@ -1,349 +0,0 @@
-/*
- * Copyright 2015-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.iptopology.api;
-
-import static com.google.common.base.MoreObjects.toStringHelper;
-
-import java.util.Iterator;
-import java.util.List;
-import java.util.Objects;
-
-import org.onlab.packet.Ip4Address;
-import org.onlab.packet.Ip6Address;
-import org.onlab.util.Bandwidth;
-
-/**
- * Represents Link Traffic engineering parameters.
- */
-public class LinkTed {
- private final Bandwidth maximumLink;
- private final Bandwidth maxReserved;
- private final List<Bandwidth> maxUnResBandwidth;
- private final Metric teMetric;
- private final Metric igpMetric;
- private final List<Ip4Address> ipv4LocRouterId;
- private final List<Ip6Address> ipv6LocRouterId;
- private final List<Ip4Address> ipv4RemRouterId;
- private final List<Ip6Address> ipv6RemRouterId;
- private final Color color;
- private final Signalling signalType;
- private final List<Srlg> srlgGroup;
- private final ProtectionType protectType;
-
- /**
- * Constructor to initialize its parameter.
- *
- * @param maximumLink maximum bandwidth can be used
- * @param maxReserved max bandwidth that can be reserved
- * @param maxUnResBandwidth amount of bandwidth reservable
- * @param teMetric Traffic engineering metric
- * @param igpMetric IGP metric
- * @param color information on administrative group assigned to the interface
- * @param signalType MPLS signaling protocols
- * @param srlgGroup Shared Risk Link Group information
- * @param protectType protection capabilities of the link
- * @param ipv4LocRouterId IPv4 router-Id of local node
- * @param ipv6LocRouterId IPv6 router-Id of local node
- * @param ipv4RemRouterId IPv4 router-Id of remote node
- * @param ipv6RemRouterId IPv6 router-Id of remote node
- */
- public LinkTed(Bandwidth maximumLink, Bandwidth maxReserved, List<Bandwidth> maxUnResBandwidth,
- Metric teMetric, Metric igpMetric, Color color, Signalling signalType, List<Srlg> srlgGroup,
- ProtectionType protectType, List<Ip4Address> ipv4LocRouterId, List<Ip6Address> ipv6LocRouterId,
- List<Ip4Address> ipv4RemRouterId, List<Ip6Address> ipv6RemRouterId) {
- this.maximumLink = maximumLink;
- this.maxReserved = maxReserved;
- this.maxUnResBandwidth = maxUnResBandwidth;
- this.teMetric = teMetric;
- this.igpMetric = igpMetric;
- this.color = color;
- this.signalType = signalType;
- this.srlgGroup = srlgGroup;
- this.protectType = protectType;
- this.ipv4LocRouterId = ipv4LocRouterId;
- this.ipv6LocRouterId = ipv6LocRouterId;
- this.ipv4RemRouterId = ipv4RemRouterId;
- this.ipv6RemRouterId = ipv6RemRouterId;
- }
-
- /**
- * Provides maximum bandwidth can be used on the link.
- *
- * @return maximum bandwidth
- */
- public Bandwidth maximumLink() {
- return maximumLink;
- }
-
- /**
- * Amount of bandwidth reservable on the link.
- *
- * @return unreserved bandwidth
- */
- public List<Bandwidth> maxUnResBandwidth() {
- return maxUnResBandwidth;
- }
-
- /**
- * Provides max bandwidth that can be reserved on the link.
- *
- * @return max bandwidth reserved
- */
- public Bandwidth maxReserved() {
- return maxReserved;
- }
-
- /**
- * Provides Traffic engineering metric for the link.
- *
- * @return Traffic engineering metric
- */
- public Metric teMetric() {
- return teMetric;
- }
-
- /**
- * Provides IGP metric for the link.
- *
- * @return IGP metric
- */
- public Metric igpMetric() {
- return igpMetric;
- }
-
- /**
- * Provides protection capabilities of the link.
- *
- * @return link protection type
- */
- public ProtectionType protectType() {
- return protectType;
- }
-
- /**
- * Provides Shared Risk Link Group information.
- *
- * @return Shared Risk Link Group value
- */
- public List<Srlg> srlgGroup() {
- return srlgGroup;
- }
-
- /**
- * Provides which MPLS signaling protocols are enabled.
- *
- * @return signal type
- */
- public Signalling signalType() {
- return signalType;
- }
-
- /**
- * Provides information on administrative group assigned to the interface.
- *
- * @return 4-octect bit mask assigned by network administrator
- */
- public Color color() {
- return color;
- }
-
- /**
- * Provides IPv4 router-Id of local node.
- *
- * @return IPv4 router-Id of local node
- */
- public List<Ip4Address> ipv4LocRouterId() {
- return ipv4LocRouterId;
- }
-
- /**
- * Provides IPv6 router-Id of local node.
- *
- * @return IPv6 router-Id of local node
- */
- public List<Ip6Address> ipv6LocRouterId() {
- return ipv6LocRouterId;
- }
-
- /**
- * Provides IPv4 router-Id of remote node.
- *
- * @return IPv4 router-Id of remote node
- */
- public List<Ip4Address> ipv4RemRouterId() {
- return ipv4RemRouterId;
- }
-
- /**
- * Provides IPv6 router-Id of remote node.
- *
- * @return IPv6 router-Id of remote node
- */
- public List<Ip6Address> ipv6RemRouterId() {
- return ipv6RemRouterId;
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(maximumLink, maxReserved, maxUnResBandwidth, teMetric, igpMetric,
- ipv4LocRouterId, ipv6LocRouterId, ipv4RemRouterId, ipv6RemRouterId,
- color, signalType, srlgGroup, protectType);
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
-
- if (obj instanceof LinkTed) {
- int countCommonBandwidth = 0;
- int countOtherCommonBandwidth = 0;
- int countOther4LocRouterId = 0;
- int countCommon4LocRouterId = 0;
- int countOther6RemRouterId = 0;
- int countCommon6RemRouterId = 0;
- int countOther4RemRouterId = 0;
- int countCommon4RemRouterId = 0;
- int countCommon6LocRouterId = 0;
- int countOther6LocRouterId = 0;
- int countCommonSrlg = 0;
- int countOtherSrlg = 0;
- boolean isCommonBandwidth = true;
- boolean isCommonIp4Loc = true;
- boolean isCommonIp4Rem = true;
- boolean isCommonIp6Loc = true;
- boolean isCommonIp6Rem = true;
- boolean isCommonSrlg = true;
- LinkTed other = (LinkTed) obj;
- Iterator<Bandwidth> objListIterator = other.maxUnResBandwidth.iterator();
- countOtherCommonBandwidth = other.maxUnResBandwidth.size();
- countCommonBandwidth = maxUnResBandwidth.size();
-
- Iterator<Ip4Address> ipv4local = other.ipv4LocRouterId.iterator();
- countOther4LocRouterId = other.ipv4LocRouterId.size();
- countCommon4LocRouterId = ipv4LocRouterId.size();
-
- Iterator<Ip4Address> ipv4remote = other.ipv4RemRouterId.iterator();
- countOther4RemRouterId = other.ipv4RemRouterId.size();
- countCommon4RemRouterId = ipv4RemRouterId.size();
-
- Iterator<Ip6Address> ipv6local = other.ipv6LocRouterId.iterator();
- countOther6LocRouterId = other.ipv6LocRouterId.size();
- countCommon6LocRouterId = ipv6LocRouterId.size();
-
- Iterator<Ip6Address> ipv6remote = other.ipv6RemRouterId.iterator();
- countOther6RemRouterId = other.ipv6RemRouterId.size();
- countCommon6RemRouterId = ipv6RemRouterId.size();
-
- Iterator<Srlg> srlg = other.srlgGroup.iterator();
- countOtherSrlg = other.srlgGroup.size();
- countCommonSrlg = srlgGroup.size();
-
- if (countOtherCommonBandwidth != countCommonBandwidth
- || countOther4LocRouterId != countCommon4LocRouterId
- || countOther4RemRouterId != countCommon4RemRouterId
- || countOther6LocRouterId != countCommon6LocRouterId
- || countOther6RemRouterId != countCommon6RemRouterId
- || countOtherSrlg != countCommonSrlg) {
- return false;
- } else {
- while (objListIterator.hasNext() && isCommonBandwidth) {
- Bandwidth subTlv = objListIterator.next();
- if (maxUnResBandwidth.contains(subTlv) && other.maxUnResBandwidth.contains(subTlv)) {
- isCommonBandwidth = Objects.equals(maxUnResBandwidth.get(maxUnResBandwidth.indexOf(subTlv)),
- other.maxUnResBandwidth.get(other.maxUnResBandwidth.indexOf(subTlv)));
- } else {
- isCommonBandwidth = false;
- }
- }
- while (ipv4local.hasNext() && isCommonIp4Loc) {
- Ip4Address subTlv = ipv4local.next();
- if (ipv4LocRouterId.contains(subTlv) && other.ipv4LocRouterId.contains(subTlv)) {
- isCommonIp4Loc = Objects.equals(ipv4LocRouterId.get(ipv4LocRouterId.indexOf(subTlv)),
- other.ipv4LocRouterId.get(other.ipv4LocRouterId.indexOf(subTlv)));
- } else {
- isCommonIp4Loc = false;
- }
- }
- while (ipv4remote.hasNext() && isCommonIp4Rem) {
- Ip4Address subTlv = ipv4remote.next();
- if (ipv4RemRouterId.contains(subTlv) && other.ipv4RemRouterId.contains(subTlv)) {
- isCommonIp4Rem = Objects.equals(ipv4RemRouterId.get(ipv4RemRouterId.indexOf(subTlv)),
- other.ipv4RemRouterId.get(other.ipv4RemRouterId.indexOf(subTlv)));
- } else {
- isCommonIp4Rem = false;
- }
- }
- while (ipv6remote.hasNext() && isCommonIp6Rem) {
- Ip6Address subTlv = ipv6remote.next();
- if (ipv6RemRouterId.contains(subTlv) && other.ipv6RemRouterId.contains(subTlv)) {
- isCommonIp6Rem = Objects.equals(ipv6RemRouterId.get(ipv6RemRouterId.indexOf(subTlv)),
- other.ipv6RemRouterId.get(other.ipv6RemRouterId.indexOf(subTlv)));
- } else {
- isCommonIp6Rem = false;
- }
- }
- while (ipv6local.hasNext() && isCommonIp6Loc) {
- Ip6Address subTlv = ipv6local.next();
- if (ipv6LocRouterId.contains(subTlv) && other.ipv6LocRouterId.contains(subTlv)) {
- isCommonIp6Loc = Objects.equals(ipv6LocRouterId.get(ipv6LocRouterId.indexOf(subTlv)),
- other.ipv6LocRouterId.get(other.ipv6LocRouterId.indexOf(subTlv)));
- } else {
- isCommonIp6Loc = false;
- }
- }
- while (srlg.hasNext() && isCommonIp6Loc) {
- Srlg subTlv = srlg.next();
- if (srlgGroup.contains(subTlv) && other.srlgGroup.contains(subTlv)) {
- isCommonSrlg = Objects.equals(srlgGroup.get(srlgGroup.indexOf(subTlv)),
- other.srlgGroup.get(other.srlgGroup.indexOf(subTlv)));
- } else {
- isCommonSrlg = false;
- }
- }
- return isCommonBandwidth && isCommonIp4Loc && isCommonIp4Rem && isCommonIp6Rem && isCommonIp6Loc
- && isCommonSrlg
- && Objects.equals(igpMetric, other.igpMetric)
- && Objects.equals(teMetric, other.teMetric)
- && Objects.equals(maximumLink, other.maximumLink)
- && Objects.equals(protectType, other.protectType)
- && Objects.equals(color, other.color)
- && Objects.equals(signalType, other.signalType);
- }
- }
- return false;
- }
-
- @Override
- public String toString() {
- return toStringHelper(this)
- .add("igpMetric", igpMetric)
- .add("teMetric", teMetric)
- .add("maximumLink", maximumLink)
- .add("maxReserved", maxReserved)
- .add("maxUnResBandwidth", maxUnResBandwidth)
- .add("ipv4LocRouterId", ipv4LocRouterId)
- .add("ipv4RemRouterId", ipv4RemRouterId)
- .add("ipv6LocRouterId", ipv6LocRouterId)
- .add("ipv6RemRouterId", ipv6RemRouterId)
- .add("protectType", protectType)
- .add("color", color)
- .add("srlgGroup", srlgGroup)
- .add("signalType", signalType)
- .toString();
- }
-}
\ No newline at end of file
diff --git a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/Metric.java b/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/Metric.java
deleted file mode 100644
index b292a29..0000000
--- a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/Metric.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright 2015-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.iptopology.api;
-
-import static com.google.common.base.MoreObjects.toStringHelper;
-
-import java.util.Objects;
-
-/**
- * Represents Traffic engineering metrics.
- */
-public class Metric {
- private final Integer metric;
-
- /**
- * Constructor to initialize its metric.
- *
- * @param metric can be TE metric or IGP metric or Prefix metric
- */
- public Metric(Integer metric) {
- this.metric = metric;
- }
-
- /**
- * Obtains traffic engineering metric.
- *
- * @return traffic engineering metric
- */
- public Integer metric() {
- return metric;
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(metric);
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
-
- if (obj instanceof Metric) {
- Metric other = (Metric) obj;
- return Objects.equals(metric, other.metric);
- }
- return false;
- }
-
- @Override
- public String toString() {
- return toStringHelper(this)
- .add("metric", metric)
- .toString();
- }
-}
\ No newline at end of file
diff --git a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/OspfPseudonode.java b/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/OspfPseudonode.java
deleted file mode 100644
index 5a9995f..0000000
--- a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/OspfPseudonode.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * Copyright 2015-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.iptopology.api;
-
-import static com.google.common.base.MoreObjects.toStringHelper;
-
-import java.util.Objects;
-
-import org.onlab.packet.Ip4Address;
-
-/**
- * Represents Pseudonode information of OSFP device.
- */
-public class OspfPseudonode implements RouteIdentifier {
- private final RouterId designatedRouter;
- private final Ip4Address drInterface;
- private final ProtocolType type;
-
- /**
- * Constructor to initialize the values.
- *
- * @param designatedRouter Router Id of designated router
- * @param drInterface IP address of Designated Router interface
- * @param type Protocol ID
- */
- public OspfPseudonode(RouterId designatedRouter, Ip4Address drInterface, ProtocolType type) {
- this.designatedRouter = designatedRouter;
- this.drInterface = drInterface;
- this.type = type;
- }
-
- /**
- * Obtains designated Router Id.
- *
- * @return designated Router Id
- */
- public RouterId designatedRouter() {
- return designatedRouter;
- }
-
- /**
- * Obtains IP address of Designated Router interface.
- *
- * @return IP address of Designated Router interface
- */
- public Ip4Address drInterface() {
- return drInterface;
- }
-
- @Override
- public ProtocolType type() {
- return type;
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(designatedRouter, drInterface, type);
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
-
- if (obj instanceof OspfPseudonode) {
- OspfPseudonode other = (OspfPseudonode) obj;
- return Objects.equals(designatedRouter, other.designatedRouter)
- && Objects.equals(drInterface, other.drInterface)
- && Objects.equals(type, other.type);
- }
- return false;
- }
-
- @Override
- public String toString() {
- return toStringHelper(this)
- .add("designatedRouter", designatedRouter)
- .add("drInterface", drInterface)
- .add("type", type)
- .toString();
- }
-}
\ No newline at end of file
diff --git a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/Position.java b/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/Position.java
deleted file mode 100644
index 35f630a..0000000
--- a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/Position.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Copyright 2015-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.iptopology.api;
-
-import static com.google.common.base.MoreObjects.toStringHelper;
-
-import java.util.Objects;
-
-/**
- * Represents Position of device in the network.
- */
-public class Position {
- private final Boolean asbr;
- private final Boolean abr;
-
- /**
- * Constructor to set position of device.
- *
- * @param asbr autonomous system boundary router
- * @param abr area boundary router
- */
- public Position(Boolean asbr, Boolean abr) {
- this.asbr = asbr;
- this.abr = abr;
- }
-
- /**
- * obtain whether the device is autonomous system boundary router or not.
- *
- * @return autonomous system boundary router or not
- */
- Boolean asbr() {
- return asbr;
- }
-
- /**
- * obtain whether the device is area boundary router or not.
- *
- * @return area boundary router or not
- */
- Boolean abr() {
- return abr;
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(abr, asbr);
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
-
- if (obj instanceof Position) {
- Position other = (Position) obj;
- return Objects.equals(abr, other.abr) && Objects.equals(asbr, other.asbr);
- }
- return false;
- }
-
- @Override
- public String toString() {
- return toStringHelper(this)
- .omitNullValues()
- .add("abrBit", abr)
- .add("asbrBit", asbr)
- .toString();
- }
-}
\ No newline at end of file
diff --git a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/PrefixIdentifier.java b/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/PrefixIdentifier.java
deleted file mode 100644
index 044745a..0000000
--- a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/PrefixIdentifier.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Copyright 2015-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.iptopology.api;
-
-import static com.google.common.base.MoreObjects.toStringHelper;
-
-import java.util.Objects;
-
-/**
- * This class provides Prefix Identifier details.
- */
-public class PrefixIdentifier {
- private final TopologyId topologyId;
- private final RouteType routeType;
- private final IpReachability ipReach;
-
- /**
- * Constructor to initialize its parameters.
- *
- * @param topologyId topology ID of prefix
- * @param routeType OSPF Route type of the prefix
- * @param ipReach IP address prefix reachability information
- */
- public PrefixIdentifier(TopologyId topologyId, RouteType routeType, IpReachability ipReach) {
- this.topologyId = topologyId;
- this.routeType = routeType;
- this.ipReach = ipReach;
- }
-
- /**
- * Provides topology ID of prefix.
- *
- * @return topology id
- */
- public TopologyId topologyId() {
- return this.topologyId;
- }
-
- /**
- * Provides IP address prefix reachability information.
- *
- * @return IP address prefix
- */
- public IpReachability ipReach() {
- return this.ipReach;
- }
-
- /**
- * Provides OSPF Route type of the prefix.
- *
- * @return Route type
- */
- public RouteType routeType() {
- return this.routeType;
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(topologyId, routeType, ipReach);
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
-
- if (obj instanceof PrefixIdentifier) {
- PrefixIdentifier other = (PrefixIdentifier) obj;
- return Objects.equals(topologyId, other.topologyId) && Objects.equals(routeType, other.routeType)
- && Objects.equals(ipReach, other.ipReach);
- }
- return false;
- }
-
- @Override
- public String toString() {
- return toStringHelper(this)
- .omitNullValues()
- .add("routeType", routeType)
- .add("ipReach", ipReach)
- .add("topologyId", topologyId)
- .toString();
- }
-}
\ No newline at end of file
diff --git a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/PrefixTed.java b/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/PrefixTed.java
deleted file mode 100644
index bde823d..0000000
--- a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/PrefixTed.java
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
- * Copyright 2015-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.iptopology.api;
-
-import static com.google.common.base.MoreObjects.toStringHelper;
-
-import java.util.Iterator;
-import java.util.List;
-import java.util.Objects;
-
-import org.onlab.packet.IpAddress;
-
-/**
- * This class provides implementation of prefix traffic engineering data.
- */
-public class PrefixTed {
- private final IgpFlags igpFlags;
- private final List<RouteTag> routeTag;
- private final List<ExtendedRouteTag> extendedRouteTag;
- private final Metric metric;
- private final IpAddress fwdingAddress;
-
- /**
- * Constructor to initialize its fields.
- *
- * @param igpFlags IS-IS and OSPF flags assigned to the prefix
- * @param routeTag IGP (ISIS or OSPF) tags of the prefix
- * @param extendedRouteTag extended ISIS route tags of the prefix
- * @param metric metric of the prefix
- * @param fwdingAddress OSPF forwarding address
- */
- public PrefixTed(IgpFlags igpFlags, List<RouteTag> routeTag, List<ExtendedRouteTag> extendedRouteTag,
- Metric metric, IpAddress fwdingAddress) {
- this.igpFlags = igpFlags;
- this.routeTag = routeTag;
- this.extendedRouteTag = extendedRouteTag;
- this.metric = metric;
- this.fwdingAddress = fwdingAddress;
- }
-
- /**
- * Provides IS-IS and OSPF flags assigned to the prefix.
- *
- * @return IGP flags
- */
- public IgpFlags igpFlags() {
- return igpFlags;
- }
-
- /**
- * Provides IGP (ISIS or OSPF) tags of the prefix.
- *
- * @return IGP route tag.
- */
- public List<RouteTag> routeTag() {
- return routeTag;
- }
-
- /**
- * Provides extended ISIS route tags of the prefix.
- *
- * @return extended IS-IS route tag
- */
- public List<ExtendedRouteTag> extendedRouteTag() {
- return extendedRouteTag;
- }
-
- /**
- * Provides metric of the prefix.
- *
- * @return prefix metric
- */
- public Metric metric() {
- return metric;
- }
-
- /**
- * Provides OSPF forwarding address.
- *
- * @return forwarding address
- */
- public IpAddress fwdingAddress() {
- return fwdingAddress;
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(igpFlags, routeTag, extendedRouteTag, metric, fwdingAddress);
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
-
- if (obj instanceof PrefixTed) {
- PrefixTed other = (PrefixTed) obj;
- Iterator<RouteTag> objListIterator = other.routeTag.iterator();
- int countOtherCommonRouteTag = other.routeTag.size();
- int countCommonRouteTag = routeTag.size();
-
- Iterator<ExtendedRouteTag> objListIterator1 = other.extendedRouteTag.iterator();
- int countOtherCommonExtRouteTag = other.extendedRouteTag.size();
- int countCommonExtRouteTag = extendedRouteTag.size();
-
- boolean isCommonRouteType = true;
- boolean isCommonExtRouteType = true;
- if (countOtherCommonRouteTag != countCommonRouteTag
- || countOtherCommonExtRouteTag != countCommonExtRouteTag) {
- return false;
- } else {
- while (objListIterator.hasNext() && isCommonRouteType) {
- RouteTag subTlv = objListIterator.next();
- if (routeTag.contains(subTlv) && other.routeTag.contains(subTlv)) {
- isCommonRouteType = Objects.equals(routeTag.get(routeTag.indexOf(subTlv)),
- other.routeTag.get(other.routeTag.indexOf(subTlv)));
- } else {
- isCommonRouteType = false;
- }
- }
- while (objListIterator1.hasNext() && isCommonExtRouteType) {
- ExtendedRouteTag subTlv = objListIterator1.next();
- if (extendedRouteTag.contains(subTlv) && other.extendedRouteTag.contains(subTlv)) {
- isCommonExtRouteType = Objects.equals(extendedRouteTag.get(extendedRouteTag.indexOf(subTlv)),
- other.extendedRouteTag.get(other.extendedRouteTag.indexOf(subTlv)));
- } else {
- isCommonExtRouteType = false;
- }
- }
- return isCommonRouteType && isCommonExtRouteType && Objects.equals(igpFlags, other.igpFlags)
- && Objects.equals(metric, other.metric) && Objects.equals(fwdingAddress, other.fwdingAddress);
- }
- }
- return false;
- }
-
- @Override
- public String toString() {
- return toStringHelper(this)
- .omitNullValues()
- .add("igpFlags", igpFlags)
- .add("extendedRouteTag", extendedRouteTag)
- .add("routeTag", routeTag)
- .add("metric", metric)
- .add("fwdingAddress", fwdingAddress)
- .toString();
- }
-}
diff --git a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/ProtectionType.java b/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/ProtectionType.java
deleted file mode 100644
index c6f1088..0000000
--- a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/ProtectionType.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * Copyright 2015-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.iptopology.api;
-
-import static com.google.common.base.MoreObjects.toStringHelper;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Objects;
-
-/**
- * Represents protection capabilities of the link.
- */
-public class ProtectionType {
- private final LinkProtectionType protectionType;
-
- /**
- * Enum to provide Link Protection type.
- */
- public enum LinkProtectionType {
- Extra_Traffic(1), Unprotected(2), Shared(4), Enhanced(0x20), Dedicated_OneIsToOne(8),
- Dedicated_OnePlusOne(0x10), Reserved(0x40);
- int value;
-
- /**
- * Constructor to assign value.
- *
- * @param val link protection type
- */
- LinkProtectionType(int val) {
- value = val;
- }
-
- static Map<Integer, LinkProtectionType> map = new HashMap<>();
-
- static {
- for (LinkProtectionType type : LinkProtectionType.values()) {
- map.put(type.value, type);
- }
- }
-
- /**
- * A method that returns enum value.
- *
- * @param value link protection type
- * @return Enum value
- */
- public static LinkProtectionType getEnumType(int value) {
- return map.get(value);
- }
-
- /**
- * Provides Link protection type.
- *
- * @return protection type
- */
- public byte type() {
- return (byte) value;
- }
- }
-
- /**
- * Constructor to initialize protection type.
- *
- * @param protectionType link protection type
- */
- public ProtectionType(LinkProtectionType protectionType) {
- this.protectionType = protectionType;
- }
-
- /**
- * Provides protection capabilities of the link.
- *
- * @return link protection type.
- */
- public LinkProtectionType protectionType() {
- return protectionType;
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(protectionType);
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
-
- if (obj instanceof ProtectionType) {
- ProtectionType other = (ProtectionType) obj;
- return Objects.equals(protectionType, other.protectionType);
- }
- return false;
- }
-
- @Override
- public String toString() {
- return toStringHelper(this)
- .add("protectionType", protectionType)
- .toString();
- }
-}
\ No newline at end of file
diff --git a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/RouteDistinguisher.java b/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/RouteDistinguisher.java
deleted file mode 100644
index 37626fe..0000000
--- a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/RouteDistinguisher.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright 2015-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.
- */
-
-/**
- * Implementation of RouteDistinguisher.
- */
-package org.onosproject.iptopology.api;
-
-import static com.google.common.base.MoreObjects.toStringHelper;
-
-import java.util.Objects;
-
-/**
- * Represents Route Distinguisher of device in the network.
- */
-public class RouteDistinguisher {
- private final Long routeDistinguisher;
-
- /**
- * Constructor to initialize parameters.
- *
- * @param routeDistinguisher route distinguisher
- */
- public RouteDistinguisher(Long routeDistinguisher) {
- this.routeDistinguisher = routeDistinguisher;
- }
-
- /**
- * Obtain route distinguisher.
- *
- * @return route distinguisher
- */
- public Long routeDistinguisher() {
- return routeDistinguisher;
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(routeDistinguisher);
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
-
- if (obj instanceof RouteDistinguisher) {
- RouteDistinguisher other = (RouteDistinguisher) obj;
- return Objects.equals(routeDistinguisher, other.routeDistinguisher);
- }
- return false;
- }
-
- @Override
- public String toString() {
- return toStringHelper(this)
- .add("routeDistinguisher", routeDistinguisher)
- .toString();
- }
-}
\ No newline at end of file
diff --git a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/RouteIdentifier.java b/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/RouteIdentifier.java
deleted file mode 100644
index e0de402..0000000
--- a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/RouteIdentifier.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright 2015-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.iptopology.api;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * Abstraction of Router ID to identify the router with a distinct IP address.
- */
-public interface RouteIdentifier {
- /**
- * Enum to provide Protocol type.
- */
- public enum ProtocolType {
- ISIS_LevelOne(1), ISIS_LevelTwo(2), OSPFv2(3), Direct(4), Static_Configuration(5), OSPFv3(6);
- int value;
-
- /**
- * Sets protocol ID.
- *
- * @param val protocol ID
- */
- ProtocolType(int val) {
- value = val;
- }
-
- static Map<Integer, ProtocolType> map = new HashMap<>();
-
- static {
- for (ProtocolType type : ProtocolType.values()) {
- map.put(type.value, type);
- }
- }
-
- /**
- * A method that returns enum value.
- *
- * @param value protocol type
- * @return Enum value
- */
- public static ProtocolType getEnumType(int value) {
- return map.get(value);
- }
-
- /**
- * Provides Protocol ID.
- *
- * @return Protocol ID
- */
- public byte getType() {
- return (byte) value;
- }
- }
-
- /**
- * Provides Protocol ID to identify which protocol routing instance is used.
- *
- * @return Protocol type
- */
- ProtocolType type();
-}
\ No newline at end of file
diff --git a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/RouteInstance.java b/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/RouteInstance.java
deleted file mode 100644
index f481157..0000000
--- a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/RouteInstance.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright 2015-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.iptopology.api;
-
-import static com.google.common.base.MoreObjects.toStringHelper;
-
-import java.util.Objects;
-
-/**
- * Represents routing universe where the network element belongs.
- */
-public class RouteInstance {
- private final long routeInstance;
-
- /**
- * Constructor to initialize routeInstance.
- *
- * @param routeInstance routing protocol instance
- */
- public RouteInstance(long routeInstance) {
- this.routeInstance = routeInstance;
- }
-
- /**
- * Obtain route instance.
- *
- * @return route instance
- */
- public long routeInstance() {
- return routeInstance;
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(routeInstance);
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
-
- if (obj instanceof RouteInstance) {
- RouteInstance other = (RouteInstance) obj;
- return Objects.equals(routeInstance, other.routeInstance);
- }
- return false;
- }
-
- @Override
- public String toString() {
- return toStringHelper(this)
- .add("routeInstance", routeInstance)
- .toString();
- }
-}
\ No newline at end of file
diff --git a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/RouteTag.java b/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/RouteTag.java
deleted file mode 100644
index 558c811..0000000
--- a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/RouteTag.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright 2015-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.iptopology.api;
-
-import static com.google.common.base.MoreObjects.toStringHelper;
-
-import java.util.Objects;
-
-/**
- * Represents the igp administrative tags of the prefix.
- */
-public class RouteTag {
- private final int routeTag;
-
- /**
- * Constructor to initialize its parameter.
- *
- * @param routeTag IGP route tag
- */
- public RouteTag(int routeTag) {
- this.routeTag = routeTag;
- }
-
- /**
- * Obtains igp administrative tags of the prefix.
- *
- * @return igp administrative tags of the prefix
- */
- public int routeTag() {
- return routeTag;
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(routeTag);
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
-
- if (obj instanceof RouteTag) {
- RouteTag other = (RouteTag) obj;
- return Objects.equals(routeTag, other.routeTag);
- }
- return false;
- }
-
- @Override
- public String toString() {
- return toStringHelper(this)
- .add("routeTag", routeTag)
- .toString();
- }
-}
\ No newline at end of file
diff --git a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/RouteType.java b/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/RouteType.java
deleted file mode 100644
index 516fb0c..0000000
--- a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/RouteType.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * Copyright 2015-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.iptopology.api;
-
-import static com.google.common.base.MoreObjects.toStringHelper;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Objects;
-
-/**
- * Represents Route type of the prefix in the OSPF domain.
- */
-public class RouteType {
- private final Type routeType;
-
- /**
- * Enum to provide Route type.
- */
- public enum Type {
- Intra_Area(1), Inter_Area(2), External_1(3), External_2(4), NSSA_1(5), NSSA_2(6);
- int value;
-
- /**
- * Constructor to assign value.
- *
- * @param val route type
- */
- Type(int val) {
- value = val;
- }
-
- static Map<Integer, Type> map = new HashMap<>();
-
- static {
- for (Type type : Type.values()) {
- map.put(type.value, type);
- }
- }
-
- /**
- * A method that returns enum value.
- *
- * @param value route type
- * @return Enum value
- */
- public static Type getEnumType(int value) {
- return map.get(value);
- }
-
- /**
- * Provides route type.
- *
- * @return route type
- */
- public byte type() {
- return (byte) value;
- }
- }
-
- /**
- * Constructor to initialize routeType.
- *
- * @param routeType Route type
- */
- public RouteType(Type routeType) {
- this.routeType = routeType;
- }
-
- /**
- * Provides Route type of the prefix.
- *
- * @return Route type
- */
- public Type routeType() {
- return routeType;
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(routeType);
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
-
- if (obj instanceof RouteType) {
- RouteType other = (RouteType) obj;
- return Objects.equals(routeType, other.routeType);
- }
- return false;
- }
-
- @Override
- public String toString() {
- return toStringHelper(this)
- .add("routeType", routeType)
- .toString();
- }
-}
\ No newline at end of file
diff --git a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/RouterId.java b/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/RouterId.java
deleted file mode 100644
index 79780b8..0000000
--- a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/RouterId.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Copyright 2015-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.iptopology.api;
-
-import static com.google.common.base.MoreObjects.toStringHelper;
-
-import java.util.Objects;
-
-/**
- * Represents Router ID of the device.
- */
-public class RouterId implements RouteIdentifier {
- private final int routerId;
- private final ProtocolType type;
-
- /**
- * Constructor to initialize its parameters.
- *
- * @param routerId Router ID of designated router
- * @param type protocol type
- */
- public RouterId(int routerId, ProtocolType type) {
- this.routerId = routerId;
- this.type = type;
- }
-
- /**
- * Obtains Router Id of the device.
- *
- * @return Router Id of the device
- */
- public int routerId() {
- return routerId;
- }
-
- @Override
- public ProtocolType type() {
- return type;
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(routerId, type);
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
-
- if (obj instanceof RouterId) {
- RouterId other = (RouterId) obj;
- return Objects.equals(routerId, other.routerId) && Objects.equals(type, other.type);
- }
- return false;
- }
-
- @Override
- public String toString() {
- return toStringHelper(this)
- .add("routerId", routerId)
- .add("type", type)
- .toString();
- }
-}
\ No newline at end of file
diff --git a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/Signalling.java b/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/Signalling.java
deleted file mode 100644
index 319c4f6..0000000
--- a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/Signalling.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Copyright 2015-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.iptopology.api;
-
-import static com.google.common.base.MoreObjects.toStringHelper;
-
-import java.util.Objects;
-
-/**
- * Represents signaling protocols that are enabled.
- */
-public class Signalling {
- private final Boolean ldp;
- private final Boolean rsvpte;
-
- /**
- * Constructor to initialize the values.
- *
- * @param ldp Label Distribution Protocol whether enabled or not
- * @param rsvpte RSVP TE whether enabled or not
- */
- public Signalling(Boolean ldp, Boolean rsvpte) {
- this.ldp = ldp;
- this.rsvpte = rsvpte;
- }
-
- /**
- * Obtains whether LDP signalling protocol is enabled or not.
- *
- * @return LDP signalling protocol is enabled or not
- */
- public Boolean ldp() {
- return ldp;
- }
-
- /**
- * Obtains whether rsvp-te signalling protocol is enabled or not.
- *
- * @return rsvp-te signalling protocol is enabled or not
- */
- public Boolean rsvpte() {
- return rsvpte;
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(ldp, rsvpte);
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
-
- if (obj instanceof Signalling) {
- Signalling other = (Signalling) obj;
- return Objects.equals(ldp, other.ldp) && Objects.equals(rsvpte, other.rsvpte);
- }
- return false;
- }
-
- @Override
- public String toString() {
- return toStringHelper(this)
- .add("ldp", ldp)
- .add("rsvpte", rsvpte)
- .toString();
- }
-}
\ No newline at end of file
diff --git a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/Srlg.java b/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/Srlg.java
deleted file mode 100644
index 12106e4..0000000
--- a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/Srlg.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright 2015-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.iptopology.api;
-
-import static com.google.common.base.MoreObjects.toStringHelper;
-
-import java.util.Objects;
-
-/**
- * Represents Shared Risk Link Group information.
- */
-public class Srlg {
- private final int srlgGroup;
-
- /**
- * Constructor to initialize its parameter.
- *
- * @param srlgGroup list of Shared Risk Link Group value
- */
- public Srlg(int srlgGroup) {
- this.srlgGroup = srlgGroup;
- }
-
- /**
- * Provides Shared Risk link group.
- *
- * @return Shared Risk link group value
- */
- public int srlgGroup() {
- return srlgGroup;
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(srlgGroup);
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
-
- if (obj instanceof Srlg) {
- Srlg other = (Srlg) obj;
- return Objects.equals(srlgGroup, other.srlgGroup);
- }
- return false;
- }
-
- @Override
- public String toString() {
- return toStringHelper(this)
- .add("srlgGroup", srlgGroup)
- .toString();
- }
-}
\ No newline at end of file
diff --git a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/TerminationPoint.java b/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/TerminationPoint.java
deleted file mode 100644
index f174282..0000000
--- a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/TerminationPoint.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * Copyright 2015-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.iptopology.api;
-
-import java.util.Objects;
-
-import org.onosproject.net.DeviceId;
-import org.onosproject.net.ElementId;
-
-import com.google.common.base.MoreObjects;
-
-/**
- * Abstraction of a network termination point expressed as a pair of the network element identifier and device
- * interface.
- */
-public class TerminationPoint {
- private final ElementId elementId;
- private final DeviceInterface deviceInterface;
-
- /**
- * Constructor to initialize its parameters.
- *
- * @param elementId network element identifier
- * @param deviceInterface device interface
- */
- public TerminationPoint(ElementId elementId, DeviceInterface deviceInterface) {
- this.elementId = elementId;
- this.deviceInterface = deviceInterface;
- }
-
- /**
- * Returns the network element identifier.
- *
- * @return element identifier
- */
- public ElementId elementId() {
- return elementId;
- }
-
- /**
- * Returns the identifier of the infrastructure device if the termination
- * point belongs to a network element which is indeed an ip
- * device.
- *
- * @return network element identifier as a device identifier
- * @throws java.lang.IllegalStateException if termination point is not
- * associated with a device
- */
- public DeviceId deviceId() {
- if (elementId instanceof DeviceId) {
- return (DeviceId) elementId;
- }
- throw new IllegalStateException("Termination point not associated " +
- "with an ip device");
- }
-
- /**
- * Returns Device interface details.
- *
- * @return device interface details
- */
- public DeviceInterface deviceInterface() {
- return deviceInterface;
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(elementId, deviceInterface);
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
- if (obj instanceof TerminationPoint) {
- final TerminationPoint other = (TerminationPoint) obj;
- return Objects.equals(this.elementId, other.elementId)
- && Objects.equals(this.deviceInterface, other.deviceInterface);
- }
- return false;
- }
-
- @Override
- public String toString() {
- return MoreObjects.toStringHelper(this)
- .add("elementId", elementId)
- .add("deviceInterface", deviceInterface)
- .toString();
- }
-}
\ No newline at end of file
diff --git a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/TopologyId.java b/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/TopologyId.java
deleted file mode 100644
index 969f0d8..0000000
--- a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/TopologyId.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright 2015-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.iptopology.api;
-
-import org.onlab.util.Identifier;
-
-/**
- * Represents Multi-Topology IDs for a network link, node or prefix.
- */
-public class TopologyId extends Identifier<Short> {
- /**
- * Constructor to initialize its parameter.
- *
- * @param topologyId topology id for node/link/prefix
- */
- public TopologyId(short topologyId) {
- super(topologyId);
- }
-
- /**
- * Obtains the topology ID.
- *
- * @return topology ID
- */
- public short topologyId() {
- return identifier;
- }
-}
\ No newline at end of file
diff --git a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/device/DefaultInterfaceDescription.java b/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/device/DefaultInterfaceDescription.java
deleted file mode 100644
index 946a194..0000000
--- a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/device/DefaultInterfaceDescription.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * Copyright 2015-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.iptopology.api.device;
-
-import com.google.common.base.MoreObjects;
-import org.onlab.packet.Ip6Address;
-import org.onlab.packet.Ip4Address;
-import org.onosproject.iptopology.api.InterfaceIdentifier;
-import org.onosproject.net.AbstractDescription;
-import org.onosproject.net.SparseAnnotations;
-
-/**
- * Default implementation of immutable Interface description.
- */
-public class DefaultInterfaceDescription extends AbstractDescription
- implements InterfaceDescription {
-
- private final InterfaceIdentifier intfId;
- private final Ip4Address ipv4Address;
- private final Ip6Address ipv6Address;
-
-
-
- /**
- * Creates an interface description using the supplied information.
- *
- * @param intfId interface identifier
- * @param ipv4Address ipv4 address of an interface
- * @param ipv6Address ipv6 address of an interface
- * @param annotations optional key/value annotations map
- */
- public DefaultInterfaceDescription(InterfaceIdentifier intfId, Ip4Address ipv4Address,
- Ip6Address ipv6Address, SparseAnnotations...annotations) {
- super(annotations);
- this.intfId = intfId;
- this.ipv4Address = ipv4Address;
- this.ipv6Address = ipv6Address;
- }
-
- /**
- * Default constructor for serialization.
- */
- private DefaultInterfaceDescription() {
- this.intfId = null;
- this.ipv4Address = null;
- this.ipv6Address = null;
- }
-
- /**
- * Creates an interface description using the supplied information.
- *
- * @param base InterfaceDescription to get basic information from
- * @param annotations optional key/value annotations map
- */
- public DefaultInterfaceDescription(InterfaceDescription base,
- SparseAnnotations annotations) {
- this(base.intfId(), base.ipv4Address(), base.ipv6Address(), annotations);
- }
-
- @Override
- public InterfaceIdentifier intfId() {
- return intfId;
- }
-
- @Override
- public Ip4Address ipv4Address() {
- return ipv4Address;
- }
-
- @Override
- public Ip6Address ipv6Address() {
- return ipv6Address; }
-
- @Override
- public String toString() {
- return MoreObjects.toStringHelper(getClass())
- .add("intfId", intfId)
- .add("ipv4Address", ipv4Address)
- .add("ipv6Address", ipv6Address)
- .add("annotations", annotations())
- .toString();
- }
-
-}
diff --git a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/device/DefaultIpDeviceDescription.java b/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/device/DefaultIpDeviceDescription.java
deleted file mode 100644
index 43ee229..0000000
--- a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/device/DefaultIpDeviceDescription.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * Copyright 2015-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.iptopology.api.device;
-
-import org.onosproject.iptopology.api.DeviceTed;
-import org.onosproject.iptopology.api.IpDeviceIdentifier;
-import org.onosproject.net.AbstractDescription;
-import org.onosproject.net.SparseAnnotations;
-
-import java.net.URI;
-
-import static com.google.common.base.MoreObjects.toStringHelper;
-import static com.google.common.base.Preconditions.checkNotNull;
-import static org.onosproject.iptopology.api.IpDevice.Type;
-
-/**
- * Default implementation of immutable device description entity.
- */
-public class DefaultIpDeviceDescription extends AbstractDescription
- implements IpDeviceDescription {
- private final URI uri;
- private final Type type;
- private final IpDeviceIdentifier deviceIdentifier;
- private final DeviceTed deviceTed;
-
- /**
- * Creates an ip device description using the supplied information.
- *
- * @param uri device URI
- * @param type device type
- * @param deviceIdentifier device manufacturer
- * @param deviceTed device Traffic Engineering parameters
- * @param annotations optional key/value annotations map
- */
- public DefaultIpDeviceDescription(URI uri, Type type, IpDeviceIdentifier deviceIdentifier,
- DeviceTed deviceTed, SparseAnnotations... annotations) {
- super(annotations);
- this.uri = checkNotNull(uri, "Device URI cannot be null");
- this.type = checkNotNull(type, "Device type cannot be null");
- this.deviceIdentifier = deviceIdentifier;
- this.deviceTed = deviceTed;
- }
-
- /**
- * Creates an ip device description using the supplied information.
- * @param base IpDeviceDescription to basic information
- * @param annotations Annotations to use.
- */
- public DefaultIpDeviceDescription(IpDeviceDescription base, SparseAnnotations... annotations) {
- this(base.deviceUri(), base.type(), base.deviceIdentifier(),
- base.deviceTed(), annotations);
- }
-
- /**
- * Creates an ip device description using the supplied information.
- * @param base IpDeviceDescription to basic information (except for type)
- * @param type device type
- * @param annotations Annotations to use.
- */
- public DefaultIpDeviceDescription(IpDeviceDescription base, Type type, SparseAnnotations... annotations) {
- this(base.deviceUri(), type, base.deviceIdentifier(),
- base.deviceTed(), annotations);
- }
-
- @Override
- public URI deviceUri() {
- return uri;
- }
-
- @Override
- public Type type() {
- return type;
- }
-
- @Override
- public IpDeviceIdentifier deviceIdentifier() {
- return deviceIdentifier;
- }
-
- @Override
- public DeviceTed deviceTed() {
- return deviceTed;
- }
-
- @Override
- public String toString() {
- return toStringHelper(this)
- .add("uri", uri)
- .add("type", type)
- .add("devid", deviceIdentifier)
- .add("devTed", deviceTed)
- .toString();
- }
-
- /**
- * Default constructor for serialization.
- */
- private DefaultIpDeviceDescription() {
- this.uri = null;
- this.type = null;
- this.deviceIdentifier = null;
- this.deviceTed = null;
- }
-}
diff --git a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/device/DefaultPrefixDescription.java b/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/device/DefaultPrefixDescription.java
deleted file mode 100644
index 527a070..0000000
--- a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/device/DefaultPrefixDescription.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Copyright 2015-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.iptopology.api.device;
-
-import com.google.common.base.MoreObjects;
-import org.onosproject.iptopology.api.PrefixIdentifier;
-import org.onosproject.iptopology.api.PrefixTed;
-import org.onosproject.net.AbstractDescription;
-import org.onosproject.net.SparseAnnotations;
-
-/**
- * Default implementation of immutable Prefix description.
- */
-public class DefaultPrefixDescription extends AbstractDescription
- implements PrefixDescription {
-
- private final PrefixIdentifier prefixIdentifier;
- private final PrefixTed prefixTed;
-
-
- /**
- * Creates prefix description using the supplied information.
- *
- * @param prefixIdentifier prefix identifier
- * @param prefixTed prefix traffic engineering parameters
- * @param annotations optional key/value annotations map
- */
- public DefaultPrefixDescription(PrefixIdentifier prefixIdentifier, PrefixTed prefixTed,
- SparseAnnotations...annotations) {
- super(annotations);
- this.prefixIdentifier = prefixIdentifier;
- this.prefixTed = prefixTed;
- }
-
- /**
- * Default constructor for serialization.
- */
- private DefaultPrefixDescription() {
- this.prefixIdentifier = null;
- this.prefixTed = null;
- }
-
- /**
- * Creates prefix description using the supplied information.
- *
- * @param base PrefixDescription to get basic information from
- * @param annotations optional key/value annotations map
- */
- public DefaultPrefixDescription(PrefixDescription base,
- SparseAnnotations annotations) {
- this(base.prefixIdentifier(), base.prefixTed(), annotations);
- }
-
- @Override
- public PrefixIdentifier prefixIdentifier() {
- return prefixIdentifier;
- }
-
- @Override
- public PrefixTed prefixTed() {
- return prefixTed;
- }
-
- @Override
- public String toString() {
- return MoreObjects.toStringHelper(getClass())
- .add("prefixIdentifier", prefixIdentifier)
- .add("prefixTed", prefixTed)
- .add("annotations", annotations())
- .toString();
- }
-
-}
diff --git a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/device/InterfaceDescription.java b/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/device/InterfaceDescription.java
deleted file mode 100644
index 50121c3..0000000
--- a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/device/InterfaceDescription.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright 2015-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.iptopology.api.device;
-
-import org.onlab.packet.Ip4Address;
-import org.onlab.packet.Ip6Address;
-import org.onosproject.iptopology.api.InterfaceIdentifier;
-import org.onosproject.net.Description;
-
-
-/**
- * Information about an interface.
- */
-public interface InterfaceDescription extends Description {
-
- /**
- * Returns the IPv4 Address of an interface.
- *
- * @return ipv4 address
- */
- Ip4Address ipv4Address();
-
- /**
- * Returns the IPv6 Address of an interface.
- *
- * @return ipv6 address
- */
- Ip6Address ipv6Address();
-
-
- /**
- * Returns the interface id of the interface.
- *
- * @return interface identifier
- */
- InterfaceIdentifier intfId();
-
-}
diff --git a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/device/IpDeviceDescription.java b/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/device/IpDeviceDescription.java
deleted file mode 100644
index 81dc9f6..0000000
--- a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/device/IpDeviceDescription.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright 2015-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.iptopology.api.device;
-
-import org.onosproject.iptopology.api.DeviceTed;
-import org.onosproject.iptopology.api.IpDevice;
-import org.onosproject.iptopology.api.IpDeviceIdentifier;
-import org.onosproject.net.Description;
-
-
-import java.net.URI;
-
-/**
- * Carrier of immutable information about an ip device.
- */
-public interface IpDeviceDescription extends Description {
-
- /**
- * Protocol/provider specific URI that can be used to encode the identity
- * information required to communicate with the ip device externally, e.g.
- * datapath ID.
- *
- * @return provider specific URI for the ip device
- */
- URI deviceUri();
-
- /**
- * Returns the type of the ip device. For ex: Pseudo or actual
- *
- * @return type of the device
- */
- IpDevice.Type type();
-
- /**
- * Returns the device identifier details.
- *
- * @return identifier of the device
- */
- IpDeviceIdentifier deviceIdentifier();
-
- /**
- * Returns the traffic engineering parameters of the device.
- *
- * @return traffic engineering parameters of the device
- */
- DeviceTed deviceTed();
-
-}
diff --git a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/device/IpDeviceEvent.java b/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/device/IpDeviceEvent.java
deleted file mode 100644
index 26aaf31..0000000
--- a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/device/IpDeviceEvent.java
+++ /dev/null
@@ -1,183 +0,0 @@
-/*
- * Copyright 2015-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.iptopology.api.device;
-
-import org.onlab.util.Tools;
-import org.onosproject.event.AbstractEvent;
-import org.onosproject.iptopology.api.DeviceIntf;
-import org.onosproject.iptopology.api.DevicePrefix;
-import org.onosproject.iptopology.api.IpDevice;
-
-
-import static com.google.common.base.MoreObjects.toStringHelper;
-
-/**
- * Describes ip device event.
- */
-public class IpDeviceEvent extends AbstractEvent<IpDeviceEvent.Type, IpDevice> {
-
- private final DeviceIntf devInterface;
- private final DevicePrefix devicePrefix;
-
- /**
- * Type of device events.
- */
- public enum Type {
- /**
- * Signifies that a new device has been detected.
- */
- DEVICE_ADDED,
-
- /**
- * Signifies that some device attributes have changed; excludes
- * availability changes.
- */
- DEVICE_UPDATED,
-
- /**
- * Signifies that a device has been removed.
- */
- DEVICE_REMOVED,
-
- /**
- * Signifies that an interface has been added.
- */
- INTERFACE_ADDED,
-
- /**
- * Signifies that an interface has been updated.
- */
- INTERFACE_UPDATED,
-
- /**
- * Signifies that an interface has been removed.
- */
- INTERFACE_REMOVED,
-
- /**
- * Signifies that a prefix has been added.
- */
- PREFIX_ADDED,
-
- /**
- * Signifies that a prefix has been updated.
- */
- PREFIX_UPDATED,
-
- /**
- * Signifies that a prefix has been removed.
- */
- PREFIX_REMOVED,
-
- }
-
- /**
- * Creates an event of a given type and for the specified ip device.
- *
- * @param type device event type
- * @param device event device subject
- */
- public IpDeviceEvent(Type type, IpDevice device) {
- this(type, device, null, null);
- }
-
- /**
- * Creates an event of a given type and for the specified device and interface.
- *
- * @param type device event type
- * @param device event device subject
- * @param devInterface optional interface subject
- */
- public IpDeviceEvent(Type type, IpDevice device, DeviceIntf devInterface) {
- this(type, device, devInterface, null);
- }
-
- /**
- * Creates an event of a given type and for the specified device and interface.
- *
- * @param type device event type
- * @param device event device subject
- * @param devicePrefix optional prefix subject
- */
- public IpDeviceEvent(Type type, IpDevice device, DevicePrefix devicePrefix) {
- this(type, device, null, devicePrefix);
- }
-
-
- /**
- * Creates an event of a given type and for the specified device, interface and prefix.
- *
- * @param type device event type
- * @param device event device subject
- * @param devInterface optional interface subject
- * @param devicePrefix optional prefix subject
- */
- public IpDeviceEvent(Type type, IpDevice device, DeviceIntf devInterface, DevicePrefix devicePrefix) {
- super(type, device);
- this.devInterface = devInterface;
- this.devicePrefix = devicePrefix;
- }
-
-
- /**
- * Creates an event of a given type and for the specified device, interface and time.
- *
- * @param type device event type
- * @param device event device subject
- * @param devInterface optional interface subject
- * @param devicePrefix optional prefix subject
- * @param time occurrence time
- */
-
- public IpDeviceEvent(Type type, IpDevice device, DeviceIntf devInterface, DevicePrefix devicePrefix, long time) {
- super(type, device, time);
- this.devInterface = devInterface;
- this.devicePrefix = devicePrefix;
- }
-
-
- /**
- * Returns the interface subject.
- *
- * @return interface subject or null if the event is not interface specific.
- */
- public DeviceIntf deviceInterface() {
- return devInterface;
- }
-
- /**
- * Returns the prefix subject.
- *
- * @return prefix subject or null if the event is not prefix specific.
- */
- public DevicePrefix prefix() {
- return devicePrefix;
- }
-
- @Override
- public String toString() {
- if (devInterface == null || devicePrefix == null) {
- return super.toString();
- }
- return toStringHelper(this)
- .add("time", Tools.defaultOffsetDataTime(time()))
- .add("type", type())
- .add("subject", subject())
- .add("interface", devInterface)
- .add("prefix", devicePrefix)
- .toString();
- }
-}
diff --git a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/device/IpDeviceListener.java b/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/device/IpDeviceListener.java
deleted file mode 100644
index d8c5b14..0000000
--- a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/device/IpDeviceListener.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Copyright 2015-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.iptopology.api.device;
-
-import org.onosproject.event.EventListener;
-
-/**
- * Entity capable of receiving ip device related events.
- */
-public interface IpDeviceListener extends EventListener<IpDeviceEvent> {
-}
diff --git a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/device/IpDeviceProvider.java b/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/device/IpDeviceProvider.java
deleted file mode 100644
index 30660e7..0000000
--- a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/device/IpDeviceProvider.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Copyright 2015-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.iptopology.api.device;
-
-import org.onosproject.net.provider.Provider;
-
-/**
- * Abstraction of a ip device information provider.
- */
-public interface IpDeviceProvider extends Provider {
- // Currently there is none to set some information into the network
-}
diff --git a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/device/IpDeviceProviderRegistry.java b/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/device/IpDeviceProviderRegistry.java
deleted file mode 100644
index 05736ac..0000000
--- a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/device/IpDeviceProviderRegistry.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Copyright 2015-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.iptopology.api.device;
-
-import org.onosproject.net.provider.ProviderRegistry;
-
-/**
- * Abstraction of a ip device provider registry.
- */
-public interface IpDeviceProviderRegistry
- extends ProviderRegistry<IpDeviceProvider, IpDeviceProviderService> {
-}
diff --git a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/device/IpDeviceProviderService.java b/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/device/IpDeviceProviderService.java
deleted file mode 100644
index 759e79e..0000000
--- a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/device/IpDeviceProviderService.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Copyright 2015-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.iptopology.api.device;
-
-import org.onosproject.net.DeviceId;
-import org.onosproject.net.provider.ProviderService;
-
-import java.util.List;
-
-/**
- * Service through which ip device providers can inject ip device information into
- * the core.
- */
-public interface IpDeviceProviderService extends ProviderService<IpDeviceProvider> {
-
- /**
- * Signals the core that an ip device is added or updated with IP topology information.
- *
- * @param deviceId device identifier
- * @param deviceDescription information about network ip device
- */
- void addOrUpdateIpDevice(DeviceId deviceId, IpDeviceDescription deviceDescription);
-
- /**
- * Signals the core that an ip device is removed.
- *
- * @param deviceId identity of the ip device to be removed
- */
- void removeIpDevice(DeviceId deviceId);
-
- /**
- * Sends information about all interfaces of a device. It is up to the core to
- * determine what has changed.
- *
- * @param deviceId identity of the ip device
- * @param interfaceDescriptions list of device interfaces
- */
- void updateInterfaces(DeviceId deviceId, List<InterfaceDescription> interfaceDescriptions);
-
- /**
- * signals interfaces of a device is deleted.
- *
- * @param deviceId identity of the ip device
- * @param interfaceDescriptions list of device interfaces
- */
- void removeInterfaces(DeviceId deviceId, List<InterfaceDescription> interfaceDescriptions);
-
- /**
- * Sends information about all ip prefix of a device. It is up to the core to
- * determine what has changed.
- *
- * @param deviceId identity of the ip device
- * @param prefixDescriptions list of device ip prefixes
- */
- void updatePrefixes(DeviceId deviceId, List<PrefixDescription> prefixDescriptions);
-
- /**
- * signals ip prefix of a device is deleted.
- *
- * @param deviceId identity of the ip device
- * @param prefixDescriptions list of device ip prefixes
- */
- void removePrefixes(DeviceId deviceId, List<PrefixDescription> prefixDescriptions);
-
-}
diff --git a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/device/IpDeviceService.java b/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/device/IpDeviceService.java
deleted file mode 100644
index 3b84cfc..0000000
--- a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/device/IpDeviceService.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * Copyright 2015-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.iptopology.api.device;
-
-import org.onosproject.event.ListenerService;
-import org.onosproject.iptopology.api.DeviceIntf;
-import org.onosproject.iptopology.api.DevicePrefix;
-import org.onosproject.iptopology.api.InterfaceIdentifier;
-import org.onosproject.iptopology.api.IpDevice;
-import org.onosproject.net.DeviceId;
-import org.onlab.packet.Ip4Address;
-import org.onlab.packet.Ip6Address;
-
-import java.util.List;
-
-/**
- * Service for interacting with the inventory of ip devices.
- */
-public interface IpDeviceService
- extends ListenerService<IpDeviceEvent, IpDeviceListener> {
-
- /**
- * Returns the number of ip devices known to the system.
- *
- * @return number of infrastructure devices
- */
- int getIpDeviceCount();
-
- /**
- * Returns a collection of the currently known ip
- * devices.
- *
- * @return collection of devices
- */
- Iterable<IpDevice> getIpDevices();
-
- /**
- * Returns a collection of the currently known ip
- * devices by device type.
- *
- * @param type device type
- * @return collection of devices
- */
- Iterable<IpDevice> getIpDevices(IpDevice.Type type);
-
-
- /**
- * Returns the ip device with the specified identifier.
- *
- * @param deviceId device identifier
- * @return device or null if one with the given identifier is not known
- */
- IpDevice getIpDevice(DeviceId deviceId);
-
- /**
- * Returns the list of interfaces associated with the device.
- *
- * @param deviceId device identifier
- * @return list of device interfaces
- */
- List<DeviceIntf> getInterfaces(DeviceId deviceId);
-
- /**
- * Returns the interface with the specified ipv4 address and hosted by the given device.
- *
- * @param deviceId device identifier
- * @param ipv4Address ipv4 address
- * @return device interface
- */
- DeviceIntf getInterface(DeviceId deviceId, Ip4Address ipv4Address);
-
- /**
- * Returns the interface with the specified ipv6 address and hosted by the given device.
- *
- * @param deviceId device identifier
- * @param ipv6Address ipv6 address
- * @return device interface
- */
- DeviceIntf getInterface(DeviceId deviceId, Ip6Address ipv6Address);
-
- /**
- * Returns the interface with the specified interface id and hosted by the given device.
- *
- * @param deviceId device identifier
- * @param intfId interface id
- * @return device interface
- */
- DeviceIntf getInterface(DeviceId deviceId, InterfaceIdentifier intfId);
-
- /**
- * Returns the list of ip prefix associated with the device.
- *
- * @param deviceId device identifier
- * @return list of device prefixes
- */
- List<DevicePrefix> getPrefixes(DeviceId deviceId);
-
-}
diff --git a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/device/IpDeviceStore.java b/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/device/IpDeviceStore.java
deleted file mode 100644
index 6cacec4..0000000
--- a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/device/IpDeviceStore.java
+++ /dev/null
@@ -1,164 +0,0 @@
-/*
- * Copyright 2015-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.iptopology.api.device;
-
-import org.onlab.packet.Ip4Address;
-import org.onlab.packet.Ip6Address;
-import org.onosproject.iptopology.api.DevicePrefix;
-import org.onosproject.iptopology.api.InterfaceIdentifier;
-import org.onosproject.iptopology.api.IpDevice;
-import org.onosproject.iptopology.api.DeviceIntf;
-import org.onosproject.net.DeviceId;
-import org.onosproject.net.provider.ProviderId;
-import org.onosproject.store.Store;
-
-import java.util.List;
-
-/**
- * Manages inventory of ip devices; not intended for direct use.
- */
-public interface IpDeviceStore extends Store<IpDeviceEvent, IpDeviceStoreDelegate> {
-
- /**
- * Returns the number of ip devices known to the system.
- *
- * @return number of ip devices
- */
- int getIpDeviceCount();
-
- /**
- * Returns an iterable collection of all ip devices known to the system.
- *
- * @return ip device collection
- */
- Iterable<IpDevice> getIpDevices();
-
-
- /**
- * Returns an ip device with the specified identifier.
- *
- * @param deviceId device identifier
- * @return ip device
- */
- IpDevice getIpDevice(DeviceId deviceId);
-
- /**
- * Creates a new infrastructure ip device, or updates an existing one using
- * the supplied device description.
- *
- * @param providerId provider identifier
- * @param deviceId device identifier
- * @param deviceDescription device description
- * @return ready to send event describing what occurred; null if no change
- */
- IpDeviceEvent createOrUpdateIpDevice(ProviderId providerId, DeviceId deviceId,
- IpDeviceDescription deviceDescription);
-
- /**
- * Administratively removes the specified ip device from the store.
- *
- * @param deviceId device to be removed
- * @return null if no such ip device
- */
- IpDeviceEvent removeIpDevice(DeviceId deviceId);
-
- /**
- * Updates the interface of the specified ip device using the given
- * list of interface descriptions. The list is assumed to be comprehensive.
- *
- * @param providerId provider identifier
- * @param deviceId ip device identifier
- * @param interfaceDescriptions list of interface descriptions
- * @return ready to send events describing what occurred; empty list if no change
- */
- List<IpDeviceEvent> updateInterfaces(ProviderId providerId, DeviceId deviceId,
- List<InterfaceDescription> interfaceDescriptions);
-
- /**
- * Administratively removes the specified interface from the store.
- *
- * @param deviceId device of the interfaces to be removed
- * @param interfaceDescriptions list of interface descriptions
- * @return ready to send events describing what occurred.
- */
- List<IpDeviceEvent> removeInterfaces(DeviceId deviceId, List<InterfaceDescription> interfaceDescriptions);
-
- /**
- * Returns the list of interfaces that belong to the specified device.
- *
- * @param deviceId device identifier
- * @return list of device interfaces
- */
- List<DeviceIntf> getInterfaces(DeviceId deviceId);
-
- /**
- * Returns the specified device interface.
- *
- * @param deviceId device identifier
- * @param ipv4Address ipv4 address of the interface
- * @return device interface
- */
- DeviceIntf getInterface(DeviceId deviceId, Ip4Address ipv4Address);
-
- /**
- * Returns the specified device interface.
- *
- * @param deviceId device identifier
- * @param ipv6Address ipv6 address of the interface
- * @return device interface
- */
- DeviceIntf getInterface(DeviceId deviceId, Ip6Address ipv6Address);
-
- /**
- * Returns the specified device interface.
- *
- * @param deviceId device identifier
- * @param intfId interface identifier of the interface
- * @return device interface
- */
- DeviceIntf getInterface(DeviceId deviceId, InterfaceIdentifier intfId);
-
- /**
- * Updates the prefix information of the specified ip device using the given
- * list of prefix descriptions. The list is assumed to be comprehensive.
- *
- * @param providerId provider identifier
- * @param deviceId ip device identifier
- * @param prefixDescriptions list of prefix descriptions
- * @return ready to send events describing what occurred; empty list if no change
- */
- List<IpDeviceEvent> updatePrefixes(ProviderId providerId, DeviceId deviceId,
- List<PrefixDescription> prefixDescriptions);
-
- /**
- * Administratively removes the specified prefix from the store.
- *
- * @param deviceId device of the prefix to be removed
- * @param prefixDescriptions list of prefix descriptions
- * @return ready to send events describing what occurred.
- */
- List<IpDeviceEvent> removePrefixes(DeviceId deviceId, List<PrefixDescription> prefixDescriptions);
-
- /**
- * Returns the list of prefixes that belong to the specified device.
- *
- * @param deviceId device identifier
- * @return list of device prefixes
- */
- List<DevicePrefix> getPrefixes(DeviceId deviceId);
-
-}
-
diff --git a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/device/IpDeviceStoreDelegate.java b/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/device/IpDeviceStoreDelegate.java
deleted file mode 100644
index ccc41a1..0000000
--- a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/device/IpDeviceStoreDelegate.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Copyright 2015-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.iptopology.api.device;
-
-import org.onosproject.store.StoreDelegate;
-
-/**
- * Infrastructure ip topology store delegate abstraction.
- */
-public interface IpDeviceStoreDelegate extends StoreDelegate<IpDeviceEvent> {
-}
diff --git a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/device/PrefixDescription.java b/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/device/PrefixDescription.java
deleted file mode 100644
index 17e43eb..0000000
--- a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/device/PrefixDescription.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright 2015-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.iptopology.api.device;
-
-import org.onosproject.iptopology.api.PrefixIdentifier;
-import org.onosproject.iptopology.api.PrefixTed;
-import org.onosproject.net.Description;
-
-/**
- * Information about a prefix.
- */
-public interface PrefixDescription extends Description {
-
- /**
- * Returns the prefix identifier.
- *
- * @return prefix identifier
- */
- PrefixIdentifier prefixIdentifier();
-
- /**
- * Returns the prefix Traffic Engineering parameters.
- *
- * @return prefix Traffic Engineering parameters
- */
- PrefixTed prefixTed();
-
-}
diff --git a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/device/package-info.java b/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/device/package-info.java
deleted file mode 100644
index ee58cb6..0000000
--- a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/device/package-info.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright 2015-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.
- */
-
-/**
- * Ip device model & related services API definitions.
- */
-package org.onosproject.iptopology.api.device;
diff --git a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/link/DefaultIpLinkDescription.java b/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/link/DefaultIpLinkDescription.java
deleted file mode 100644
index 4c8d59d..0000000
--- a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/link/DefaultIpLinkDescription.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Copyright 2015-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.iptopology.api.link;
-
-import com.google.common.base.MoreObjects;
-import org.onosproject.iptopology.api.IpLinkIdentifier;
-import org.onosproject.iptopology.api.LinkTed;
-import org.onosproject.iptopology.api.TerminationPoint;
-import org.onosproject.net.AbstractDescription;
-import org.onosproject.net.SparseAnnotations;
-
-/**
- * Default implementation of immutable ip link description entity.
- */
-public class DefaultIpLinkDescription extends AbstractDescription
- implements IpLinkDescription {
-
- private final TerminationPoint src;
- private final TerminationPoint dst;
- private final IpLinkIdentifier linkIdentifier;
- private final LinkTed linkTed;
-
- /**
- * Creates an ip link description using the supplied information.
- *
- * @param src link source
- * @param dst link destination
- * @param linkIdentifier link identifier
- * @param linkTed link traffic engineering parameters
- * @param annotations optional key/value annotations
- */
- public DefaultIpLinkDescription(TerminationPoint src, TerminationPoint dst,
- IpLinkIdentifier linkIdentifier, LinkTed linkTed,
- SparseAnnotations... annotations) {
- super(annotations);
- this.src = src;
- this.dst = dst;
- this.linkIdentifier = linkIdentifier;
- this.linkTed = linkTed;
- }
-
- /**
- * Creates an ip link description using the supplied information.
- *
- * @param base IpLinkDescription to basic information
- * @param annotations optional key/value annotations
- */
- public DefaultIpLinkDescription(IpLinkDescription base, SparseAnnotations... annotations) {
- this(base.src(), base.dst(), base.linkIdentifier(),
- base.linkTed(), annotations);
- }
-
- @Override
- public TerminationPoint src() {
- return src;
- }
-
- @Override
- public TerminationPoint dst() {
- return dst;
- }
-
- @Override
- public IpLinkIdentifier linkIdentifier() {
- return linkIdentifier;
- }
-
- @Override
- public LinkTed linkTed() {
- return linkTed; }
-
- @Override
- public String toString() {
- return MoreObjects.toStringHelper(this)
- .add("src", src())
- .add("dst", dst())
- .add("linkIdentifier", linkIdentifier())
- .add("linkTed", linkTed())
- .toString();
- }
-
-}
diff --git a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/link/IpLinkDescription.java b/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/link/IpLinkDescription.java
deleted file mode 100644
index bd7642a..0000000
--- a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/link/IpLinkDescription.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright 2015-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.iptopology.api.link;
-
-import org.onosproject.iptopology.api.IpLinkIdentifier;
-import org.onosproject.iptopology.api.LinkTed;
-import org.onosproject.iptopology.api.TerminationPoint;
-import org.onosproject.net.Description;
-
-/**
- * Describes an ip link.
- */
-public interface IpLinkDescription extends Description {
-
- /**
- * Returns the link source.
- *
- * @return links source
- */
- TerminationPoint src();
-
- /**
- * Returns the link destination.
- *
- * @return links destination
- */
- TerminationPoint dst();
-
- /**
- * Returns the link identifier.
- *
- * @return links identifier informations
- */
- IpLinkIdentifier linkIdentifier();
-
- /**
- * Returns the link traffic engineering parameters.
- *
- * @return links traffic engineering parameters
- */
- LinkTed linkTed();
-}
diff --git a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/link/IpLinkEvent.java b/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/link/IpLinkEvent.java
deleted file mode 100644
index 0ad9f34..0000000
--- a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/link/IpLinkEvent.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright 2015-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.iptopology.api.link;
-
-import org.onosproject.event.AbstractEvent;
-import org.onosproject.iptopology.api.IpLink;
-
-/**
- * Describes ip link event.
- */
-public class IpLinkEvent extends AbstractEvent<IpLinkEvent.Type, IpLink> {
-
- /**
- * Type of link events.
- */
- public enum Type {
- /**
- * Signifies that a new ip link has been detected.
- */
- LINK_ADDED,
-
- /**
- * Signifies that an ip link has been updated or changed state.
- */
- LINK_UPDATED,
-
- /**
- * Signifies that an ip link has been removed.
- */
- LINK_REMOVED
- }
-
- /**
- * Creates an event of a given type and for the specified ip link and the
- * current time.
- *
- * @param type link event type
- * @param link event link subject
- */
- public IpLinkEvent(Type type, IpLink link) {
- super(type, link);
- }
-
- /**
- * Creates an event of a given type and for the specified ip link and time.
- *
- * @param type link event type
- * @param link event link subject
- * @param time occurrence time
- */
- public IpLinkEvent(Type type, IpLink link, long time) {
- super(type, link, time);
- }
-
-}
diff --git a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/link/IpLinkListener.java b/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/link/IpLinkListener.java
deleted file mode 100644
index 6aa4c06..0000000
--- a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/link/IpLinkListener.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Copyright 2015-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.iptopology.api.link;
-
-import org.onosproject.event.EventListener;
-
-/**
- * Entity capable of receiving ip link related events.
- */
-public interface IpLinkListener extends EventListener<IpLinkEvent> {
-}
diff --git a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/link/IpLinkProvider.java b/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/link/IpLinkProvider.java
deleted file mode 100644
index 5500ba0..0000000
--- a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/link/IpLinkProvider.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Copyright 2015-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.iptopology.api.link;
-
-import org.onosproject.net.provider.Provider;
-
-/**
- * Abstraction of an entity providing information about ip links
- * to the core.
- */
-public interface IpLinkProvider extends Provider {
-}
diff --git a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/link/IpLinkProviderRegistry.java b/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/link/IpLinkProviderRegistry.java
deleted file mode 100644
index bc15a78..0000000
--- a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/link/IpLinkProviderRegistry.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Copyright 2015-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.iptopology.api.link;
-
-import org.onosproject.net.provider.ProviderRegistry;
-
-/**
- * Abstraction of an ip link provider registry.
- */
-public interface IpLinkProviderRegistry
- extends ProviderRegistry<IpLinkProvider, IpLinkProviderService> {
-}
diff --git a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/link/IpLinkProviderService.java b/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/link/IpLinkProviderService.java
deleted file mode 100644
index 352973c..0000000
--- a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/link/IpLinkProviderService.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright 2015-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.iptopology.api.link;
-
-
-import org.onosproject.iptopology.api.TerminationPoint;
-import org.onosproject.net.DeviceId;
-import org.onosproject.net.provider.ProviderService;
-
-/**
- * Means for injecting ip link information into the core.
- */
-public interface IpLinkProviderService extends ProviderService<IpLinkProvider> {
-
- /**
- * Signals that an ip link is added or updated with IP topology information.
- *
- * @param linkDescription ip link information
- */
- void addOrUpdateIpLink(IpLinkDescription linkDescription);
-
- /**
- * Signals that an ip link has disappeared.
- *
- * @param linkDescription ip link information
- */
- void removeIpLink(IpLinkDescription linkDescription);
-
- /**
- * Signals that ip links associated with the specified
- * termination point have vanished.
- *
- * @param terminationPoint termination point
- */
- void removeIpLink(TerminationPoint terminationPoint);
-
- /**
- * Signals that ip links associated with the specified
- * device have vanished.
- *
- * @param deviceId device identifier
- */
- void removeIpLink(DeviceId deviceId);
-}
diff --git a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/link/IpLinkService.java b/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/link/IpLinkService.java
deleted file mode 100644
index 142b7a0..0000000
--- a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/link/IpLinkService.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * Copyright 2015-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.iptopology.api.link;
-
-import java.util.Set;
-
-import org.onosproject.event.ListenerService;
-import org.onosproject.iptopology.api.IpLink;
-import org.onosproject.iptopology.api.TerminationPoint;
-import org.onosproject.net.DeviceId;
-
-/**
- * Service for interacting with the inventory of infrastructure links.
- */
-public interface IpLinkService
- extends ListenerService<IpLinkEvent, IpLinkListener> {
-
- /**
- * Returns the count of all known ip links.
- *
- * @return number of ip links
- */
- int getIpLinkCount();
-
- /**
- * Returns a collection of all ip links.
- *
- * @return all ip links
- */
- Iterable<IpLink> getIpLinks();
-
-
- /**
- * Returns set of all ip links leading to and from the
- * specified ip device.
- *
- * @param deviceId device identifier
- * @return set of ip device links
- */
- Set<IpLink> getIpDeviceLinks(DeviceId deviceId);
-
- /**
- * Returns set of all ip links leading from the specified ip device.
- *
- * @param deviceId device identifier
- * @return set of ip device egress links
- */
- Set<IpLink> getIpDeviceEgressLinks(DeviceId deviceId);
-
- /**
- * Returns set of all ip links leading to the specified ip device.
- *
- * @param deviceId device identifier
- * @return set of ip device ingress links
- */
- Set<IpLink> getIpDeviceIngressLinks(DeviceId deviceId);
-
- /**
- * Returns set of all ip links leading to and from the
- * specified termination point.
- *
- * @param terminationPoint termination point
- * @return set of ip links
- */
- Set<IpLink> getIpLinks(TerminationPoint terminationPoint);
-
- /**
- * Returns set of all ip links leading from the specified
- * termination point.
- *
- * @param terminationPoint termination point
- * @return set of ip device egress links
- */
- Set<IpLink> getEgressIpLinks(TerminationPoint terminationPoint);
-
- /**
- * Returns set of all ip links leading to the specified
- * termination point.
- *
- * @param terminationPoint termination point
- * @return set of ip device ingress links
- */
- Set<IpLink> getIngressIpLinks(TerminationPoint terminationPoint);
-
- /**
- * Returns the ip links between the specified source
- * and destination termination points.
- *
- * @param src source termination point
- * @param dst destination termination point
- * @return ip link from source to destination; null if none found
- */
- IpLink getIpLink(TerminationPoint src, TerminationPoint dst);
-
-}
diff --git a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/link/IpLinkStore.java b/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/link/IpLinkStore.java
deleted file mode 100644
index bd96fbe..0000000
--- a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/link/IpLinkStore.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * Copyright 2015-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.iptopology.api.link;
-
-import org.onosproject.iptopology.api.IpLink;
-import org.onosproject.iptopology.api.TerminationPoint;
-import org.onosproject.net.DeviceId;
-import org.onosproject.net.provider.ProviderId;
-import org.onosproject.store.Store;
-
-import java.util.Set;
-
-/**
- * Manages inventory of ip links; not intended for direct use.
- */
-public interface IpLinkStore extends Store<IpLinkEvent, IpLinkStoreDelegate> {
-
- /**
- * Returns the number of ip links in the store.
- *
- * @return number of ip links
- */
- int getIpLinkCount();
-
- /**
- * Returns an iterable collection of all ip links in the inventory.
- *
- * @return collection of all ip links
- */
- Iterable<IpLink> getIpLinks();
-
- /**
- * Returns all ip links egressing from the specified device.
- *
- * @param deviceId device identifier
- * @return set of ip device links
- */
- Set<IpLink> getIpDeviceEgressLinks(DeviceId deviceId);
-
- /**
- * Returns all ip links ingressing from the specified device.
- *
- * @param deviceId device identifier
- * @return set of ip device links
- */
- Set<IpLink> getIpDeviceIngressLinks(DeviceId deviceId);
-
- /**
- * Returns the ip link between the two termination points.
- *
- * @param src source termination point
- * @param dst destination termination point
- * @return ip link or null if one not found between the termination points
- */
- IpLink getIpLink(TerminationPoint src, TerminationPoint dst);
-
- /**
- * Returns all ip links egressing from the specified termination point.
- *
- * @param src source termination point
- * @return set of termination point ip links
- */
- Set<IpLink> getEgressIpLinks(TerminationPoint src);
-
- /**
- * Returns all ip links ingressing to the specified termination point.
- *
- * @param dst destination termination point
- * @return set of termination point ip links
- */
- Set<IpLink> getIngressIpLinks(TerminationPoint dst);
-
- /**
- * Creates a new ip link, or updates an existing one, based on the given
- * information.
- *
- * @param providerId provider identity
- * @param linkDescription ip link description
- * @return create or update ip link event, or null if no change resulted
- */
- IpLinkEvent createOrUpdateIpLink(ProviderId providerId,
- IpLinkDescription linkDescription);
-
- /**
- * Removes ip link, based on the specified information.
- *
- * @param src ip link source
- * @param dst ip link destination
- * @return remove or update ip link event, or null if no change resulted
- */
- IpLinkEvent removeOrDownIpLink(TerminationPoint src, TerminationPoint dst);
-
- /**
- * Removes ip link based on the specified information.
- *
- * @param src ip link source
- * @param dst ip link destination
- * @return remove ip link event, or null if no change resulted
- */
- IpLinkEvent removeIpLink(TerminationPoint src, TerminationPoint dst);
-
-}
diff --git a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/link/IpLinkStoreDelegate.java b/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/link/IpLinkStoreDelegate.java
deleted file mode 100644
index 0741607..0000000
--- a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/link/IpLinkStoreDelegate.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Copyright 2015-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.iptopology.api.link;
-
-import org.onosproject.store.StoreDelegate;
-
-/**
- * Ip link store delegate abstraction.
- */
-public interface IpLinkStoreDelegate extends StoreDelegate<IpLinkEvent> {
-}
diff --git a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/link/package-info.java b/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/link/package-info.java
deleted file mode 100644
index 60fb95a..0000000
--- a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/link/package-info.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright 2015-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.
- */
-
-/**
- * Ip link model & related services API definitions.
- */
-package org.onosproject.iptopology.api.link;
diff --git a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/package-info.java b/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/package-info.java
deleted file mode 100644
index 41bf585..0000000
--- a/apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/package-info.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright 2015-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.
- */
-
-/**
- * Ip Topology API.
- */
-package org.onosproject.iptopology.api;
diff --git a/apps/netconf/client/BUILD b/apps/netconf/client/BUILD
deleted file mode 100644
index 24b9fe3..0000000
--- a/apps/netconf/client/BUILD
+++ /dev/null
@@ -1,25 +0,0 @@
-APPS = [
- "org.onosproject.yang",
- "org.onosproject.config",
- "org.onosproject.netconf",
-]
-
-COMPILE_DEPS = CORE_DEPS + ONOS_YANG + [
- "@onos_yang_runtime//jar",
- "//apps/config:onos-apps-config",
- "//protocols/netconf/api:onos-protocols-netconf-api",
-]
-
-osgi_jar_with_tests(
- deps = COMPILE_DEPS,
-)
-
-onos_app(
- app_name = "org.onosproject.netconfsb",
- category = "Protocol",
- description = "Exposes APIs to establish NETCONF connections to devices and to send and receive " +
- "messages and asynchronous notifications over such connection.",
- required_apps = APPS,
- title = "NETCONF Protocol Subsystem",
- url = "http://onosproject.org",
-)
diff --git a/apps/netconf/client/src/main/java/org/onosproject/netconf/client/NetconfTranslator.java b/apps/netconf/client/src/main/java/org/onosproject/netconf/client/NetconfTranslator.java
deleted file mode 100644
index 11e5acf..0000000
--- a/apps/netconf/client/src/main/java/org/onosproject/netconf/client/NetconfTranslator.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Copyright 2017-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.netconf.client;
-
-import org.onosproject.net.DeviceId;
-import org.onosproject.yang.model.ResourceData;
-import com.google.common.annotations.Beta;
-
-import java.io.IOException;
-
-/**
- * Interface for making some standard calls to NETCONF devices with
- * serialization performed according the appropriate device's YANG model.
- */
-@Beta
-public interface NetconfTranslator {
- /**
- * Retrieves and returns the configuration of the specified device.
- *
- * @param deviceId the deviceID of the device to be contacted
- * @return a {@link ResourceData} containing the requested configuration
- * @throws IOException if serialization fails or the netconf subsystem is
- * unable to handle the request
- */
- /*TODO a future version of this API will support an optional filter type.*/
- ResourceData getDeviceConfig(DeviceId deviceId) throws IOException;
-
-
- /**
- * Adds to, overwrites, or deletes the selected device's configuration in the scope
- * and manner specified by the ResourceData.
- *
- * @param deviceId the deviceID fo the device to be contacted
- * @param resourceData the representation of the configuration to be pushed
- * to the device via NETCONF as well as the filter to
- * be used.
- * @param operationType specifier for the type of edit operation to be
- * performed (see enum for details)
- * @return a boolean, true if the operation succeeded, false otherwise
- * @throws IOException if serialization fails or the netconf subsystem is
- * unable to handle the request
- */
- boolean editDeviceConfig(DeviceId deviceId, ResourceData resourceData,
- OperationType operationType) throws IOException;
-
- /* FIXME eventually expose the copy, delete, lock and unlock netconf methods */
-
- /**
- * Returns the configuration and running statistics from the specified device.
- *
- * @param deviceId the deviceID of the device to be contacted.
- * @return a {@link ResourceData} containing the requested configuration
- * and statistics
- * @throws IOException if serialization fails or the netconf subsystem is
- * unable to handle the request
- */
- /*TODO a future version of this API will support an optional filter type.*/
-
- ResourceData getDeviceState(DeviceId deviceId) throws IOException;
-
- /**
- * Specifiers for the operations types when calling editConfig.
- */
- public static enum OperationType {
- /**
- * Deletes the specified nodes.
- */
- DELETE,
- /**
- * Replaces the specified nodes.
- */
- REPLACE
- }
-}
diff --git a/apps/netconf/client/src/main/java/org/onosproject/netconf/client/impl/NetconfActiveComponent.java b/apps/netconf/client/src/main/java/org/onosproject/netconf/client/impl/NetconfActiveComponent.java
deleted file mode 100644
index 7bf380c..0000000
--- a/apps/netconf/client/src/main/java/org/onosproject/netconf/client/impl/NetconfActiveComponent.java
+++ /dev/null
@@ -1,398 +0,0 @@
-/*
- * Copyright 2017-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.netconf.client.impl;
-
-import com.google.common.annotations.Beta;
-import org.osgi.service.component.annotations.Activate;
-import org.osgi.service.component.annotations.Component;
-import org.osgi.service.component.annotations.Deactivate;
-import org.osgi.service.component.annotations.Reference;
-import org.osgi.service.component.annotations.ReferenceCardinality;
-import org.onosproject.config.DynamicConfigEvent;
-import org.onosproject.config.DynamicConfigListener;
-import org.onosproject.config.DynamicConfigService;
-import org.onosproject.config.ResourceIdParser;
-import org.onosproject.config.Filter;
-import org.onosproject.mastership.MastershipService;
-import org.onosproject.net.DeviceId;
-import org.onosproject.netconf.NetconfController;
-import org.onosproject.netconf.NetconfException;
-import org.onosproject.netconf.client.NetconfTranslator;
-import org.onosproject.netconf.client.NetconfTranslator.OperationType;
-import org.onosproject.yang.model.DataNode;
-import org.onosproject.yang.model.InnerNode;
-import org.onosproject.yang.model.LeafNode;
-import org.onosproject.yang.model.ListKey;
-import org.onosproject.yang.model.NodeKey;
-import org.onosproject.yang.model.ResourceId;
-import org.onosproject.yang.model.DefaultResourceData;
-import org.onlab.util.AbstractAccumulator;
-import org.onlab.util.Accumulator;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.IOException;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Timer;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-
-@Beta
-@Component(immediate = true)
-public class NetconfActiveComponent implements DynamicConfigListener {
-
- private static final Logger log = LoggerFactory.getLogger(NetconfActiveComponent.class);
- @Reference(cardinality = ReferenceCardinality.MANDATORY)
- protected DynamicConfigService cfgService;
-
- @Reference(cardinality = ReferenceCardinality.MANDATORY)
- protected NetconfTranslator netconfTranslator;
-
- @Reference(cardinality = ReferenceCardinality.MANDATORY)
- protected MastershipService mastershipService;
-
- @Reference(cardinality = ReferenceCardinality.MANDATORY)
- protected NetconfController controller;
-
- private final Accumulator<DynamicConfigEvent> accumulator = new InternalEventAccummulator();
- private static final String DEVNMSPACE = "ne-l3vpn-api";
- private static final String DEVICES = "devices";
- private static final String DEVICE = "device";
- private static final String DEVICE_ID = "deviceid";
- private static final String DEF_IP = "0:0:0"; //hack, remove later
-
- //Symbolic constants for use with the accumulator
- private static final int MAX_EVENTS = 1000;
- private static final int MAX_BATCH_MS = 5000;
- private static final int MAX_IDLE_MS = 1000;
-
-
- private ResourceId defParent = new ResourceId.Builder()
- .addBranchPointSchema(DEVICES, DEVNMSPACE)
- .addBranchPointSchema(DEVICE, DEVNMSPACE)
- //.addBranchPointSchema(DEVICE_ID, DEVNMSPACE)
- .addKeyLeaf(DEVICE_ID, DEVNMSPACE, DEF_IP)
- .build();
-
- //TODO remove this hack after store ordering is fixed
- private static final String EXCPATH = "root|devices#ne-l3vpn-api|" +
- "device#ne-l3vpn-api$deviceid#ne-l3vpn-api#netconf:172.16.5.11:22|" +
- "l3vpn#ne-l3vpn-api|l3vpncomm#ne-l3vpn-api|l3vpnInstances#ne-l3vpn-api|" +
- "l3vpnInstance#ne-l3vpn-api$vrfName#ne-l3vpn-api#vrf2|l3vpnIfs#ne-l3vpn-api";
- //end of hack
-
- @Activate
- protected void activate() {
- cfgService.addListener(this);
- log.info("Started");
- }
-
- @Deactivate
- protected void deactivate() {
- cfgService.removeListener(this);
- log.info("Stopped");
- }
-
- @Override
- public boolean isRelevant(DynamicConfigEvent event) {
- String resId = ResourceIdParser.parseResId(event.subject());
- String refId = ResourceIdParser.parseResId(defParent);
- refId = refId.substring(0, refId.length() - (DEF_IP.length() + 1));
- if (!resId.contains(refId)) {
- return false;
- }
- if (resId.length() < refId.length()) {
- return false;
- }
- return (resId.substring(0, (refId.length())).compareTo(refId) == 0);
- }
-
- public boolean isMaster(DeviceId deviceId) {
- return mastershipService.isLocalMaster(deviceId);
- }
-
-
- @Override
- public void event(DynamicConfigEvent event) {
- accumulator.add(event);
- }
-
- /**
- * Performs the delete operation corresponding to the passed event.
- *
- * @param node a relevant dataNode
- * @param deviceId the deviceId of the device to be updated
- * @param resourceId the resourceId of the root of the subtree to be edited
- * @return true if the update succeeds false otherwise
- */
- private boolean configDelete(DataNode node, DeviceId deviceId, ResourceId resourceId) {
- return parseAndEdit(node, deviceId, resourceId, OperationType.DELETE);
- }
-
- /**
- * Performs the update operation corresponding to the passed event.
- *
- * @param node a relevant dataNode
- * @param deviceId the deviceId of the device to be updated
- * @param resourceId the resourceId of the root of the subtree to be edited
- * @return true if the update succeeds false otherwise
- */
- private boolean configUpdate(DataNode node, DeviceId deviceId, ResourceId resourceId) {
- return parseAndEdit(node, deviceId, resourceId, OperationType.REPLACE);
- }
-
- /**
- * Parses the incoming event and pushes configuration to the effected
- * device.
- *
- * @param node the dataNode effecting a particular device of which this node
- * is master
- * @param deviceId the deviceId of the device to be modified
- * @param resourceId the resourceId of the root of the subtree to be edited
- * @param operationType the type of editing to be performed
- * @return true if the operation succeeds, false otherwise
- */
- private boolean parseAndEdit(DataNode node, DeviceId deviceId,
- ResourceId resourceId,
- NetconfTranslator.OperationType operationType) {
- //FIXME Separate edit and delete, delete can proceed with a null node
- DefaultResourceData.Builder builder = DefaultResourceData.builder();
- if (node != null) {
- //add all low level nodes of devices
- Iterator<Map.Entry<NodeKey, DataNode>> it = ((InnerNode) node)
- .childNodes().entrySet().iterator();
- while (it.hasNext()) {
- DataNode n = it.next().getValue();
- if (!n.key().schemaId().name().equals("deviceid")) {
- builder.addDataNode(n);
- }
- }
- }
- //add resouce id //TODO: check if it is correct
- try {
- return netconfTranslator.editDeviceConfig(
- deviceId, builder.build(), operationType);
- } catch (IOException e) {
- log.debug("parseAndEdit()", e);
- return false;
- }
- }
-
- /**
- * Retrieves device id from Data node.
- *
- * @param node the node associated with the event
- * @return the deviceId of the effected device
- */
- @Beta
- public DeviceId getDeviceId(DataNode node) {
- String[] temp;
- String ip, port;
- if (node.type() == DataNode.Type.SINGLE_INSTANCE_LEAF_VALUE_NODE) {
- temp = ((LeafNode) node).asString().split("\\:");
- if (temp.length != 3) {
- throw new IllegalStateException(new NetconfException("Invalid device id form, cannot apply"));
- }
- ip = temp[1];
- port = temp[2];
- } else if (node.type() == DataNode.Type.MULTI_INSTANCE_NODE) {
- ListKey key = (ListKey) node.key();
- temp = key.keyLeafs().get(0).leafValAsString().split("\\:");
- if (temp.length != 3) {
- throw new IllegalStateException(new NetconfException("Invalid device id form, cannot apply"));
- }
- ip = temp[1];
- port = temp[2];
- } else {
- throw new IllegalStateException(new NetconfException("Invalid device id type, cannot apply"));
- }
- try {
- return DeviceId.deviceId(new URI("netconf", ip + ":" + port, (String) null));
- } catch (URISyntaxException var4) {
- throw new IllegalArgumentException("Unable to build deviceID for device " + ip + ":" + port, var4);
- }
- }
-
- /**
- * Inititates a Netconf connection to the device.
- *
- * @param deviceId of the added device
- */
- private void initiateConnection(DeviceId deviceId) {
- if (controller.getNetconfDevice(deviceId) == null) {
- try {
- //if (this.isReachable(deviceId)) {
- this.controller.connectDevice(deviceId);
- //}
- } catch (Exception ex) {
- throw new IllegalStateException(new NetconfException("Unable to connect to NETCONF device on " +
- deviceId, ex));
- }
- }
- }
-
- /**
- * Retrieves device key from Resource id.
- *
- * @param path associated with the event
- * @return the deviceId of the effected device
- */
- @Beta
- public ResourceId getDeviceKey(ResourceId path) {
- String resId = ResourceIdParser.parseResId(path);
- String[] el = resId.split(ResourceIdParser.EL_CHK);
- if (el.length < 3) {
- throw new IllegalStateException(new NetconfException("Invalid resource id, cannot apply"));
- }
- if (!el[2].contains((ResourceIdParser.KEY_SEP))) {
- throw new IllegalStateException(new NetconfException("Invalid device id key, cannot apply"));
- }
- String[] keys = el[2].split(ResourceIdParser.KEY_CHK);
- if (keys.length < 2) {
- throw new IllegalStateException(new NetconfException("Invalid device id key, cannot apply"));
- }
- String[] parts = keys[1].split(ResourceIdParser.NM_CHK);
- if (parts.length < 3) {
- throw new IllegalStateException(new NetconfException("Invalid device id key, cannot apply"));
- }
- if (parts[2].split("\\:").length != 3) {
- throw new IllegalStateException(new NetconfException("Invalid device id form, cannot apply"));
- }
- return (new ResourceId.Builder()
- .addBranchPointSchema(el[1].split(ResourceIdParser.NM_CHK)[0],
- el[1].split(ResourceIdParser.NM_CHK)[1])
- .addBranchPointSchema(keys[0].split(ResourceIdParser.NM_CHK)[0],
- keys[0].split(ResourceIdParser.NM_CHK)[1])
- .addKeyLeaf(parts[0], parts[1], parts[2])
- .build());
- }
-
- /**
- * Retrieves device id from Resource id.
- *
- * @param path associated with the event
- * @return the deviceId of the effected device
- */
- @Beta
- public DeviceId getDeviceId(ResourceId path) {
- String resId = ResourceIdParser.parseResId(path);
- String[] el = resId.split(ResourceIdParser.EL_CHK);
- if (el.length < 3) {
- throw new IllegalStateException(new NetconfException("Invalid resource id, cannot apply"));
- }
- if (!el[2].contains((ResourceIdParser.KEY_SEP))) {
- throw new IllegalStateException(new NetconfException("Invalid device id key, cannot apply"));
- }
- String[] keys = el[2].split(ResourceIdParser.KEY_CHK);
- if (keys.length < 2) {
- throw new IllegalStateException(new NetconfException("Invalid device id key, cannot apply"));
- }
- String[] parts = keys[1].split(ResourceIdParser.NM_CHK);
- if (parts.length < 3) {
- throw new IllegalStateException(new NetconfException("Invalid device id key, cannot apply"));
- }
- String[] temp = parts[2].split("\\:");
- String ip, port;
- if (temp.length != 3) {
- throw new IllegalStateException(new NetconfException("Invalid device id form, cannot apply"));
- }
- ip = temp[1];
- port = temp[2];
- try {
- return DeviceId.deviceId(new URI("netconf", ip + ":" + port, (String) null));
- } catch (URISyntaxException ex) {
- throw new IllegalArgumentException("Unable to build deviceID for device " + ip + ":" + port, ex);
- }
- }
-
- /* Accumulates events to allow processing after a desired number of events were accumulated.
- */
- private class InternalEventAccummulator extends AbstractAccumulator<DynamicConfigEvent> {
- protected InternalEventAccummulator() {
- super(new Timer("dyncfgevt-timer"), MAX_EVENTS, MAX_BATCH_MS, MAX_IDLE_MS);
- }
- @Override
- public void processItems(List<DynamicConfigEvent> events) {
- Map<ResourceId, List<DynamicConfigEvent>> evtmap = new LinkedHashMap<>();
- Boolean handleEx = false; //hack
- ResourceId exId = null; //hack
- for (DynamicConfigEvent e : events) {
- checkNotNull(e, "process:Event cannot be null");
- ResourceId cur = e.subject();
- //TODO remove this hack after store ordering is fixed
- String expat = ResourceIdParser.parseResId(cur);
- if ((expat.compareTo(EXCPATH) == 0) && (e.type() == DynamicConfigEvent.Type.NODE_ADDED)) {
- handleEx = true;
- exId = cur;
- } else { //actual code
- ResourceId key = getDeviceKey(e.subject());
- List<DynamicConfigEvent> el = evtmap.get(key);
- if (el == null) {
- el = new ArrayList<>();
- }
- el.add(e);
- evtmap.put(key, el);
- }
- }
- evtmap.forEach((k, v) -> {
- DeviceId curDevice = getDeviceId(k);
- if (!isMaster(curDevice)) {
- log.info("NetConfListener: not master, ignoring config for device {}", k);
- return;
- }
- initiateConnection(curDevice);
- for (DynamicConfigEvent curEvt : v) {
- switch (curEvt.type()) {
- case NODE_ADDED:
- case NODE_UPDATED:
- case NODE_REPLACED:
- Filter filt = Filter.builder().build();
- DataNode node = cfgService.readNode(k, filt);
- configUpdate(node, curDevice, k);
- break;
- case NODE_DELETED:
- configDelete(null, curDevice, k); //TODO curEvt.subject())??
- break;
- case UNKNOWN_OPRN:
- default:
- log.warn("NetConfListener: unknown event: {}", curEvt.type());
- break;
- }
- }
- });
- //TODO remove this hack after store ordering is fixed
- if (handleEx) {
- DeviceId exDevice = getDeviceId(exId);
- if (!isMaster(exDevice)) {
- log.info("NetConfListener: not master, ignoring config for expath {}", exId);
- return;
- }
- initiateConnection(exDevice);
- Filter filt = Filter.builder().build();
- DataNode exnode = cfgService.readNode(exId, filt);
- configUpdate(exnode, exDevice, exId);
- } //end of hack
- }
- }
-}
\ No newline at end of file
diff --git a/apps/netconf/client/src/main/java/org/onosproject/netconf/client/impl/NetconfTranslatorImpl.java b/apps/netconf/client/src/main/java/org/onosproject/netconf/client/impl/NetconfTranslatorImpl.java
deleted file mode 100644
index fc01fe4..0000000
--- a/apps/netconf/client/src/main/java/org/onosproject/netconf/client/impl/NetconfTranslatorImpl.java
+++ /dev/null
@@ -1,391 +0,0 @@
-/*
- * Copyright 2017-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.netconf.client.impl;
-
-import com.google.common.annotations.Beta;
-import org.onosproject.cluster.NodeId;
-import org.onosproject.net.DeviceId;
-import org.onosproject.netconf.NetconfController;
-import org.onosproject.netconf.NetconfDevice;
-import org.onosproject.netconf.NetconfException;
-import org.onosproject.netconf.NetconfSession;
-import org.onosproject.netconf.client.NetconfTranslator;
-import org.onosproject.yang.model.DataNode;
-import org.onosproject.yang.model.DefaultResourceData;
-import org.onosproject.yang.model.InnerNode;
-import org.onosproject.yang.model.KeyLeaf;
-import org.onosproject.yang.model.LeafListKey;
-import org.onosproject.yang.model.LeafNode;
-import org.onosproject.yang.model.ListKey;
-import org.onosproject.yang.model.NodeKey;
-import org.onosproject.yang.model.ResourceData;
-import org.onosproject.yang.model.ResourceId;
-import org.onosproject.yang.model.SchemaContext;
-import org.onosproject.yang.model.SchemaContextProvider;
-import org.onosproject.yang.model.SchemaId;
-import org.onosproject.yang.runtime.CompositeStream;
-import org.onosproject.yang.runtime.DefaultAnnotatedNodeInfo;
-import org.onosproject.yang.runtime.DefaultAnnotation;
-import org.onosproject.yang.runtime.DefaultCompositeData;
-import org.onosproject.yang.runtime.DefaultCompositeStream;
-import org.onosproject.yang.runtime.DefaultRuntimeContext;
-import org.onosproject.yang.runtime.DefaultYangSerializerContext;
-import org.onosproject.yang.runtime.SerializerHelper;
-import org.onosproject.yang.runtime.YangRuntimeService;
-import org.onosproject.yang.runtime.YangSerializerContext;
-import org.osgi.service.component.ComponentContext;
-import org.osgi.service.component.annotations.Activate;
-import org.osgi.service.component.annotations.Component;
-import org.osgi.service.component.annotations.Deactivate;
-import org.osgi.service.component.annotations.Reference;
-import org.osgi.service.component.annotations.ReferenceCardinality;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.BufferedReader;
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.nio.charset.StandardCharsets;
-import java.util.Iterator;
-import java.util.List;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-import static org.onosproject.netconf.DatastoreId.RUNNING;
-import static org.onosproject.yang.model.DataNode.Type.SINGLE_INSTANCE_LEAF_VALUE_NODE;
-import static org.onosproject.yang.runtime.SerializerHelper.addDataNode;
-
-/*FIXME these imports are not visible using OSGI*/
-
-/*FIXME these imports are not visible using OSGI*/
-
-/*TODO once the API's are finalized this comment will be made more specified.*/
-
-/**
- * Translator which accepts data types defined for the DynamicConfigService and
- * makes the appropriate calls to NETCONF devices before encoding and returning
- * responses in formats suitable for the DynamicConfigService.
- * <p>
- * NOTE: This entity does not ensure you are the master of a device you attempt
- * to contact. If you are not the master an error will be thrown because there
- * will be no session available.
- */
-@Beta
-@Component(immediate = true, service = NetconfTranslator.class)
-public class NetconfTranslatorImpl implements NetconfTranslator {
-
- private static final Logger log = LoggerFactory
- .getLogger(NetconfTranslator.class);
-
- private NodeId localNodeId;
-
- private static final String GET_CONFIG_MESSAGE_REGEX =
- "<data>\n?\\s*(.*?)\n?\\s*</data>";
- private static final int GET_CONFIG_CORE_MESSAGE_GROUP = 1;
- private static final Pattern GET_CONFIG_CORE_MESSAGE_PATTERN =
- Pattern.compile(GET_CONFIG_MESSAGE_REGEX, Pattern.DOTALL);
- private static final String GET_CORE_MESSAGE_REGEX = "<data>\n?\\s*(.*?)\n?\\s*</data>";
- private static final int GET_CORE_MESSAGE_GROUP = 1;
- private static final Pattern GET_CORE_MESSAGE_PATTERN =
- Pattern.compile(GET_CORE_MESSAGE_REGEX, Pattern.DOTALL);
-
- private static final String NETCONF_1_0_BASE_NAMESPACE =
- "urn:ietf:params:xml:ns:netconf:base:1.0";
-
- private static final String GET_URI = "urn:ietf:params:xml:ns:yang:" +
- "yrt-ietf-network:networks/network/node";
- private static final String XML_ENCODING_SPECIFIER = "xml";
- private static final String OP_SPECIFIER = "xc:operation";
- private static final String REPLACE_OP_SPECIFIER = "replace";
- private static final String DELETE_OP_SPECIFIER = "delete";
- private static final String XMLNS_XC_SPECIFIER = "xmlns:xc";
- private static final String XMLNS_SPECIFIER = "xmlns";
-
- @Reference(cardinality = ReferenceCardinality.MANDATORY)
- protected NetconfController netconfController;
-
- @Reference(cardinality = ReferenceCardinality.MANDATORY)
- protected YangRuntimeService yangRuntimeService;
-
- @Reference(cardinality = ReferenceCardinality.MANDATORY)
- protected SchemaContextProvider schemaContextProvider;
-
- @Activate
- public void activate(ComponentContext context) {
- log.info("Started");
- }
-
- @Deactivate
- public void deactivate() {
- log.info("Stopped");
- }
-
- @Override
- public ResourceData getDeviceConfig(DeviceId deviceId) throws IOException {
- NetconfSession session = getNetconfSession(deviceId);
- /*FIXME "running" will be replaced with an enum once netconf supports multiple datastores.*/
- String reply = session.getConfig(RUNNING);
- Matcher protocolStripper = GET_CONFIG_CORE_MESSAGE_PATTERN.matcher(reply);
- protocolStripper.find();
- reply = protocolStripper.group(GET_CONFIG_CORE_MESSAGE_GROUP);
- return yangRuntimeService.decode(
- new DefaultCompositeStream(
- null,
- /*FIXME is UTF_8 the appropriate encoding? */
- new ByteArrayInputStream(reply.getBytes(StandardCharsets.UTF_8))),
- new DefaultRuntimeContext.Builder()
- .setDataFormat(XML_ENCODING_SPECIFIER)
- .addAnnotation(
- new DefaultAnnotation(XMLNS_SPECIFIER,
- NETCONF_1_0_BASE_NAMESPACE))
- .build()).resourceData();
- }
-
- @Override
- public boolean editDeviceConfig(DeviceId deviceId, ResourceData resourceData,
- NetconfTranslator.OperationType operationType) throws IOException {
- NetconfSession session = getNetconfSession(deviceId);
- SchemaContext context = schemaContextProvider
- .getSchemaContext(ResourceId.builder().addBranchPointSchema("/", null).build());
- ResourceData modifiedPathResourceData = getResourceData(resourceData.resourceId(),
- resourceData.dataNodes(),
- new DefaultYangSerializerContext(context, null));
- DefaultCompositeData.Builder compositeDataBuilder = DefaultCompositeData
- .builder()
- .resourceData(modifiedPathResourceData);
- for (DataNode node : resourceData.dataNodes()) {
- ResourceId resourceId = resourceData.resourceId();
- if (operationType != OperationType.DELETE) {
- resourceId = getAnnotatedNodeResourceId(
- resourceData.resourceId(), node);
- }
- if (resourceId != null) {
- DefaultAnnotatedNodeInfo.Builder annotatedNodeInfo =
- DefaultAnnotatedNodeInfo.builder();
- annotatedNodeInfo.resourceId(resourceId);
- annotatedNodeInfo.addAnnotation(
- new DefaultAnnotation(
- OP_SPECIFIER, operationType == OperationType.DELETE ?
- DELETE_OP_SPECIFIER : REPLACE_OP_SPECIFIER));
- compositeDataBuilder.addAnnotatedNodeInfo(annotatedNodeInfo.build());
- }
- }
- CompositeStream config = yangRuntimeService.encode(
- compositeDataBuilder.build(),
- new DefaultRuntimeContext.Builder()
- .setDataFormat(XML_ENCODING_SPECIFIER)
- .addAnnotation(new DefaultAnnotation(
- XMLNS_XC_SPECIFIER, NETCONF_1_0_BASE_NAMESPACE))
- .build());
- /* FIXME need to fix to string conversion. */
-
- try {
- String reply = session.requestSync(Utils.editConfig(streamToString(
- config.resourceData())));
- } catch (NetconfException e) {
- log.error("failed to send a request sync", e);
- return false;
- }
- /* NOTE: a failure to edit is reflected as a NetconfException.*/
- return true;
- }
-
- @Override
- public ResourceData getDeviceState(DeviceId deviceId) throws IOException {
- NetconfSession session = getNetconfSession(deviceId);
- /*TODO the first parameter will come into use if get is required to support filters.*/
- String reply = session.get(null, null);
- Matcher protocolStripper = GET_CORE_MESSAGE_PATTERN.matcher(reply);
- protocolStripper.find();
- reply = protocolStripper.group(GET_CORE_MESSAGE_GROUP);
- return yangRuntimeService.decode(
- new DefaultCompositeStream(
- null,
- /*FIXME is UTF_8 the appropriate encoding? */
- new ByteArrayInputStream(reply.getBytes(StandardCharsets.UTF_8))),
- new DefaultRuntimeContext.Builder()
- .setDataFormat(XML_ENCODING_SPECIFIER)
- .addAnnotation(
- new DefaultAnnotation(
- XMLNS_SPECIFIER,
- NETCONF_1_0_BASE_NAMESPACE))
- .build()).resourceData();
- /* NOTE: a failure to get is reflected as a NetconfException.*/
- }
-
- /**
- * Returns a session for the specified deviceId if this node is its master,
- * returns null otherwise.
- *
- * @param deviceId the id of node for which we wish to retrieve a session
- * @return a NetconfSession with the specified node or null
- */
- private NetconfSession getNetconfSession(DeviceId deviceId) {
- NetconfDevice device = netconfController.getNetconfDevice(deviceId);
- checkNotNull(device, "The specified deviceId could not be found by the NETCONF controller.");
- NetconfSession session = device.getSession();
- checkNotNull(session, "A session could not be retrieved for the specified deviceId.");
- return session;
- }
-
- /**
- * Accepts a stream and converts it to a string.
- *
- * @param stream the stream to be converted
- * @return a string with the same sequence of characters as the stream
- * @throws IOException if reading from the stream fails
- */
- private String streamToString(InputStream stream) throws IOException {
- BufferedReader reader = new BufferedReader(new InputStreamReader(stream));
- StringBuilder builder = new StringBuilder();
-
- String nextLine = reader.readLine();
- while (nextLine != null) {
- builder.append(nextLine);
- nextLine = reader.readLine();
- }
- return builder.toString();
- }
-
- /**
- * Returns resource data having resource id as "/" and data node tree
- * starting from "/" by creating data nodes for given resource id(parent
- * node for given list of nodes) and list of child nodes.
- * <p>
- * This api will be used in encode flow only.
- *
- * @param rid resource identifier till parent node
- * @param nodes list of data nodes
- * @param cont yang serializer context
- * @return resource data.
- */
- public static ResourceData getResourceData(
- ResourceId rid, List<DataNode> nodes, YangSerializerContext cont) {
- if (rid == null) {
- ResourceData.Builder resData = DefaultResourceData.builder();
- for (DataNode node : nodes) {
- resData.addDataNode(node);
- }
- return resData.build();
- }
- List<NodeKey> keys = rid.nodeKeys();
- Iterator<NodeKey> it = keys.iterator();
- DataNode.Builder dbr = SerializerHelper.initializeDataNode(cont);
-
- // checking the resource id weather it is getting started from / or not
-
- while (it.hasNext()) {
- NodeKey nodekey = it.next();
- SchemaId sid = nodekey.schemaId();
- dbr = addDataNode(dbr, sid.name(), sid.namespace(),
- null, null);
- if (nodekey instanceof ListKey) {
- for (KeyLeaf keyLeaf : ((ListKey) nodekey).keyLeafs()) {
- String val;
- if (keyLeaf.leafValue() == null) {
- val = null;
- } else {
- val = keyLeaf.leafValAsString();
- }
- dbr = addDataNode(dbr, keyLeaf.leafSchema().name(),
- sid.namespace(), val,
- SINGLE_INSTANCE_LEAF_VALUE_NODE);
- }
- }
- }
-
- if (dbr instanceof LeafNode.Builder &&
- (nodes != null && !nodes.isEmpty())) {
- //exception "leaf/leaf-list can not have child node"
- }
-
- if (nodes != null && !nodes.isEmpty()) {
- // adding the parent node for given list of nodes
- for (DataNode node : nodes) {
- dbr = ((InnerNode.Builder) dbr).addNode(node);
- }
- }
-/*FIXME this can be uncommented for use with versions of onos-yang-tools newer than 1.12.0-b6*/
-// while (dbr.parent() != null) {
-// dbr = SerializerHelper.exitDataNode(dbr);
-// }
-
- ResourceData.Builder resData = DefaultResourceData.builder();
-
- resData.addDataNode(dbr.build());
- resData.resourceId(null);
- return resData.build();
- }
-
- /**
- * Returns resource id for annotated data node by adding resource id of top
- * level data node to given resource id.
- * <p>
- * Annotation will be added to node based on the updated resource id.
- * This api will be used in encode flow only.
- *
- * @param rid resource identifier till parent node
- * @param node data node
- * @return updated resource id.
- */
- public static ResourceId getAnnotatedNodeResourceId(ResourceId rid,
- DataNode node) {
-
- String val;
- ResourceId.Builder rIdBldr = ResourceId.builder();
- if (rid != null) {
- try {
- rIdBldr = rid.copyBuilder();
- } catch (CloneNotSupportedException e) {
- log.debug("clone not supported", e);
- }
- } else {
- rIdBldr.addBranchPointSchema("/", null);
- }
- DataNode.Type type = node.type();
- NodeKey k = node.key();
- SchemaId sid = k.schemaId();
-
- switch (type) {
-
- case MULTI_INSTANCE_LEAF_VALUE_NODE:
- val = ((LeafListKey) k).value().toString();
- rIdBldr.addLeafListBranchPoint(sid.name(), sid.namespace(), val);
- break;
-
- case MULTI_INSTANCE_NODE:
- rIdBldr.addBranchPointSchema(sid.name(), sid.namespace());
-// Preparing the list of key values for multiInstanceNode
- for (KeyLeaf keyLeaf : ((ListKey) node.key()).keyLeafs()) {
- val = keyLeaf.leafValAsString();
- rIdBldr.addKeyLeaf(keyLeaf.leafSchema().name(), sid.namespace(), val);
- }
- break;
- case SINGLE_INSTANCE_LEAF_VALUE_NODE:
- case SINGLE_INSTANCE_NODE:
- rIdBldr.addBranchPointSchema(sid.name(), sid.namespace());
- break;
-
- default:
- throw new IllegalArgumentException();
- }
- return rIdBldr.build();
- }
-}
diff --git a/apps/netconf/client/src/main/java/org/onosproject/netconf/client/impl/Utils.java b/apps/netconf/client/src/main/java/org/onosproject/netconf/client/impl/Utils.java
deleted file mode 100644
index 5e06420..0000000
--- a/apps/netconf/client/src/main/java/org/onosproject/netconf/client/impl/Utils.java
+++ /dev/null
@@ -1,130 +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.netconf.client.impl;
-
-import javax.xml.transform.OutputKeys;
-import javax.xml.transform.Source;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerConfigurationException;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.stream.StreamResult;
-import javax.xml.transform.stream.StreamSource;
-import java.io.StringReader;
-import java.io.StringWriter;
-
-/**
- * Represents utilities for huawei driver.
- */
-public final class Utils {
-
- /**
- * Prevents creation of utils instance.
- */
- private Utils() {
- }
-
- // Default namespace given in yang files
- private static final String XMLNS_STRING = "xmlns=\"ne-l3vpn-api\"";
- private static final String XMLNS_HUA_STRING = "xmlns=\"http://www.huawei" +
- ".com/netconf/vrp\" format-version=\"1.0\" content-version=\"1.0\"";
-
- /**
- * YMS encode the java object into a xml string with xml namespace equals to
- * the namespace defined in YANG file. Huawei driver overwriting this
- * default xml namespace in generated xml string with xml string for Huawei.
- *
- * @param request xml string as an output of YMS encode operation
- * @return formatted string
- */
- private static String formatMessage(String request) {
- if (request.contains(XMLNS_STRING)) {
- request = request.replaceFirst(XMLNS_STRING, XMLNS_HUA_STRING);
- }
- return request;
- }
-
- /**
- * Returns the appended provided xml string with device specific rpc
- * request tags.
- *
- * @param encodedString xml string need to be updated
- * @return appended new tags xml string
- */
- static String editConfig(String encodedString) {
-
- // Add opening protocol edit config tags.
- StringBuilder rpc =
- new StringBuilder(
- "<rpc xmlns=\"urn:ietf:params:xml:ns:netconf:base:1.0" +
- "\" " +
- "message-id=\"1\">");
- rpc.append("<edit-config>");
- rpc.append("<target>");
- rpc.append("<running/>");
- rpc.append("</target>");
-
- // Get the formatted XML namespace string.
- encodedString = formatMessage(encodedString);
-
- // Add the closing protocol edit config tags.
- rpc.append(encodedString);
- rpc.append("</edit-config>");
- rpc.append("</rpc>");
-
- return rpc.toString();
- }
-
- /**
- * Converts xml string to pretty format.
- *
- * @param input xml string to be converted to pretty format
- * @return pretty format xml string
- */
- static String prettyFormat(String input) {
- // Prepare input and output stream
- Source xmlInput = new StreamSource(new StringReader(input));
- StringWriter stringWriter = new StringWriter();
- StreamResult xmlOutput = new StreamResult(stringWriter);
-
- // Create transformer
- TransformerFactory transformerFactory = TransformerFactory.newInstance();
- Transformer transformer = null;
-
- try {
- transformer = transformerFactory.newTransformer();
- } catch (TransformerConfigurationException e) {
- return "";
- }
-
- // Need to omit the xml header and set indent to 4
- if (transformer != null) {
- transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
- transformer.setOutputProperty(OutputKeys.INDENT, "yes");
- transformer.setOutputProperty("{http://xml.apache" +
- ".org/xslt}indent-amount", "4");
-
- // Covert input string to xml pretty format and return
- try {
- transformer.transform(xmlInput, xmlOutput);
- } catch (TransformerException e) {
- return "";
- }
- }
- return xmlOutput.getWriter().toString();
- }
-}
diff --git a/apps/netconf/client/src/main/java/org/onosproject/netconf/client/impl/package-info.java b/apps/netconf/client/src/main/java/org/onosproject/netconf/client/impl/package-info.java
deleted file mode 100644
index aff1c2dc..0000000
--- a/apps/netconf/client/src/main/java/org/onosproject/netconf/client/impl/package-info.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Copyright 2017-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.
- */
-
-/**
- * Translation utility for communication between outside entities and the
- * NETCONF southbound.
- */
-package org.onosproject.netconf.client.impl;
diff --git a/apps/netconf/client/src/main/java/org/onosproject/netconf/client/package-info.java b/apps/netconf/client/src/main/java/org/onosproject/netconf/client/package-info.java
deleted file mode 100644
index 95e4984..0000000
--- a/apps/netconf/client/src/main/java/org/onosproject/netconf/client/package-info.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Copyright 2017-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.
- */
-
-/**
- * Interface for translation utility for communication between yang entities
- * and the NETCONF southbound.
- */
-package org.onosproject.netconf.client;
diff --git a/apps/netconf/client/src/test/java/org/onosproject/netconf/client/NetconfTranslatorImplTest.java b/apps/netconf/client/src/test/java/org/onosproject/netconf/client/NetconfTranslatorImplTest.java
deleted file mode 100644
index 0969112..0000000
--- a/apps/netconf/client/src/test/java/org/onosproject/netconf/client/NetconfTranslatorImplTest.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * Copyright 2017-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.netconf.client;
-
-import com.google.common.annotations.Beta;
-import org.junit.Test;
-import org.onosproject.netconf.client.impl.NetconfTranslatorImpl;
-
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import static org.junit.Assert.assertEquals;
-
-/**
- * Test class for {@link NetconfTranslatorImpl}.
- */
-@Beta
-public class NetconfTranslatorImplTest {
- private static final String CORE_GET_CONFIG_MESSAGE_REGEX =
- "<data>\n?\\s*(.*?)\n?\\s*</data>";
- private static final int GET_CONFIG_CORE_MESSAGE_GROUP = 1;
- private static final Pattern GET_CONFIG_CORE_MESSAGE_PATTERN =
- Pattern.compile(CORE_GET_CONFIG_MESSAGE_REGEX, Pattern.DOTALL);
- private static final String GET_CORE_MESSAGE_REGEX = "<data>\n?\\s*(.*?)\n?\\s*</data>";
- private static final int GET_CORE_MESSAGE_GROUP = 1;
- private static final Pattern GET_CORE_MESSAGE_PATTERN =
- Pattern.compile(GET_CORE_MESSAGE_REGEX, Pattern.DOTALL);
-
- private static final String SAMPLE_GET_REPLY = "<rpc-reply message-id=\"101\"\n" +
- " xmlns=\"urn:ietf:params:xml:ns:netconf:base:1.0\">\n" +
- " <data>\n" +
- " <t:top xmlns:t=\"http://example.com/schema/1.2/stats\">\n" +
- " <t:interfaces>\n" +
- " <t:interface t:ifName=\"eth0\">\n" +
- " <t:ifInOctets>45621</t:ifInOctets>\n" +
- " <t:ifOutOctets>774344</t:ifOutOctets>\n" +
- " </t:interface>\n" +
- " </t:interfaces>\n" +
- " </t:top>\n" +
- " </data>\n" +
- " </rpc-reply>";
- private static final String CORRECT_FILTERED_GET_REPLY =
- "<t:top xmlns:t=\"http://example.com/schema/1.2/stats\">\n" +
- " <t:interfaces>\n" +
- " <t:interface t:ifName=\"eth0\">\n" +
- " <t:ifInOctets>45621</t:ifInOctets>\n" +
- " <t:ifOutOctets>774344</t:ifOutOctets>\n" +
- " </t:interface>\n" +
- " </t:interfaces>\n" +
- " </t:top>";
- private static final String SAMPLE_GET_CONFIG_REPLY = "<rpc-reply message-id=\"101\"\n" +
- " xmlns=\"urn:ietf:params:xml:ns:netconf:base:1.0\">\n" +
- " <data>\n" +
- " <top xmlns=\"http://example.com/schema/1.2/config\">\n" +
- " <users>\n" +
- " <user>\n" +
- " <name>root</name>\n" +
- " <type>superuser</type>\n" +
- " <full-name>Charlie Root</full-name> <company-info>\n" +
- " <dept>1</dept>\n" +
- " <id>1</id>\n" +
- " </company-info>\n" +
- " </user>\n" +
- " <!-- additional <user> elements appear here... -->\n" +
- " </users>\n" +
- " </top>\n" +
- " </data>\n" +
- " </rpc-reply>";
- private static final String CORRECT_FILTERED_GET_CONFIG_REPLY =
- "<top xmlns=\"http://example.com/schema/1.2/config\">\n" +
- " <users>\n" +
- " <user>\n" +
- " <name>root</name>\n" +
- " <type>superuser</type>\n" +
- " <full-name>Charlie Root</full-name> <company-info>\n" +
- " <dept>1</dept>\n" +
- " <id>1</id>\n" +
- " </company-info>\n" +
- " </user>\n" +
- " <!-- additional <user> elements appear here... -->\n" +
- " </users>\n" +
- " </top>";
-
-
- @Test
- public void testRegex() {
- //Basic check for the getConfig regex.
- Matcher matcher = GET_CONFIG_CORE_MESSAGE_PATTERN.matcher(SAMPLE_GET_CONFIG_REPLY);
- matcher.find();
-// System.out.println(matcher.group(1));
-// System.out.println(DESIRED_SUBSTRING_GET_CONFIG);
- assertEquals("Messages did not match",
- CORRECT_FILTERED_GET_CONFIG_REPLY,
- matcher.group(GET_CONFIG_CORE_MESSAGE_GROUP));
- //Basic check for the get regex.
- matcher = GET_CORE_MESSAGE_PATTERN.matcher(SAMPLE_GET_REPLY);
- matcher.find();
-// System.out.println(matcher.group(1));
-// System.out.println(DESIRED_SUBSTRING_GET_CONFIG);
- assertEquals("Messages did not match", CORRECT_FILTERED_GET_REPLY, matcher.group(GET_CORE_MESSAGE_GROUP));
- }
-}
diff --git a/tools/build/bazel/modules.bzl b/tools/build/bazel/modules.bzl
index 4f323db..b155042 100644
--- a/tools/build/bazel/modules.bzl
+++ b/tools/build/bazel/modules.bzl
@@ -179,7 +179,6 @@
"//apps/dhcprelay/app:onos-apps-dhcprelay-app": [],
"//apps/dhcprelay/web:onos-apps-dhcprelay-web": [],
"//apps/fwd:onos-apps-fwd": [],
- "//apps/iptopology-api:onos-apps-iptopology-api": [],
"//apps/kafka-integration/api:onos-apps-kafka-integration-api": [],
"//apps/kafka-integration/app:onos-apps-kafka-integration-app": [],
"//apps/routing/common:onos-apps-routing-common": [],
@@ -203,7 +202,6 @@
"//apps/flowspec-api:onos-apps-flowspec-api-oar": [],
"//apps/fwd:onos-apps-fwd-oar": [],
"//apps/gangliametrics:onos-apps-gangliametrics-oar": [],
- "//apps/gluon:onos-apps-gluon-oar": [],
"//apps/graphitemetrics:onos-apps-graphitemetrics-oar": [],
"//apps/imr:onos-apps-imr-oar": [],
"//apps/inbandtelemetry:onos-apps-inbandtelemetry-oar": ["tost"],
@@ -220,7 +218,6 @@
"//apps/mfwd:onos-apps-mfwd-oar": [],
"//apps/mlb:onos-apps-mlb-oar": [],
"//apps/mobility:onos-apps-mobility-oar": [],
- "//apps/netconf/client:onos-apps-netconf-client-oar": [],
"//apps/network-troubleshoot:onos-apps-network-troubleshoot-oar": [],
"//apps/newoptical:onos-apps-newoptical-oar": [],
"//apps/nodemetrics:onos-apps-nodemetrics-oar": [],