ONOS-3124 Sketch of simplified intent domain service

Change-Id: I6d8304214897ba75a299bfd9bd90b4591ae8eb04
diff --git a/incubator/api/src/main/java/org/onosproject/incubator/net/domain/DomainEdge.java b/incubator/api/src/main/java/org/onosproject/incubator/net/domain/DomainEdge.java
deleted file mode 100644
index ad5e5d1..0000000
--- a/incubator/api/src/main/java/org/onosproject/incubator/net/domain/DomainEdge.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright 2015 Open Networking Laboratory
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.onosproject.incubator.net.domain;
-
-import com.google.common.annotations.Beta;
-import com.google.common.base.MoreObjects;
-import org.onlab.graph.AbstractEdge;
-import org.onosproject.net.ConnectPoint;
-
-import java.util.Objects;
-
-/**
- * Representation of a connection between an intent domain and a device. This
- * must happen using a connect point that is part of both the domain and the
- * device.
- */
-@Beta
-public class DomainEdge extends AbstractEdge<DomainVertex> {
-
-    ConnectPoint connectPoint;
-
-    public DomainEdge(DomainVertex src, DomainVertex dst, ConnectPoint connectPoint) {
-        super(src, dst);
-        this.connectPoint = connectPoint;
-    }
-
-    @Override
-    public int hashCode() {
-        return 43 * super.hashCode() + connectPoint.hashCode();
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj) {
-            return true;
-        }
-        if (obj instanceof DomainEdge) {
-            final DomainEdge other = (DomainEdge) obj;
-            return super.equals(other) &&
-                    Objects.equals(this.connectPoint, other.connectPoint);
-        }
-        return false;
-    }
-
-    @Override
-    public String toString() {
-        return MoreObjects.toStringHelper(this)
-                .add("src", src())
-                .add("dst", dst())
-                .add("connectPoint", connectPoint)
-                .toString();
-    }
-
-    /**
-     * Returns the connect point associated with the domain edge.
-     *
-     * @return this edges connect point
-     */
-    public ConnectPoint connectPoint() {
-        return connectPoint;
-    }
-}
diff --git a/incubator/api/src/main/java/org/onosproject/incubator/net/domain/DomainIntentResource.java b/incubator/api/src/main/java/org/onosproject/incubator/net/domain/DomainIntentResource.java
deleted file mode 100644
index ea1660e..0000000
--- a/incubator/api/src/main/java/org/onosproject/incubator/net/domain/DomainIntentResource.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Copyright 2015 Open Networking Laboratory
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.onosproject.incubator.net.domain;
-
-import org.onosproject.core.ApplicationId;
-import org.onosproject.incubator.net.tunnel.DomainTunnelId;
-import org.onosproject.net.ConnectPoint;
-import org.onosproject.net.Path;
-
-/**
- * A variant of intent resource specialized for use on the intra-domain level.  It contains a lower level path.
- */
-public class DomainIntentResource extends IntentResource {
-
-    private final Path domainPath;
-
-    private final DomainTunnelId domainTunnelId;
-
-    private final IntentDomainId intentDomainId;
-
-    /**
-     * Constructor for a domain intent resource.
-     *
-     * @param primitive      the primitive associated with this resource
-     * @param domainTunnelId the id of this tunnel (used as a sorting mechanism)
-     * @param domainId       the ID of the intent domain containing this tunnel
-     * @param appId          the id of the application which created this tunnel
-     * @param ingress        the fist connect point associated with this tunnel (order is irrelevant as long as it is
-     *                       consistent with the path)
-     * @param egress         the second connect point associated with this tunnel (order is irrelevant as long as it is
-     *                       consistent with the path)
-     * @param path           the path followed through the domain
-     */
-    public DomainIntentResource(IntentPrimitive primitive, DomainTunnelId domainTunnelId, IntentDomainId domainId,
-                                ApplicationId appId, ConnectPoint ingress, ConnectPoint egress, Path path) {
-        super(primitive, appId, ingress, egress);
-
-        this.domainPath = path;
-        this.domainTunnelId = domainTunnelId;
-        this.intentDomainId = domainId;
-    }
-
-    /**
-     * Returns the domain path associated with this resource at creation.
-     *
-     * @return this resource's domain level path or if this resource backs a network tunnel then null.
-     */
-    public Path path() {
-        return domainPath;
-    }
-
-    /**
-     * Returns the tunnel ID associated with this domain at creation.
-     *
-     * @return this resource's tunnel ID.
-     */
-    public DomainTunnelId tunnelId() {
-        return domainTunnelId;
-    }
-
-    /**
-     * Returns the domain ID associated with this resource at creation.
-     *
-     * @return this resource's domain ID.
-     */
-    public IntentDomainId domainId() {
-        return intentDomainId;
-    }
-
-}
diff --git a/incubator/api/src/main/java/org/onosproject/incubator/net/domain/DomainVertex.java b/incubator/api/src/main/java/org/onosproject/incubator/net/domain/DomainVertex.java
deleted file mode 100644
index 7d11a76..0000000
--- a/incubator/api/src/main/java/org/onosproject/incubator/net/domain/DomainVertex.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Copyright 2015 Open Networking Laboratory
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.onosproject.incubator.net.domain;
-
-import com.google.common.annotations.Beta;
-import com.google.common.base.MoreObjects;
-import org.onlab.graph.Vertex;
-import org.onosproject.net.DeviceId;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-/**
- * Representation of the intent domain or a device that is part of the intent
- * domain graph.
- */
-@Beta
-public class DomainVertex implements Vertex {
-    // FIXME we will want to add a type enum or subclasses for the two different types
-
-    // A domain vertex is either an intent domain or a device:
-    private final IntentDomainId domainId;
-    // ----- or -----
-
-    private final DeviceId deviceId;
-
-    // Serialization constructor
-    private DomainVertex() {
-        this.domainId = null;
-        this.deviceId = null;
-    }
-
-    public DomainVertex(IntentDomainId id) {
-        this.domainId = checkNotNull(id, "Intent domain ID cannot be null.");
-        this.deviceId = null;
-    }
-
-    public DomainVertex(DeviceId id) {
-        this.domainId = null;
-        this.deviceId = checkNotNull(id, "Device ID cannot be null.");
-    }
-
-    @Override
-    public String toString() {
-        if (domainId != null) {
-            return MoreObjects.toStringHelper(this)
-                    .add("domainId", domainId)
-                    .toString();
-        } else if (deviceId != null) {
-            return MoreObjects.toStringHelper(this)
-                    .add("deviceId", deviceId)
-                    .toString();
-        } else {
-            return MoreObjects.toStringHelper(this)
-                    .toString();
-        }
-    }
-
-    /**
-     * Returns the device ID of this vertex if it is a device, returns null if it is a domain.
-     *
-     * @return the device ID of this vertex if applicable, else null
-     */
-    public DeviceId deviceId() {
-        return deviceId;
-    }
-
-    /**
-     * Returns the domain ID of this vertex if it is a domain, returns null if it is a device.
-     *
-     * @return the domain ID of this vertex if applicable, else null
-     */
-    public IntentDomainId domainId() {
-        return domainId;
-    }
-}
diff --git a/incubator/api/src/main/java/org/onosproject/incubator/net/domain/IntentDomainAdminService.java b/incubator/api/src/main/java/org/onosproject/incubator/net/domain/IntentDomainAdminService.java
deleted file mode 100644
index f5ceaa9..0000000
--- a/incubator/api/src/main/java/org/onosproject/incubator/net/domain/IntentDomainAdminService.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright 2015 Open Networking Laboratory
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.onosproject.incubator.net.domain;
-
-import com.google.common.annotations.Beta;
-import org.onosproject.core.ApplicationId;
-
-/**
- * Administrative interface for the intent domain service.
- */
-@Beta
-public interface IntentDomainAdminService extends IntentDomainService {
-
-    /**
-     * Register an application that provides intent domain service.
-     *
-     * @param applicationId application id
-     * @param provider intent domain provider
-     */
-    void registerApplication(ApplicationId applicationId, IntentDomainProvider provider);
-
-    /**
-     * Unregisters an application that provides intent domain service.
-     *
-     * @param applicationId application id
-     */
-    void unregisterApplication(ApplicationId applicationId);
-
-    /* TODO we may be able to accomplish the following through network config:
-    void createDomain(String domainId);
-    void removeDomain(String domainId);
-
-    void addInternalDeviceToDomain(IntentDomain domain, DeviceId deviceId);
-    void addPortToDomain(IntentDomain domain, ConnectPoint port);
-
-    void bindApplicationToDomain(String domain, IntentDomain implementation);
-    void unbindApplicationToDomain(String domain, IntentDomain implementation);
-    */
-}
-
diff --git a/incubator/api/src/main/java/org/onosproject/incubator/net/domain/IntentDomainConfig.java b/incubator/api/src/main/java/org/onosproject/incubator/net/domain/IntentDomainConfig.java
deleted file mode 100644
index e903c32..0000000
--- a/incubator/api/src/main/java/org/onosproject/incubator/net/domain/IntentDomainConfig.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * Copyright 2015 Open Networking Laboratory
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.onosproject.incubator.net.domain;
-
-import com.google.common.annotations.Beta;
-import com.google.common.collect.ImmutableSet;
-import org.onosproject.net.config.Config;
-import org.onosproject.net.ConnectPoint;
-import org.onosproject.net.DeviceId;
-
-import java.util.Set;
-
-/**
- * Configuration for an intent domain including a name, set of internal devices,
- * set of edge ports, and the application bound to control the domain.
- */
-@Beta
-public class IntentDomainConfig extends Config<IntentDomainId> {
-
-    private static final String DOMAIN_NAME = "name";
-    private static final String APPLICATION_NAME = "applicationName";
-    private static final String INTERNAL_DEVICES = "internalDevices";
-    private static final String EDGE_PORTS = "edgePorts";
-
-
-    /**
-     * Returns the friendly name for the domain.
-     *
-     * @return domain name
-     */
-    public String domainName() {
-        return get(DOMAIN_NAME, subject.toString());
-    }
-
-    /**
-     * Sets the friendly name for the domain.
-     *
-     * @param domainName new name for the domain; null to clear
-     * @return self
-     */
-    public IntentDomainConfig domainName(String domainName) {
-        return (IntentDomainConfig) setOrClear(DOMAIN_NAME, domainName);
-    }
-
-    /**
-     * Returns the friendly name for the domain.
-     *
-     * @return domain name
-     */
-    public String applicationName() {
-        return get(APPLICATION_NAME, "FIXME"); //TODO maybe not null?
-    }
-
-    /**
-     * Sets the friendly name for the domain.
-     *
-     * @param applicationName new name for the domain; null to clear
-     * @return self
-     */
-    public IntentDomainConfig applicationName(String applicationName) {
-        return (IntentDomainConfig) setOrClear(APPLICATION_NAME, applicationName);
-    }
-
-    /**
-     * Returns the set of internal devices.
-     *
-     * @return set of internal devices
-     */
-    public Set<DeviceId> internalDevices() {
-        return ImmutableSet.copyOf(getList(INTERNAL_DEVICES, DeviceId::deviceId));
-    }
-
-    /**
-     * Sets the set of internal devices.
-     *
-     * @param devices set of devices; null to clear
-     * @return self
-     */
-    public IntentDomainConfig internalDevices(Set<DeviceId> devices) {
-        return (IntentDomainConfig) setOrClear(INTERNAL_DEVICES, devices);
-    }
-
-    /**
-     * Returns the set of edge ports.
-     *
-     * @return set of edge ports
-     */
-    public Set<ConnectPoint> edgePorts() {
-        return ImmutableSet.copyOf(getList(EDGE_PORTS, ConnectPoint::deviceConnectPoint));
-    }
-
-    /**
-     * Sets the set of edge ports.
-     *
-     * @param connectPoints set of edge ports; null to clear
-     * @return self
-     */
-    public IntentDomainConfig edgePorts(Set<ConnectPoint> connectPoints) {
-        return (IntentDomainConfig) setOrClear(EDGE_PORTS, connectPoints);
-    }
-
-}
diff --git a/incubator/api/src/main/java/org/onosproject/incubator/net/domain/IntentDomainEvent.java b/incubator/api/src/main/java/org/onosproject/incubator/net/domain/IntentDomainEvent.java
new file mode 100644
index 0000000..03f4eab
--- /dev/null
+++ b/incubator/api/src/main/java/org/onosproject/incubator/net/domain/IntentDomainEvent.java
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.incubator.net.domain;
+
+import org.onosproject.event.AbstractEvent;
+
+/**
+ * Describes an intent domain event.
+ */
+public class IntentDomainEvent
+        extends AbstractEvent<IntentDomainEvent.Type, IntentDomain> {
+
+    public enum Type {
+        DOMAIN_ADDED,
+        DOMAIN_MODIFIED,
+        DOMAIN_REMOVED
+    }
+
+    protected IntentDomainEvent(Type type, IntentDomain subject) {
+        super(type, subject);
+    }
+}
diff --git a/incubator/api/src/main/java/org/onosproject/incubator/net/domain/IntentDomainListener.java b/incubator/api/src/main/java/org/onosproject/incubator/net/domain/IntentDomainListener.java
index 04080b2..b9033f1 100644
--- a/incubator/api/src/main/java/org/onosproject/incubator/net/domain/IntentDomainListener.java
+++ b/incubator/api/src/main/java/org/onosproject/incubator/net/domain/IntentDomainListener.java
@@ -16,12 +16,12 @@
 package org.onosproject.incubator.net.domain;
 
 import com.google.common.annotations.Beta;
