diff --git a/apps/pom.xml b/apps/pom.xml
index 5b82e85..887199f 100644
--- a/apps/pom.xml
+++ b/apps/pom.xml
@@ -44,7 +44,6 @@
         <module>bgprouter</module>
         <module>test</module>
         <module>segmentrouting</module>
-        <module>xos-integration</module>
         <module>kafka-integration</module>
         <module>pcep-api</module>
         <module>iptopology-api</module>
diff --git a/apps/xos-integration/BUCK b/apps/xos-integration/BUCK
deleted file mode 100644
index c1fb6c7..0000000
--- a/apps/xos-integration/BUCK
+++ /dev/null
@@ -1,22 +0,0 @@
-COMPILE_DEPS = [
-    '//lib:CORE_DEPS',
-    '//lib:jersey-client',
-    '//lib:javax.ws.rs-api',
-    '//lib:org.apache.karaf.shell.console',
-    '//cli:onos-cli',
-    '//utils/rest:onlab-rest',
-]
-
-osgi_jar_with_tests (
-    deps = COMPILE_DEPS,
-    import_packages = '*,org.onosproject.cli.net',
-    resources_root = 'src/main/resources',
-    resources = glob(['src/main/resources/**']),
-)
-
-onos_app (
-    title = 'ONOS XOS Integration App',
-    category = 'Utility',
-    url = 'http://onosproject.org',
-    description = 'ONOS XOS integration application.',
-)
diff --git a/apps/xos-integration/features.xml b/apps/xos-integration/features.xml
deleted file mode 100644
index 5b575e0..0000000
--- a/apps/xos-integration/features.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<!--
-  ~ Copyright 2015-present Open Networking Laboratory
-  ~
-  ~ Licensed under the Apache License, Version 2.0 (the "License");
-  ~ you may not use this file except in compliance with the License.
-  ~ You may obtain a copy of the License at
-  ~
-  ~     http://www.apache.org/licenses/LICENSE-2.0
-  ~
-  ~ Unless required by applicable law or agreed to in writing, software
-  ~ distributed under the License is distributed on an "AS IS" BASIS,
-  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  ~ See the License for the specific language governing permissions and
-  ~ limitations under the License.
-  -->
-<features xmlns="http://karaf.apache.org/xmlns/features/v1.2.0" name="${project.artifactId}-${project.version}">
-    <feature name="${project.artifactId}" version="${project.version}"
-             description="${project.description}">
-        <bundle>mvn:org.glassfish.jersey.core/jersey-client/2.22.2</bundle>
-        <bundle>mvn:${project.groupId}/${project.artifactId}/${project.version}</bundle>
-    </feature>
-</features>
diff --git a/apps/xos-integration/pom.xml b/apps/xos-integration/pom.xml
deleted file mode 100644
index 7ec6093..0000000
--- a/apps/xos-integration/pom.xml
+++ /dev/null
@@ -1,70 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  ~ Copyright 2015-present Open Networking Laboratory
-  ~
-  ~ Licensed under the Apache License, Version 2.0 (the "License");
-  ~ you may not use this file except in compliance with the License.
-  ~ You may obtain a copy of the License at
-  ~
-  ~     http://www.apache.org/licenses/LICENSE-2.0
-  ~
-  ~ Unless required by applicable law or agreed to in writing, software
-  ~ distributed under the License is distributed on an "AS IS" BASIS,
-  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  ~ See the License for the specific language governing permissions and
-  ~ limitations under the License.
-  -->
-<project xmlns="http://maven.apache.org/POM/4.0.0"
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-    <modelVersion>4.0.0</modelVersion>
-
-    <parent>
-        <groupId>org.onosproject</groupId>
-        <artifactId>onos-apps</artifactId>
-        <version>1.7.0-SNAPSHOT</version>
-    </parent>
-
-    <artifactId>onos-app-xos-integration</artifactId>
-    <packaging>bundle</packaging>
-
-    <description>ONOS XOS integration application</description>
-
-    <properties>
-        <onos.app.name>org.onosproject.xosintegration</onos.app.name>
-        <onos.app.title>ONOS XOS Integration App</onos.app.title>
-        <onos.app.category>Utility</onos.app.category>
-        <onos.app.url>http://onosproject.org</onos.app.url>
-        <onos.app.readme>ONOS XOS integration application.</onos.app.readme>
-    </properties>
-
-    <dependencies>
-        <dependency>
-            <groupId>org.osgi</groupId>
-            <artifactId>org.osgi.compendium</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.glassfish.jersey.core</groupId>
-            <artifactId>jersey-client</artifactId>
-            <version>2.22.2</version>
-        </dependency>
-        <dependency>
-            <groupId>org.onosproject</groupId>
-            <artifactId>onos-cli</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.osgi</groupId>
-            <artifactId>org.osgi.core</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.karaf.shell</groupId>
-            <artifactId>org.apache.karaf.shell.console</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.onosproject</groupId>
-            <artifactId>onlab-misc</artifactId>
-        </dependency>
-    </dependencies>
-
-</project>
diff --git a/apps/xos-integration/src/main/java/org/onosproject/xosintegration/OnosXosIntegrationManager.java b/apps/xos-integration/src/main/java/org/onosproject/xosintegration/OnosXosIntegrationManager.java
deleted file mode 100644
index b443ebc..0000000
--- a/apps/xos-integration/src/main/java/org/onosproject/xosintegration/OnosXosIntegrationManager.java
+++ /dev/null
@@ -1,539 +0,0 @@
-/*
- * Copyright 2015-present Open Networking Laboratory
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.onosproject.xosintegration;
-
-import com.eclipsesource.json.JsonArray;
-import com.eclipsesource.json.JsonObject;
-import com.google.common.collect.Maps;
-import org.apache.felix.scr.annotations.Activate;
-import org.apache.felix.scr.annotations.Component;
-import org.apache.felix.scr.annotations.Deactivate;
-import org.apache.felix.scr.annotations.Modified;
-import org.apache.felix.scr.annotations.Property;
-import org.apache.felix.scr.annotations.Reference;
-import org.apache.felix.scr.annotations.ReferenceCardinality;
-import org.apache.felix.scr.annotations.Service;
-import org.glassfish.jersey.client.authentication.HttpAuthenticationFeature;
-import org.onlab.packet.VlanId;
-import org.onlab.util.Tools;
-import org.onosproject.cfg.ComponentConfigService;
-import org.onosproject.core.ApplicationId;
-import org.onosproject.core.CoreService;
-import org.onosproject.net.ConnectPoint;
-import org.onosproject.net.DeviceId;
-import org.onosproject.net.PortNumber;
-import org.onosproject.net.flow.DefaultTrafficSelector;
-import org.onosproject.net.flow.DefaultTrafficTreatment;
-import org.onosproject.net.flow.TrafficSelector;
-import org.onosproject.net.flow.TrafficTreatment;
-import org.onosproject.net.flowobjective.DefaultForwardingObjective;
-import org.onosproject.net.flowobjective.FlowObjectiveService;
-import org.onosproject.net.flowobjective.ForwardingObjective;
-import org.osgi.service.component.ComponentContext;
-import org.slf4j.Logger;
-
-import javax.ws.rs.client.Client;
-import javax.ws.rs.client.ClientBuilder;
-import javax.ws.rs.client.Entity;
-import javax.ws.rs.client.Invocation;
-import javax.ws.rs.client.WebTarget;
-import javax.ws.rs.core.Response;
-import java.util.Dictionary;
-import java.util.Map;
-import java.util.Set;
-import java.util.stream.Collectors;
-import java.util.stream.IntStream;
-
-import static com.google.common.base.Strings.isNullOrEmpty;
-import static com.google.common.net.MediaType.JSON_UTF_8;
-import static java.net.HttpURLConnection.HTTP_CREATED;
-import static java.net.HttpURLConnection.HTTP_NO_CONTENT;
-import static java.net.HttpURLConnection.HTTP_OK;
-import static org.slf4j.LoggerFactory.getLogger;
-
-
-/**
- * XOS interface application.
- */
-@Component(immediate = true)
-@Service
-public class OnosXosIntegrationManager implements VoltTenantService {
-    private static final String XOS_SERVER_ADDRESS_PROPERTY_NAME =
-            "xosServerAddress";
-    private static final String XOS_SERVER_PORT_PROPERTY_NAME =
-            "xosServerPort";
-    private static final String XOS_PROVIDER_SERVICE_PROPERTY_NAME =
-            "xosProviderService";
-
-    private static final String TEST_XOS_SERVER_ADDRESS = "10.254.1.22";
-    private static final int TEST_XOS_SERVER_PORT = 8000;
-    private static final String XOS_TENANT_BASE_URI = "/xoslib/volttenant/";
-    private static final int TEST_XOS_PROVIDER_SERVICE = 1;
-
-    private static final int PRIORITY = 50000;
-    private static final DeviceId FABRIC_DEVICE_ID = DeviceId.deviceId("of:5e3e486e73000187");
-    private static final PortNumber FABRIC_OLT_CONNECT_POINT = PortNumber.portNumber(2);
-    private static final PortNumber FABRIC_VCPE_CONNECT_POINT = PortNumber.portNumber(3);
-    private static final String FABRIC_CONTROLLER_ADDRESS = "10.0.3.136";
-    private static final int FABRIC_SERVER_PORT = 8181;
-    private static final String FABRIC_BASE_URI = "/onos/cordfabric/vlans/add";
-
-    private static final DeviceId OLT_DEVICE_ID = DeviceId.deviceId("of:90e2ba82f97791e9");
-    private static final int OLT_UPLINK_PORT = 129;
-
-    private static final ConnectPoint FABRIC_PORT = new ConnectPoint(
-            DeviceId.deviceId("of:000090e2ba82f974"),
-            PortNumber.portNumber(2));
-
-    private final Logger log = getLogger(getClass());
-    @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
-    protected CoreService coreService;
-    @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
-    protected ComponentConfigService cfgService;
-
-    @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
-    protected FlowObjectiveService flowObjectiveService;
-
-    @Property(name = XOS_SERVER_ADDRESS_PROPERTY_NAME,
-              value = TEST_XOS_SERVER_ADDRESS,
-              label = "XOS Server address")
-    protected String xosServerAddress = TEST_XOS_SERVER_ADDRESS;
-
-    @Property(name = XOS_SERVER_PORT_PROPERTY_NAME,
-              intValue = TEST_XOS_SERVER_PORT,
-              label = "XOS Server port")
-    protected int xosServerPort = TEST_XOS_SERVER_PORT;
-
-    @Property(name = XOS_PROVIDER_SERVICE_PROPERTY_NAME,
-            intValue = TEST_XOS_PROVIDER_SERVICE,
-            label = "XOS Provider Service")
-    protected int xosProviderService = TEST_XOS_PROVIDER_SERVICE;
-
-    private ApplicationId appId;
-    private Map<String, ConnectPoint> nodeToPort;
-    private Map<Long, Short> portToVlan;
-    private Map<ConnectPoint, String> portToSsid;
-
-    @Activate
-    public void activate(ComponentContext context) {
-        log.info("XOS app is starting");
-        cfgService.registerProperties(getClass());
-        appId = coreService.registerApplication("org.onosproject.xosintegration");
-
-        setupMap();
-
-        readComponentConfiguration(context);
-
-        log.info("XOS({}) started", appId.id());
-    }
-
-    @Deactivate
-    public void deactivate() {
-        cfgService.unregisterProperties(getClass(), false);
-        log.info("XOS({}) stopped", appId.id());
-    }
-
-    @Modified
-    public void modified(ComponentContext context) {
-        readComponentConfiguration(context);
-    }
-
-    private void setupMap() {
-        nodeToPort = Maps.newHashMap();
-
-        nodeToPort.put("cordcompute01.onlab.us", new ConnectPoint(FABRIC_DEVICE_ID,
-                                                                  PortNumber.portNumber(4)));
-
-        nodeToPort.put("cordcompute02.onlab.us", new ConnectPoint(FABRIC_DEVICE_ID,
-                                                                  PortNumber.portNumber(3)));
-
-        portToVlan = Maps.newHashMap();
-        portToVlan.putIfAbsent(1L, (short) 201);
-        portToVlan.putIfAbsent(6L, (short) 401);
-
-        portToSsid = Maps.newHashMap();
-        portToSsid.put(new ConnectPoint(OLT_DEVICE_ID, PortNumber.portNumber(1)), "0");
-        portToSsid.put(new ConnectPoint(FABRIC_DEVICE_ID, PortNumber.portNumber(6)), "1");
-    }
-
-    /**
-     * Converts a JSON representation of a tenant into a tenant object.
-     *
-     * @param jsonTenant JSON object representing the tenant
-     * @return volt tenant object
-     */
-    private VoltTenant jsonToTenant(JsonObject jsonTenant) {
-        return VoltTenant.builder()
-                .withHumanReadableName(jsonTenant.get("humanReadableName").asString())
-                .withId(jsonTenant.get("id").asInt())
-                .withProviderService(jsonTenant.get("provider_service").asInt())
-                .withServiceSpecificId(jsonTenant.get("service_specific_id").asString())
-                .withVlanId(jsonTenant.get("vlan_id").asString())
-                .build();
-    }
-
-    /**
-     * Converts a tenant object into a JSON string.
-     *
-     * @param tenant volt tenant object to convert
-     * @return JSON string for the tenant
-     */
-    private String tenantToJson(VoltTenant tenant) {
-        return "{"
-                    + "\"humanReadableName\": \"" + tenant.humanReadableName() + "\","
-                    + "\"id\": \"" + tenant.id() + "\","
-                    + "\"provider_service\": \"" + tenant.providerService() + "\","
-                    + "\"service_specific_id\": \"" + tenant.serviceSpecificId() + "\","
-                    + "\"vlan_id\": \"" + tenant.vlanId() + "\""
-                    + "}";
-    }
-
-    /**
-     * Gets a client web resource builder for the base XOS REST API
-     * with no additional URI.
-     *
-     * @return web resource builder
-     * @deprecated in Cardinal Release
-     */
-    @Deprecated
-    private Invocation.Builder getClientBuilder() {
-        return getClientBuilder("");
-    }
-
-    /**
-     * Gets a client web resource builder for the base XOS REST API
-     * with an optional additional URI.
-     *
-     * @return web resource builder
-     * @deprecated in Cardinal Release
-     */
-    @Deprecated
-    private Invocation.Builder getClientBuilder(String uri) {
-        String baseUrl = "http://" + xosServerAddress + ":"
-                + Integer.toString(xosServerPort);
-        Client client = ClientBuilder.newClient();
-        client.register(HttpAuthenticationFeature.basic("padmin@vicci.org", "letmein"));
-        WebTarget wt = client.target(baseUrl
-                + XOS_TENANT_BASE_URI + uri);
-        return wt.request(JSON_UTF_8.toString());
-    }
-
-    /**
-     * Performs a REST GET operation on the base XOS REST URI.
-     *
-     * @return JSON string fetched by the GET operation
-     * @deprecated in Cardinal Release
-     */
-    @Deprecated
-    private String getRest() {
-        return getRest("");
-    }
-
-    /**
-     * Performs a REST GET operation on the base XOS REST URI with
-     * an optional additional URI.
-     *
-     * @return JSON string fetched by the GET operation
-     * @deprecated in Cardinal Release
-     */
-    @Deprecated
-    private String getRest(String uri) {
-        Invocation.Builder builder = getClientBuilder(uri);
-        Response response = builder.get();
-
-        if (response.getStatus() != HTTP_OK) {
-            log.info("REST GET request returned error code {}",
-                    response.getStatus());
-        }
-        String jsonString = builder.get(String.class);
-        log.info("JSON read:\n{}", jsonString);
-
-        return jsonString;
-    }
-
-    /**
-     * Performs a REST POST operation of a json string on the base
-     * XOS REST URI with an optional additional URI.
-     *
-     * @param json JSON string to post
-     * @deprecated in Cardinal Release
-     */
-    @Deprecated
-    private String postRest(String json) {
-        Invocation.Builder builder = getClientBuilder();
-        Response response = builder.post(Entity.json(json));
-
-        if (response.getStatus() != HTTP_CREATED) {
-            log.info("REST POST request returned error code {}",
-                    response.getStatus());
-        }
-        return builder.post(Entity.json(json), String.class);
-    }
-
-    /**
-     * Performs a REST DELETE operation on the base
-     * XOS REST URI with an optional additional URI.
-     *
-     * @param uri optional additional URI
-     * @deprecated in Cardinal Release
-     */
-    @Deprecated
-    private void deleteRest(String uri) {
-        Invocation.Builder builder = getClientBuilder(uri);
-        Response response = builder.delete();
-
-        if (response.getStatus() != HTTP_NO_CONTENT) {
-            log.info("REST DELETE request returned error code {}",
-                    response.getStatus());
-        }
-    }
-
-    /**
-     * Deletes the tenant with the given ID.
-     *
-     * @param tenantId ID of tenant to delete
-     */
-    private void deleteTenant(long tenantId) {
-        deleteRest(Long.toString(tenantId));
-    }
-
-    @Override
-    public Set<VoltTenant> getAllTenants() {
-        String jsonString = getRest();
-
-        JsonArray voltTenantItems = JsonArray.readFrom(jsonString);
-
-        return IntStream.range(0, voltTenantItems.size())
-                .mapToObj(index -> jsonToTenant(voltTenantItems.get(index).asObject()))
-                .collect(Collectors.toSet());
-    }
-
-    @Override
-    public void removeTenant(long id) {
-        deleteTenant(id);
-    }
-
-    @Override
-    public VoltTenant addTenant(VoltTenant newTenant) {
-        long providerServiceId = newTenant.providerService();
-        if (providerServiceId == -1) {
-            providerServiceId = xosProviderService;
-        }
-
-        PortNumber onuPort = newTenant.port().port();
-        VlanId subscriberVlan;
-        try {
-            subscriberVlan = VlanId.vlanId(portToVlan.get(onuPort.toLong()));
-        } catch (NullPointerException npe) {
-            log.error("No matched port in portToVlan map", npe);
-            return newTenant;
-        }
-
-        VoltTenant tenantToCreate = VoltTenant.builder()
-                .withProviderService(providerServiceId)
-                .withServiceSpecificId(portToSsid.get(newTenant.port()))
-                .withVlanId(String.valueOf(subscriberVlan.toShort()))
-                .withPort(newTenant.port())
-                .build();
-        String json = tenantToJson(tenantToCreate);
-
-
-        provisionVlanOnPort(OLT_DEVICE_ID, OLT_UPLINK_PORT, onuPort, subscriberVlan.toShort());
-
-        String retJson = postRest(json);
-
-        fetchCpeLocation(tenantToCreate, retJson);
-
-        return newTenant;
-    }
-
-    private void fetchCpeLocation(VoltTenant newTenant, String jsonString) {
-        JsonObject json = JsonObject.readFrom(jsonString);
-
-        if (json.get("computeNodeName") != null) {
-            ConnectPoint point = nodeToPort.get(json.get("computeNodeName").asString());
-            //ConnectPoint fromPoint = newTenant.port();
-            ConnectPoint oltPort = new ConnectPoint(FABRIC_DEVICE_ID, FABRIC_OLT_CONNECT_POINT);
-
-            provisionFabric(VlanId.vlanId(Short.parseShort(newTenant.vlanId())),
-                            point, oltPort);
-        }
-
-    }
-
-    @Override
-    public VoltTenant getTenant(long id) {
-        String jsonString = getRest(Long.toString(id));
-        JsonObject jsonTenant = JsonObject.readFrom(jsonString);
-        if (jsonTenant.get("id") != null) {
-            return jsonToTenant(jsonTenant);
-        } else {
-            return null;
-        }
-    }
-
-    private void provisionVlanOnPort(DeviceId deviceId, int uplinkPort, PortNumber p, short vlanId) {
-
-        TrafficSelector upstream = DefaultTrafficSelector.builder()
-                .matchVlanId(VlanId.ANY)
-                .matchInPort(p)
-                .build();
-
-        TrafficSelector downstream = DefaultTrafficSelector.builder()
-                .matchVlanId(VlanId.vlanId(vlanId))
-                .matchInPort(PortNumber.portNumber(uplinkPort))
-                .build();
-
-        TrafficTreatment upstreamTreatment = DefaultTrafficTreatment.builder()
-                .setVlanId(VlanId.vlanId(vlanId))
-                .setOutput(PortNumber.portNumber(uplinkPort))
-                .build();
-
-        TrafficTreatment downstreamTreatment = DefaultTrafficTreatment.builder()
-                .popVlan()
-                .setOutput(p)
-                .build();
-
-
-        ForwardingObjective upFwd = DefaultForwardingObjective.builder()
-                .withFlag(ForwardingObjective.Flag.VERSATILE)
-                .withPriority(1000)
-                .makePermanent()
-                .withSelector(upstream)
-                .fromApp(appId)
-                .withTreatment(upstreamTreatment)
-                .add();
-
-        ForwardingObjective downFwd = DefaultForwardingObjective.builder()
-                .withFlag(ForwardingObjective.Flag.VERSATILE)
-                .withPriority(1000)
-                .makePermanent()
-                .withSelector(downstream)
-                .fromApp(appId)
-                .withTreatment(downstreamTreatment)
-                .add();
-
-        flowObjectiveService.forward(deviceId, upFwd);
-        flowObjectiveService.forward(deviceId, downFwd);
-
-    }
-
-    private void provisionDataPlane(VoltTenant tenant) {
-        VlanId vlan = VlanId.vlanId(Short.parseShort(tenant.vlanId()));
-
-        TrafficSelector fromGateway = DefaultTrafficSelector.builder()
-                .matchInPhyPort(tenant.port().port())
-                .build();
-
-        TrafficSelector fromFabric = DefaultTrafficSelector.builder()
-                .matchInPhyPort(FABRIC_PORT.port())
-                .matchVlanId(vlan)
-                .build();
-
-        TrafficTreatment toFabric = DefaultTrafficTreatment.builder()
-                .pushVlan()
-                .setVlanId(vlan)
-                .setOutput(FABRIC_PORT.port())
-                .build();
-
-        TrafficTreatment toGateway = DefaultTrafficTreatment.builder()
-                .popVlan()
-                .setOutput(tenant.port().port())
-                .build();
-
-        ForwardingObjective forwardToFabric = DefaultForwardingObjective.builder()
-                .withFlag(ForwardingObjective.Flag.VERSATILE)
-                .withPriority(PRIORITY)
-                .makePermanent()
-                .fromApp(appId)
-                .withSelector(fromGateway)
-                .withTreatment(toFabric)
-                .add();
-
-        ForwardingObjective forwardToGateway = DefaultForwardingObjective.builder()
-                .withFlag(ForwardingObjective.Flag.VERSATILE)
-                .withPriority(PRIORITY)
-                .makePermanent()
-                .fromApp(appId)
-                .withSelector(fromFabric)
-                .withTreatment(toGateway)
-                .add();
-
-        flowObjectiveService.forward(FABRIC_PORT.deviceId(), forwardToFabric);
-        flowObjectiveService.forward(FABRIC_PORT.deviceId(), forwardToGateway);
-    }
-
-    private void provisionFabric(VlanId vlanId, ConnectPoint point, ConnectPoint fromPoint) {
-
-        long vlan = vlanId.toShort();
-
-        JsonObject node = new JsonObject();
-        node.add("vlan", vlan);
-        if (vlan == 201) {
-            node.add("iptv", true);
-        } else {
-            node.add("iptv", false);
-        }
-        JsonArray array = new JsonArray();
-        JsonObject cp1 = new JsonObject();
-        JsonObject cp2 = new JsonObject();
-        cp1.add("device", point.deviceId().toString());
-        cp1.add("port", point.port().toLong());
-        cp2.add("device", fromPoint.deviceId().toString());
-        cp2.add("port", fromPoint.port().toLong());
-        array.add(cp1);
-        array.add(cp2);
-        node.add("ports", array);
-
-
-        String baseUrl = "http://" + FABRIC_CONTROLLER_ADDRESS + ":"
-                + Integer.toString(FABRIC_SERVER_PORT);
-        Client client = ClientBuilder.newClient();
-        WebTarget wt = client.target(baseUrl + FABRIC_BASE_URI);
-        Invocation.Builder builder = wt.request(JSON_UTF_8.toString());
-
-        builder.post(Entity.json(node.toString()));
-    }
-
-    /**
-     * Extracts properties from the component configuration context.
-     *
-     * @param context the component context
-     */
-    private void readComponentConfiguration(ComponentContext context) {
-        Dictionary<?, ?> properties = context.getProperties();
-
-        String newXosServerAddress =
-                Tools.get(properties, XOS_SERVER_ADDRESS_PROPERTY_NAME);
-        if (!isNullOrEmpty(newXosServerAddress)) {
-            xosServerAddress = newXosServerAddress;
-        }
-
-        String newXosServerPortString =
-                Tools.get(properties, XOS_SERVER_PORT_PROPERTY_NAME);
-        if (!isNullOrEmpty(newXosServerPortString)) {
-            xosServerPort = Integer.parseInt(newXosServerPortString);
-        }
-
-        String newXosProviderServiceString =
-                Tools.get(properties, XOS_PROVIDER_SERVICE_PROPERTY_NAME);
-        if (!isNullOrEmpty(newXosProviderServiceString)) {
-            xosProviderService = Integer.parseInt(newXosProviderServiceString);
-        }
-    }
-}
-
-
diff --git a/apps/xos-integration/src/main/java/org/onosproject/xosintegration/VoltTenant.java b/apps/xos-integration/src/main/java/org/onosproject/xosintegration/VoltTenant.java
deleted file mode 100644
index 05bc04c..0000000
--- a/apps/xos-integration/src/main/java/org/onosproject/xosintegration/VoltTenant.java
+++ /dev/null
@@ -1,202 +0,0 @@
-/*
- * Copyright 2015-present Open Networking Laboratory
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.onosproject.xosintegration;
-
-import com.google.common.base.MoreObjects;
-import org.onosproject.net.ConnectPoint;
-
-public final class VoltTenant {
-
-    private final String humanReadableName;
-    private final long id;
-    private final long providerService;
-    private final String serviceSpecificId;
-    private final String vlanId;
-    private final ConnectPoint port;
-
-    /**
-     * Constructs a vOLT tenant object.
-     *
-     * @param humanReadableName name string
-     * @param id identifier for the tenant
-     * @param providerService provider service ID
-     * @param serviceSpecificId id for the user
-     * @param vlanId vlan id for the user
-     */
-    private VoltTenant(String humanReadableName, long id, long providerService,
-                       String serviceSpecificId, String vlanId, ConnectPoint port) {
-        this.humanReadableName = humanReadableName;
-        this.id = id;
-        this.providerService = providerService;
-        this.serviceSpecificId = serviceSpecificId;
-        this.vlanId = vlanId;
-        this.port = port;
-    }
-
-    /**
-     * Fetches a builder to make a tenant.
-     *
-     * @return tenant builder
-     */
-    public static Builder builder() {
-        return new Builder();
-    }
-
-    /**
-     * Fetches the name of the tenant.
-     *
-     * @return human readable name
-     */
-    public String humanReadableName() {
-        return humanReadableName;
-    }
-
-    /**
-     * Fetches the ID of the tenant object.
-     *
-     * @return ID of tenant object.
-     */
-    public long id() {
-        return id;
-    }
-
-    /**
-     * Fetches the identifier for the provider service.
-     *
-     * @return provider service ID
-     */
-    public long providerService() {
-        return providerService;
-    }
-
-    /**
-     * Fetches the server specific ID (user id).
-     *
-     * @return server specific ID
-     */
-    public String serviceSpecificId() {
-        return serviceSpecificId;
-    }
-
-    /**
-     * Fetches the vlan id for this tenant.
-     *
-     * @return VLAN ID
-     */
-    public String vlanId() {
-        return vlanId;
-    }
-
-    public ConnectPoint port() {
-        return port;
-    }
-
-    /**
-     * Builder class to allow callers to assemble tenants.
-     */
-
-    public static final class Builder {
-        private String humanReadableName = "unknown";
-        private long id = 0;
-        private long providerService = -1;
-        private String serviceSpecificId = "unknown";
-        private String vlanId = "unknown";
-        private ConnectPoint port;
-
-        /**
-         * Sets the name string for the tenant.
-         *
-         * @param humanReadableName name
-         * @return self
-         */
-        public Builder withHumanReadableName(String humanReadableName) {
-            this.humanReadableName = humanReadableName;
-            return this;
-        }
-
-        /**
-         * Sets the identifier for the tenant.
-         *
-         * @param id identifier for the tenant
-         * @return self
-         */
-        public Builder withId(long id) {
-            this.id = id;
-            return this;
-        }
-
-        /**
-         * Sets the server specific id (user id) for the tenant.
-         *
-         * @param serviceSpecificId server specific (user) id
-         * @return self
-         */
-        public Builder withServiceSpecificId(String serviceSpecificId) {
-            this.serviceSpecificId = serviceSpecificId;
-            return this;
-        }
-
-        /**
-         * Sets the VLAN ID for the tenant.
-         *
-         * @param vlanId VLAN ID
-         * @return self
-         */
-        public Builder withVlanId(String vlanId) {
-            this.vlanId = vlanId;
-            return this;
-        }
-
-        /**
-         * Sets the provider service ID.
-         *
-         * @param providerService provider service ID
-         * @return self
-         */
-        public Builder withProviderService(long providerService) {
-            this.providerService = providerService;
-            return this;
-        }
-
-        public Builder withPort(ConnectPoint port) {
-            this.port = port;
-            return this;
-        }
-
-        /**
-         * Constructs a VoltTenant from the assembled data.
-         *
-         * @return constructed tenant object
-         */
-        public VoltTenant build() {
-            return new VoltTenant(humanReadableName, id, providerService,
-                    serviceSpecificId, vlanId, port);
-        }
-    }
-
-    @Override
-    public String toString() {
-        return MoreObjects.toStringHelper(getClass())
-                .add("humanReadableName", humanReadableName())
-                .add("id", id())
-                .add("providerService", providerService())
-                .add("serviceSpecificId", serviceSpecificId())
-                .add("vlanId", vlanId())
-                .add("port", port())
-                .toString();
-    }
-
-}
diff --git a/apps/xos-integration/src/main/java/org/onosproject/xosintegration/VoltTenantService.java b/apps/xos-integration/src/main/java/org/onosproject/xosintegration/VoltTenantService.java
deleted file mode 100644
index 8d6a631..0000000
--- a/apps/xos-integration/src/main/java/org/onosproject/xosintegration/VoltTenantService.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright 2015-present Open Networking Laboratory
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.onosproject.xosintegration;
-
-import java.util.Set;
-
-public interface VoltTenantService {
-
-    /**
-     * Queries all the tenants.
-     *
-     * @return Set of all of the tenants
-     */
-    Set<VoltTenant> getAllTenants();
-
-    /**
-     * Removes a tenant given its ID.
-     *
-     * @param id if od tenant to remove.
-     */
-    void removeTenant(long id);
-
-    /**
-     * Creates a new tenant and adds it to the XOS instance.
-     *
-     * @param newTenant tenant to add
-     * @return the added tenant
-     */
-    VoltTenant addTenant(VoltTenant newTenant);
-
-    /**
-     * Gets a single tenant for the given ID.
-     *
-     * @param id ID of the tenant to fetch
-     * @return tenant that was fetched
-     */
-    VoltTenant getTenant(long id);
-}
diff --git a/apps/xos-integration/src/main/java/org/onosproject/xosintegration/cli/TenantIdCompleter.java b/apps/xos-integration/src/main/java/org/onosproject/xosintegration/cli/TenantIdCompleter.java
deleted file mode 100644
index da0c396..0000000
--- a/apps/xos-integration/src/main/java/org/onosproject/xosintegration/cli/TenantIdCompleter.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright 2015-present Open Networking Laboratory
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.onosproject.xosintegration.cli;
-
-import java.util.List;
-
-import org.onosproject.cli.AbstractChoicesCompleter;
-import org.onosproject.xosintegration.VoltTenant;
-import org.onosproject.xosintegration.VoltTenantService;
-import static java.util.stream.Collectors.toList;
-
-import static org.onosproject.cli.AbstractShellCommand.get;
-
-
-/**
- * Application command completer.
- */
-public class TenantIdCompleter extends AbstractChoicesCompleter {
-    @Override
-    public List<String> choices() {
-        VoltTenantService service = get(VoltTenantService.class);
-
-        return service.getAllTenants().stream()
-                .map(VoltTenant::id)
-                .map(Object::toString)
-                .collect(toList());
-
-    }
-
-}
diff --git a/apps/xos-integration/src/main/java/org/onosproject/xosintegration/cli/VoltRemoveTenantCommand.java b/apps/xos-integration/src/main/java/org/onosproject/xosintegration/cli/VoltRemoveTenantCommand.java
deleted file mode 100644
index 85b9c2b..0000000
--- a/apps/xos-integration/src/main/java/org/onosproject/xosintegration/cli/VoltRemoveTenantCommand.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright 2015-present Open Networking Laboratory
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.onosproject.xosintegration.cli;
-
-import org.apache.karaf.shell.commands.Argument;
-import org.apache.karaf.shell.commands.Command;
-import org.onosproject.cli.AbstractShellCommand;
-import org.onosproject.xosintegration.VoltTenantService;
-
-/**
- * CLI command to remove an existing tenant from the system.
- */
-@Command(scope = "onos", name = "remove-tenant",
-        description = "Removes a tenant")
-public class VoltRemoveTenantCommand extends AbstractShellCommand {
-
-    @Argument(index = 0, name = "tenant",
-            description = "Tenant ID",
-            required = true, multiValued = false)
-    String tenantIdString = null;
-
-    @Override
-    protected void execute() {
-        VoltTenantService service = get(VoltTenantService.class);
-
-        service.removeTenant(Long.parseLong(tenantIdString));
-    }
-}
diff --git a/apps/xos-integration/src/main/java/org/onosproject/xosintegration/cli/VoltTenantsCreateCommand.java b/apps/xos-integration/src/main/java/org/onosproject/xosintegration/cli/VoltTenantsCreateCommand.java
deleted file mode 100644
index a5de8a7..0000000
--- a/apps/xos-integration/src/main/java/org/onosproject/xosintegration/cli/VoltTenantsCreateCommand.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright 2015-present Open Networking Laboratory
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.onosproject.xosintegration.cli;
-
-import org.apache.karaf.shell.commands.Argument;
-import org.apache.karaf.shell.commands.Command;
-import org.onosproject.cli.AbstractShellCommand;
-import org.onosproject.net.ConnectPoint;
-import org.onosproject.xosintegration.VoltTenant;
-import org.onosproject.xosintegration.VoltTenantService;
-
-/**
- * CLI command to create a new tenant.
- */
-@Command(scope = "onos", name = "add-tenant",
-        description = "Lists the inventory of VOLT tenants and their contents")
-public class VoltTenantsCreateCommand extends AbstractShellCommand {
-
-    @Argument(index = 0, name = "service specific ID",
-            description = "service specific ID",
-            required = true, multiValued = false)
-    String serviceSpecificId;
-
-    @Argument(index = 1, name = "vlan ID",
-            description = "vlan ID",
-            required = true, multiValued = false)
-    String vlanId;
-
-    @Argument(index = 2, name = "port",
-            description = "Port",
-            required = true, multiValued = false)
-    String port;
-
-    @Override
-    protected void execute() {
-        VoltTenantService service = get(VoltTenantService.class);
-
-        VoltTenant newTenant = VoltTenant.builder()
-                .withServiceSpecificId(serviceSpecificId)
-                .withVlanId(vlanId)
-                .withPort(ConnectPoint.deviceConnectPoint(port))
-                .build();
-
-        service.addTenant(newTenant);
-    }
-}
diff --git a/apps/xos-integration/src/main/java/org/onosproject/xosintegration/cli/VoltTenantsListCommand.java b/apps/xos-integration/src/main/java/org/onosproject/xosintegration/cli/VoltTenantsListCommand.java
deleted file mode 100644
index 5480970..0000000
--- a/apps/xos-integration/src/main/java/org/onosproject/xosintegration/cli/VoltTenantsListCommand.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright 2015-present Open Networking Laboratory
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.onosproject.xosintegration.cli;
-
-import java.util.Set;
-
-import org.apache.karaf.shell.commands.Argument;
-import org.apache.karaf.shell.commands.Command;
-import org.onosproject.cli.AbstractShellCommand;
-import org.onosproject.xosintegration.VoltTenant;
-import org.onosproject.xosintegration.VoltTenantService;
-
-/**
- * CLI command for listing VOLT tenant objects.
- */
-
-/**
- * CLI command to list the existing tenants.
- */
-@Command(scope = "onos", name = "tenants",
-        description = "Lists the inventory of VOLT tenants and their contents")
-public class VoltTenantsListCommand extends AbstractShellCommand {
-
-    @Argument(index = 0, name = "tenantId",
-            description = "Tenant ID",
-            required = false, multiValued = false)
-    private String tenantId = null;
-
-    @Override
-    protected void execute() {
-        VoltTenantService service = get(VoltTenantService.class);
-
-        if (tenantId != null) {
-            VoltTenant tenant = service.getTenant(Long.parseLong(tenantId));
-            if (tenant != null) {
-                print(tenant.toString());
-            } else {
-                error("Tenant not found {}", tenantId);
-            }
-        } else {
-            Set<VoltTenant> tenants = service.getAllTenants();
-            for (VoltTenant tenant : tenants) {
-                print(tenant.toString());
-            }
-        }
-    }
-
-}
diff --git a/apps/xos-integration/src/main/java/org/onosproject/xosintegration/cli/package-info.java b/apps/xos-integration/src/main/java/org/onosproject/xosintegration/cli/package-info.java
deleted file mode 100644
index 7ef2b1b..0000000
--- a/apps/xos-integration/src/main/java/org/onosproject/xosintegration/cli/package-info.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright 2015-present Open Networking Laboratory
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/**
- * XOS integration application CLI commands.
- */
-package org.onosproject.xosintegration.cli;
\ No newline at end of file
diff --git a/apps/xos-integration/src/main/java/org/onosproject/xosintegration/package-info.java b/apps/xos-integration/src/main/java/org/onosproject/xosintegration/package-info.java
deleted file mode 100644
index 7fddd5e..0000000
--- a/apps/xos-integration/src/main/java/org/onosproject/xosintegration/package-info.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright 2015-present Open Networking Laboratory
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/**
- * XOS integration application which relies on XOS REST APIs to manage VMs.
- */
-package org.onosproject.xosintegration;
diff --git a/apps/xos-integration/src/main/resources/OSGI-INF/blueprint/shell-config.xml b/apps/xos-integration/src/main/resources/OSGI-INF/blueprint/shell-config.xml
deleted file mode 100644
index 4d43dda..0000000
--- a/apps/xos-integration/src/main/resources/OSGI-INF/blueprint/shell-config.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-<!--
-  ~ Copyright 2015-present Open Networking Laboratory
-  ~
-  ~ Licensed under the Apache License, Version 2.0 (the "License");
-  ~ you may not use this file except in compliance with the License.
-  ~ You may obtain a copy of the License at
-  ~
-  ~     http://www.apache.org/licenses/LICENSE-2.0
-  ~
-  ~ Unless required by applicable law or agreed to in writing, software
-  ~ distributed under the License is distributed on an "AS IS" BASIS,
-  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  ~ See the License for the specific language governing permissions and
-  ~ limitations under the License.
-  -->
-<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
-    <command-bundle xmlns="http://karaf.apache.org/xmlns/shell/v1.1.0">
-        <command>
-            <action class="org.onosproject.xosintegration.cli.VoltTenantsListCommand"/>
-            <completers>
-                <ref component-id="tenantIdCompleter"/>
-                <null/>
-            </completers>
-        </command>
-        <command>
-            <action class="org.onosproject.xosintegration.cli.VoltTenantsCreateCommand"/>
-            <completers>
-                <ref component-id="placeholderCompleter"/>
-                <ref component-id="placeholderCompleter"/>
-                <ref component-id="connectPointCompleter"/>
-                <null/>
-            </completers>
-        </command>
-        <command>
-            <action class="org.onosproject.xosintegration.cli.VoltRemoveTenantCommand"/>
-            <completers>
-                <ref component-id="tenantIdCompleter"/>
-                <null/>
-            </completers>
-        </command>
-    </command-bundle>
-    <bean id="tenantIdCompleter" class="org.onosproject.xosintegration.cli.TenantIdCompleter"/>
-    <bean id="placeholderCompleter" class="org.onosproject.cli.PlaceholderCompleter"/>
-    <bean id="connectPointCompleter" class="org.onosproject.cli.net.ConnectPointCompleter"/>
-</blueprint>
