Jonathan Hart
Committed by Gerrit Code Review

Moved AbstractWebResource to api bundle so it is accessible by applications.

Change-Id: Iddfe8a7d42d432e09424cede04b6c847198a9c85
Showing 17 changed files with 47 additions and 34 deletions
......@@ -59,6 +59,11 @@
<groupId>org.onosproject</groupId>
<artifactId>onlab-osgi</artifactId>
</dependency>
<dependency>
<groupId>org.onosproject</groupId>
<artifactId>onlab-rest</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</project>
......
......@@ -13,11 +13,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.rest;
package org.onosproject.rest.resources;
import org.onosproject.app.ApplicationAdminService;
import org.onosproject.core.Application;
import org.onosproject.core.ApplicationId;
import org.onosproject.rest.AbstractWebResource;
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
......
......@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.rest;
package org.onosproject.rest.resources;
import com.fasterxml.jackson.databind.node.ArrayNode;
import com.fasterxml.jackson.databind.node.ObjectNode;
......@@ -22,6 +22,7 @@ import org.onosproject.cluster.ClusterService;
import org.onosproject.cluster.ControllerNode;
import org.onosproject.cluster.NodeId;
import org.onosproject.codec.JsonCodec;
import org.onosproject.rest.AbstractWebResource;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
......
......@@ -13,11 +13,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.rest;
package org.onosproject.rest.resources;
import com.fasterxml.jackson.databind.node.ObjectNode;
import org.onosproject.cfg.ComponentConfigService;
import org.onosproject.cfg.ConfigProperty;
import org.onosproject.rest.AbstractWebResource;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
......
......@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.rest;
package org.onosproject.rest.resources;
import com.fasterxml.jackson.databind.JsonNode;
import com.google.common.collect.Lists;
......
......@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.rest;
package org.onosproject.rest.resources;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
......
......@@ -13,12 +13,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.rest;
package org.onosproject.rest.resources;
import com.fasterxml.jackson.databind.node.ObjectNode;
import org.onosproject.net.Device;
import org.onosproject.net.Port;
import org.onosproject.net.device.DeviceService;
import org.onosproject.rest.AbstractWebResource;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
......
......@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.rest;
package org.onosproject.rest.resources;
import com.fasterxml.jackson.databind.node.ArrayNode;
import com.fasterxml.jackson.databind.node.ObjectNode;
......@@ -23,6 +23,7 @@ import org.onosproject.net.DeviceId;
import org.onosproject.net.device.DeviceService;
import org.onosproject.net.flow.FlowEntry;
import org.onosproject.net.flow.FlowRuleService;
import org.onosproject.rest.AbstractWebResource;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
......
......@@ -13,7 +13,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.rest;
package org.onosproject.rest.resources;
import com.fasterxml.jackson.databind.node.ObjectNode;
import org.onosproject.net.Host;
import org.onosproject.net.host.HostService;
import org.onosproject.rest.AbstractWebResource;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
......@@ -22,11 +27,6 @@ import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import org.onosproject.net.Host;
import org.onosproject.net.host.HostService;
import com.fasterxml.jackson.databind.node.ObjectNode;
import static org.onlab.util.Tools.nullIsNotFound;
import static org.onosproject.net.HostId.hostId;
......
......@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.rest;
package org.onosproject.rest.resources;
import java.util.Objects;
import java.util.concurrent.CountDownLatch;
......@@ -37,6 +37,7 @@ import org.onosproject.net.intent.IntentService;
import org.onosproject.net.intent.IntentState;
import org.onosproject.net.intent.Key;
import org.onosproject.net.intent.PointToPointIntent;
import org.onosproject.rest.AbstractWebResource;
import org.slf4j.Logger;
import com.fasterxml.jackson.databind.node.ObjectNode;
......
......@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.rest;
package org.onosproject.rest.resources;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ObjectNode;
......
......@@ -13,12 +13,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.rest;
package org.onosproject.rest.resources;
import org.onosproject.net.ConnectPoint;
import org.onosproject.net.DeviceId;
import org.onosproject.net.Link;
import org.onosproject.net.link.LinkService;
import org.onosproject.rest.AbstractWebResource;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
......@@ -27,7 +28,6 @@ import javax.ws.rs.core.Response;
import static org.onosproject.net.DeviceId.deviceId;
import static org.onosproject.net.PortNumber.portNumber;
import static org.onosproject.rest.LinksWebResource.Direction.valueOf;
/**
* REST resource for interacting with the inventory of infrastructure links.
......@@ -60,7 +60,7 @@ public class LinksWebResource extends AbstractWebResource {
String direction,
LinkService service) {
Direction dir = direction != null ?
valueOf(direction.toUpperCase()) : Direction.ALL;
Direction.valueOf(direction.toUpperCase()) : Direction.ALL;
switch (dir) {
case INGRESS:
return service.getIngressLinks(point);
......@@ -75,7 +75,7 @@ public class LinksWebResource extends AbstractWebResource {
String direction,
LinkService service) {
Direction dir = direction != null ?
valueOf(direction.toUpperCase()) : Direction.ALL;
Direction.valueOf(direction.toUpperCase()) : Direction.ALL;
switch (dir) {
case INGRESS:
return service.getDeviceIngressLinks(deviceId);
......
......@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.rest;
package org.onosproject.rest.resources;
import java.util.Set;
......@@ -30,6 +30,7 @@ import org.onosproject.net.HostId;
import org.onosproject.net.topology.PathService;
import com.fasterxml.jackson.databind.node.ObjectNode;
import org.onosproject.rest.AbstractWebResource;
/**
* REST resource for interacting with path calculations.
......
......@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.rest;
package org.onosproject.rest.resources;
import com.fasterxml.jackson.databind.node.ArrayNode;
import com.fasterxml.jackson.databind.node.ObjectNode;
......@@ -26,6 +26,7 @@ import org.onosproject.net.topology.ClusterId;
import org.onosproject.net.topology.Topology;
import org.onosproject.net.topology.TopologyCluster;
import org.onosproject.net.topology.TopologyService;
import org.onosproject.rest.AbstractWebResource;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
......
......@@ -17,4 +17,4 @@
/**
* Set of resources implementing the ONOS REST API.
*/
package org.onosproject.rest;
package org.onosproject.rest.resources;
......
......@@ -61,19 +61,19 @@
org.onosproject.rest.exceptions.ServerErrorMapper,
org.onosproject.rest.exceptions.BadRequestMapper,
org.onosproject.rest.exceptions.WebApplicationExceptionMapper,
org.onosproject.rest.JsonBodyWriter,
org.onosproject.rest.resources.JsonBodyWriter,
org.onosproject.rest.ApplicationsWebResource,
org.onosproject.rest.ComponentConfigWebResource,
org.onosproject.rest.ClusterWebResource,
org.onosproject.rest.DevicesWebResource,
org.onosproject.rest.LinksWebResource,
org.onosproject.rest.HostsWebResource,
org.onosproject.rest.IntentsWebResource,
org.onosproject.rest.FlowsWebResource,
org.onosproject.rest.TopologyWebResource,
org.onosproject.rest.ConfigWebResource,
org.onosproject.rest.PathsWebResource
org.onosproject.rest.resources.ApplicationsWebResource,
org.onosproject.rest.resources.ComponentConfigWebResource,
org.onosproject.rest.resources.ClusterWebResource,
org.onosproject.rest.resources.DevicesWebResource,
org.onosproject.rest.resources.LinksWebResource,
org.onosproject.rest.resources.HostsWebResource,
org.onosproject.rest.resources.IntentsWebResource,
org.onosproject.rest.resources.FlowsWebResource,
org.onosproject.rest.resources.TopologyWebResource,
org.onosproject.rest.resources.ConfigWebResource,
org.onosproject.rest.resources.PathsWebResource
</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
......