+import org.onosproject.event.EventListener;
 
 /**
  * Listener for intent domain events.
  */
 @Beta
-public interface IntentDomainListener {
-    //TODO create event types
-    //extends EventListener<IntentDomainEvent>
+public interface IntentDomainListener
+    extends EventListener<IntentDomainEvent> {
 }
\ No newline at end of file
diff --git a/incubator/api/src/main/java/org/onosproject/incubator/net/domain/IntentDomainProvider.java b/incubator/api/src/main/java/org/onosproject/incubator/net/domain/IntentDomainProvider.java
index a19add6..ebbddbc 100644
--- a/incubator/api/src/main/java/org/onosproject/incubator/net/domain/IntentDomainProvider.java
+++ b/incubator/api/src/main/java/org/onosproject/incubator/net/domain/IntentDomainProvider.java
@@ -16,6 +16,7 @@
 package org.onosproject.incubator.net.domain;
 
 import com.google.common.annotations.Beta;
+import org.onosproject.net.provider.Provider;
 
 import java.util.List;
 import java.util.Set;
@@ -24,7 +25,7 @@
  * FIXME.
  */
 @Beta
-public interface IntentDomainProvider {
+public interface IntentDomainProvider extends Provider {
 
     /**
      * Requests that the provider attempt to satisfy the intent primitive.
@@ -37,7 +38,7 @@
      * @return intent resources that specify paths that satisfy the request.
      */
     //TODO Consider an iterable and/or holds (only hold one or two reservation(s) at a time)
-    List<DomainIntentResource> request(IntentDomain domain, IntentPrimitive primitive);
+    List<IntentResource> request(IntentDomain domain, IntentPrimitive primitive);
 
     /**
      * Request that the provider attempt to modify an existing resource to satisfy
@@ -48,14 +49,14 @@
      * @param newResource the resource to be applied
      * @return request contexts that contain resources to satisfy the intent
      */
-    DomainIntentResource modify(DomainIntentResource oldResource, DomainIntentResource newResource);
+    IntentResource modify(IntentResource oldResource, IntentResource newResource);
 
     /**
      * Requests that the provider release an intent resource.
      *
      * @param resource intent resource
      */
-    void release(DomainIntentResource resource);
+    void release(IntentResource resource);
 
     /**
      * Requests that the provider apply the path from the intent resource.
@@ -63,7 +64,7 @@
      * @param domainIntentResource request context
      * @return intent resource that satisfies the intent
      */
-    DomainIntentResource apply(DomainIntentResource domainIntentResource);
+    IntentResource apply(IntentResource domainIntentResource);
 
     /**
      * Requests that the provider cancel the path. Requests that are not applied
@@ -71,14 +72,14 @@
      *
      * @param domainIntentResource the intent resource whose path should be cancelled.
      */
-    void cancel(DomainIntentResource domainIntentResource);
+    void cancel(IntentResource domainIntentResource);
 
     /**
      * Returns all intent resources held by the provider.
      *
      * @return set of intent resources
      */
-    Set<DomainIntentResource> getResources();
+    Set<IntentResource> getResources();
 }
 
 
diff --git a/incubator/api/src/main/java/org/onosproject/incubator/net/domain/IntentDomainProviderRegistry.java b/incubator/api/src/main/java/org/onosproject/incubator/net/domain/IntentDomainProviderRegistry.java
new file mode 100644
index 0000000..4efa924
--- /dev/null
+++ b/incubator/api/src/main/java/org/onosproject/incubator/net/domain/IntentDomainProviderRegistry.java
@@ -0,0 +1,25 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.incubator.net.domain;
+
+import org.onosproject.net.provider.ProviderRegistry;
+
+/**
+ * Abstraction of a intent domain provider registry.
+ */
+public interface IntentDomainProviderRegistry
+        extends ProviderRegistry<IntentDomainProvider, IntentDomainProviderService> {
+}
diff --git a/incubator/api/src/main/java/org/onosproject/incubator/net/domain/IntentDomainProviderService.java b/incubator/api/src/main/java/org/onosproject/incubator/net/domain/IntentDomainProviderService.java
new file mode 100644
index 0000000..c51d843
--- /dev/null
+++ b/incubator/api/src/main/java/org/onosproject/incubator/net/domain/IntentDomainProviderService.java
@@ -0,0 +1,26 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.incubator.net.domain;
+
+import org.onosproject.net.provider.ProviderService;
+
+/**
+ * Service through which intent domain providers can report intent domain updates.
+ */
+public interface IntentDomainProviderService
+        extends ProviderService<IntentDomainProvider> {
+
+}
diff --git a/incubator/api/src/main/java/org/onosproject/incubator/net/domain/IntentDomainService.java b/incubator/api/src/main/java/org/onosproject/incubator/net/domain/IntentDomainService.java
index 41508ad..330e0da 100644
--- a/incubator/api/src/main/java/org/onosproject/incubator/net/domain/IntentDomainService.java
+++ b/incubator/api/src/main/java/org/onosproject/incubator/net/domain/IntentDomainService.java
@@ -16,9 +16,10 @@
 package org.onosproject.incubator.net.domain;
 
 import com.google.common.annotations.Beta;
-import org.onlab.graph.Graph;
+import org.onosproject.event.ListenerService;
 import org.onosproject.net.DeviceId;
 
+import java.util.List;
 import java.util.Set;
 
 /**
@@ -26,7 +27,8 @@
  * domain providers.
  */
 @Beta
-public interface IntentDomainService {
+public interface IntentDomainService
+        extends ListenerService<IntentDomainEvent, IntentDomainListener> {
 
     /**
      * Returns the intent domain for the given id.
@@ -52,25 +54,21 @@
     Set<IntentDomain> getDomains(DeviceId deviceId);
 
     /**
-     * Returns the graph of intent domains and connection devices.
+     * Requests an intent primitive from the intent domain.
      *
-     * @return graph of network domains
+     * @param domainId id of target domain
+     * @param primitive intent primitive
+     * @return set of intent resources that satisfy the primitive
      */
-    Graph<DomainVertex, DomainEdge> getDomainGraph();
+    List<IntentResource> request(IntentDomainId domainId, IntentPrimitive primitive);
 
     /**
-     * Adds the specified listener for intent domain events.
+     * Submits an intent resource to the intent domain for installation.
      *
-     * @param listener listener to be added
+     * @param domainId id of target domain
+     * @param resource intent resource
      */
-    void addListener(IntentDomainListener listener);
-
-    /**
-     * Removes the specified listener for intent domain events.
-     *
-     * @param listener listener to be removed
-     */
-    void removeListener(IntentDomainListener listener);
+    void submit(IntentDomainId domainId, IntentResource resource);
 }
 
 
diff --git a/incubator/api/src/main/java/org/onosproject/incubator/net/domain/NetworkIntentResource.java b/incubator/api/src/main/java/org/onosproject/incubator/net/domain/NetworkIntentResource.java
deleted file mode 100644
index ac4445b..0000000
--- a/incubator/api/src/main/java/org/onosproject/incubator/net/domain/NetworkIntentResource.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright 2015 Open Networking Laboratory
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.onosproject.incubator.net.domain;
-
-import org.onosproject.core.ApplicationId;
-import org.onosproject.incubator.net.tunnel.NetworkTunnelId;
-import org.onosproject.net.ConnectPoint;
-
-/**
- * A variant of intent resource specialized for use on the inter-domain level.  It contains a higher level path.
- */
-public class NetworkIntentResource extends IntentResource {
-
-    private final org.onlab.graph.Path<DomainVertex, DomainEdge> netPath;
-
-    private NetworkTunnelId networkTunnelId;
-
-    /**
-     * Constructor for a network intent resource.
-     *
-     * @param primitive      the primitive associated with this resource
-     * @param networkTunnelId the id of this tunnel (used as a sorting mechanism)
-     * @param appId          the id of the application which created this tunnel
-     * @param ingress        the fist connect point associated with this tunnel (order is irrelevant as long as it is
-     *                       consistent with the path)
-     * @param egress         the second connect point associated with this tunnel (order is irrelevant as long as it is
-     *                       consistent with the path)
-     * @param path           the path followed through the graph of domain vertices and domain edges
-     */
-    public NetworkIntentResource(IntentPrimitive primitive, NetworkTunnelId networkTunnelId, ApplicationId appId,
-                                 ConnectPoint ingress, ConnectPoint egress,
-                                 org.onlab.graph.Path<DomainVertex, DomainEdge> path) {
-        super(primitive, appId, ingress, egress);
-
-        this.networkTunnelId = networkTunnelId;
-        this.netPath = path;
-    }
-
-    /**
-     * Returns the network path associated with this resource at creation.
-     *
-     * @return this resource's network lever path or if this resource backs a domain level tunnel then null.
-     */
-    public org.onlab.graph.Path<DomainVertex, DomainEdge> path() {
-        return netPath;
-    }
-
-    /**
-     * Returns ths network ID associated with this network tunnel at creation.
-     *
-     * @return thsi resource's tunnel ID.
-     */
-    public NetworkTunnelId tunnelId() {
-        return this.networkTunnelId;
-    }
-}