Remove deprecated port behaviour classes
- PortConfig
- PortDiscovery
Change-Id: I88c9438969de00146c99bb75e928260ea8ce954a
diff --git a/cli/src/main/java/org/onosproject/cli/net/DevicePortGetterCommand.java b/cli/src/main/java/org/onosproject/cli/net/DevicePortGetterCommand.java
deleted file mode 100644
index e689a4d..0000000
--- a/cli/src/main/java/org/onosproject/cli/net/DevicePortGetterCommand.java
+++ /dev/null
@@ -1,55 +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.cli.net;
-
-import org.apache.karaf.shell.commands.Argument;
-import org.apache.karaf.shell.commands.Command;
-import org.onosproject.cli.AbstractShellCommand;
-import org.onosproject.net.DeviceId;
-import org.onosproject.net.behaviour.PortDiscovery;
-import org.onosproject.net.driver.DriverHandler;
-import org.onosproject.net.driver.DriverService;
-
-/**
- * Command that gets the configuration of the specified type from the specified
- * device. If configuration cannot be retrieved it prints an error string.
- *
- * This is a temporary development tool for use until yang integration is complete.
- * This uses a not properly specified behavior. DO NOT USE AS AN EXAMPLE.
- *
- * @deprecated in 1.10.0
- */
-@Deprecated
-@Command(scope = "onos", name = "device-ports",
- description = "[Deprecated]Gets the ports of the specified device.")
-public class DevicePortGetterCommand extends AbstractShellCommand {
-
- @Argument(index = 0, name = "uri", description = "Device ID",
- required = true, multiValued = false)
- String uri = null;
- private DeviceId deviceId;
-
- @Override
- protected void execute() {
- print("[WARN] This command was marked deprecated in 1.10.0");
- DriverService service = get(DriverService.class);
- deviceId = DeviceId.deviceId(uri);
- DriverHandler h = service.createHandler(deviceId);
- PortDiscovery portConfig = h.behaviour(PortDiscovery.class);
- print(portConfig.getPorts().toString());
- }
-
-}
diff --git a/cli/src/main/resources/OSGI-INF/blueprint/shell-config.xml b/cli/src/main/resources/OSGI-INF/blueprint/shell-config.xml
index c75fcc9..3829be2 100644
--- a/cli/src/main/resources/OSGI-INF/blueprint/shell-config.xml
+++ b/cli/src/main/resources/OSGI-INF/blueprint/shell-config.xml
@@ -180,13 +180,6 @@
</completers>
</command>
<command>
- <action class="org.onosproject.cli.net.DevicePortGetterCommand"/>
- <completers>
- <ref component-id="deviceIdCompleter"/>
- <null/>
- </completers>
- </command>
- <command>
<action class="org.onosproject.cli.net.DeviceRemoveCommand"/>
<completers>
<ref component-id="deviceIdCompleter"/>
diff --git a/core/api/src/main/java/org/onosproject/net/behaviour/PortConfig.java b/core/api/src/main/java/org/onosproject/net/behaviour/PortConfig.java
deleted file mode 100644
index 031c8b6b..0000000
--- a/core/api/src/main/java/org/onosproject/net/behaviour/PortConfig.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.net.behaviour;
-
-import com.google.common.primitives.UnsignedInteger;
-import org.onosproject.net.device.PortDescription;
-import org.onosproject.net.driver.HandlerBehaviour;
-
-/**
- * Means to configure a logical port at the device.
- * @deprecated in Junco (1.9.1), use PortConfigBehaviour instead
- */
-@Deprecated
-public interface PortConfig extends HandlerBehaviour {
-
- /**
- * Apply QoS configuration on a device.
- * @param port a port description
- * @param queueId an unsigned integer
- */
- void applyQoS(PortDescription port, UnsignedInteger queueId);
-
- /**
- * Remove a QoS configuration.
- * @param port a port description
- */
- void removeQoS(PortDescription port);
-
-}
\ No newline at end of file
diff --git a/core/api/src/main/java/org/onosproject/net/behaviour/PortDiscovery.java b/core/api/src/main/java/org/onosproject/net/behaviour/PortDiscovery.java
deleted file mode 100644
index 1e09c53..0000000
--- a/core/api/src/main/java/org/onosproject/net/behaviour/PortDiscovery.java
+++ /dev/null
@@ -1,41 +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.net.behaviour;
-
-import org.onosproject.net.device.PortDescription;
-import org.onosproject.net.driver.HandlerBehaviour;
-
-import java.util.List;
-
-/**
- * Discovers the set of ports from a device through a device specific protocol.
- * The returned ports are not retrieved from the information stored in ONOS.
- *
- * @deprecated 1.6.0 Goldeneye. Use DeviceDescriptionDiscovery instead
- */
-@Deprecated
-public interface PortDiscovery extends HandlerBehaviour {
-
- /**
- * Retrieves the set of ports from a device.
- *
- * @return a set of port descriptions.
- * @deprecated 1.6.0 Goldeneye. Use DeviceDescriptionDiscovery instead
- */
- @Deprecated
- List<PortDescription> getPorts();
-}
diff --git a/providers/netconf/device/src/main/java/org/onosproject/provider/netconf/device/impl/NetconfDeviceProvider.java b/providers/netconf/device/src/main/java/org/onosproject/provider/netconf/device/impl/NetconfDeviceProvider.java
index 99c8ebd..86b27f6 100644
--- a/providers/netconf/device/src/main/java/org/onosproject/provider/netconf/device/impl/NetconfDeviceProvider.java
+++ b/providers/netconf/device/src/main/java/org/onosproject/provider/netconf/device/impl/NetconfDeviceProvider.java
@@ -44,7 +44,6 @@
import org.onosproject.net.MastershipRole;
import org.onosproject.net.PortNumber;
import org.onosproject.net.SparseAnnotations;
-import org.onosproject.net.behaviour.PortDiscovery;
import org.onosproject.net.config.ConfigFactory;
import org.onosproject.net.config.NetworkConfigEvent;
import org.onosproject.net.config.NetworkConfigListener;
@@ -591,11 +590,7 @@
private void discoverPorts(DeviceId deviceId) {
Device device = deviceService.getDevice(deviceId);
//TODO remove when PortDiscovery is removed from master
- if (device.is(PortDiscovery.class)) {
- PortDiscovery portConfig = device.as(PortDiscovery.class);
- providerService.updatePorts(deviceId,
- portConfig.getPorts());
- } else if (device.is(DeviceDescriptionDiscovery.class)) {
+ if (device.is(DeviceDescriptionDiscovery.class)) {
DeviceDescriptionDiscovery deviceDescriptionDiscovery =
device.as(DeviceDescriptionDiscovery.class);
providerService.updatePorts(deviceId,
diff --git a/providers/rest/device/src/main/java/org/onosproject/provider/rest/device/impl/RestDeviceProvider.java b/providers/rest/device/src/main/java/org/onosproject/provider/rest/device/impl/RestDeviceProvider.java
index 4c0e048..bb30b3a 100644
--- a/providers/rest/device/src/main/java/org/onosproject/provider/rest/device/impl/RestDeviceProvider.java
+++ b/providers/rest/device/src/main/java/org/onosproject/provider/rest/device/impl/RestDeviceProvider.java
@@ -38,7 +38,6 @@
import org.onosproject.net.SparseAnnotations;
import org.onosproject.net.behaviour.DevicesDiscovery;
import org.onosproject.net.behaviour.PortAdmin;
-import org.onosproject.net.behaviour.PortDiscovery;
import org.onosproject.net.config.ConfigFactory;
import org.onosproject.net.config.NetworkConfigEvent;
import org.onosproject.net.config.NetworkConfigListener;
@@ -422,15 +421,9 @@
private void discoverPorts(DeviceId deviceId) {
Device device = deviceService.getDevice(deviceId);
- //TODO remove when PortDiscovery is removed from master
- if (device.is(PortDiscovery.class)) {
- PortDiscovery portConfig = device.as(PortDiscovery.class);
- providerService.updatePorts(deviceId, portConfig.getPorts());
- } else {
- DeviceDescriptionDiscovery deviceDescriptionDiscovery =
- device.as(DeviceDescriptionDiscovery.class);
- providerService.updatePorts(deviceId, deviceDescriptionDiscovery.discoverPortDetails());
- }
+ DeviceDescriptionDiscovery deviceDescriptionDiscovery =
+ device.as(DeviceDescriptionDiscovery.class);
+ providerService.updatePorts(deviceId, deviceDescriptionDiscovery.discoverPortDetails());
}
private boolean testDeviceConnection(RestSBDevice dev) {