Add device config change request using NetCfg

Change-Id: I01ae9caf298e606333ea31b2b480d744a2815c76
diff --git a/apps/odtn/api/src/main/java/org/onosproject/odtn/utils/tapi/DcsBasedTapiNepRef.java b/apps/odtn/api/src/main/java/org/onosproject/odtn/utils/tapi/DcsBasedTapiNepRef.java
deleted file mode 100644
index e5fcf2d..0000000
--- a/apps/odtn/api/src/main/java/org/onosproject/odtn/utils/tapi/DcsBasedTapiNepRef.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright 2018-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.odtn.utils.tapi;
-
-import org.onosproject.yang.gen.v1.tapitopology.rev20180307.tapitopology.node.OwnedNodeEdgePoint;
-import org.onosproject.yang.gen.v1.tapitopology.rev20180307.tapitopology.topology.Node;
-import org.onosproject.yang.gen.v1.tapitopology.rev20180307.tapitopology.topologycontext.Topology;
-
-/**
- * TAPI Nep reference class which has a factory method using DCS modelObject.
- */
-public final class DcsBasedTapiNepRef extends TapiNepRef {
-
-    private DcsBasedTapiNepRef(Topology topology, Node node, OwnedNodeEdgePoint nep) {
-        super(topology.uuid().toString(), node.uuid().toString(), nep.uuid().toString());
-    }
-
-    public static DcsBasedTapiNepRef create(Topology topology, Node node, OwnedNodeEdgePoint nep) {
-        return new DcsBasedTapiNepRef(topology, node, nep);
-    }
-
-}
diff --git a/apps/odtn/api/src/main/java/org/onosproject/odtn/utils/tapi/DcsBasedTapiNodeRef.java b/apps/odtn/api/src/main/java/org/onosproject/odtn/utils/tapi/DcsBasedTapiNodeRef.java
deleted file mode 100644
index b6260a7..0000000
--- a/apps/odtn/api/src/main/java/org/onosproject/odtn/utils/tapi/DcsBasedTapiNodeRef.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright 2018-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.odtn.utils.tapi;
-
-import org.onosproject.yang.gen.v1.tapitopology.rev20180307.tapitopology.topology.Node;
-import org.onosproject.yang.gen.v1.tapitopology.rev20180307.tapitopology.topologycontext.Topology;
-
-/**
- * TAPI Node reference class which has a factory method using DCS modelObject.
- */
-public final class DcsBasedTapiNodeRef extends TapiNodeRef {
-
-    private DcsBasedTapiNodeRef(Topology topology, Node node) {
-        super(topology.uuid().toString(), node.uuid().toString());
-    }
-
-    public static DcsBasedTapiNodeRef create(Topology topology, Node node) {
-        return new DcsBasedTapiNodeRef(topology, node);
-    }
-}
diff --git a/apps/odtn/api/src/main/java/org/onosproject/odtn/utils/tapi/DcsBasedTapiObjectRefFactory.java b/apps/odtn/api/src/main/java/org/onosproject/odtn/utils/tapi/DcsBasedTapiObjectRefFactory.java
new file mode 100644
index 0000000..e1d1889
--- /dev/null
+++ b/apps/odtn/api/src/main/java/org/onosproject/odtn/utils/tapi/DcsBasedTapiObjectRefFactory.java
@@ -0,0 +1,66 @@
+/*
+ * Copyright 2018-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.odtn.utils.tapi;
+
+import org.onosproject.yang.gen.v1.tapiconnectivity.rev20180307.tapiconnectivity.connection.ConnectionEndPoint;
+import org.onosproject.yang.gen.v1.tapitopology.rev20180307.tapitopology.node.OwnedNodeEdgePoint;
+import org.onosproject.yang.gen.v1.tapitopology.rev20180307.tapitopology.topology.Node;
+import org.onosproject.yang.gen.v1.tapitopology.rev20180307.tapitopology.topologycontext.Topology;
+
+/**
+ * Util class to create TapiXXXRef class instances using classes auto-generated by onos-yang-tool compiler.
+ */
+public final class DcsBasedTapiObjectRefFactory {
+
+    private DcsBasedTapiObjectRefFactory() {
+    }
+
+    /**
+     * Factory method to create {@link TapiNodeRef}.
+     *
+     * @param topology ModelObject context/topology
+     * @param node     ModelObject context/topology/node
+     * @return node reference instance
+     */
+    public static TapiNodeRef create(Topology topology, Node node) {
+        return TapiNodeRef.create(topology.uuid().toString(), node.uuid().toString());
+    }
+
+    /**
+     * Factory method to create {@link TapiNepRef}.
+     *
+     * @param topology ModelObject context/topology
+     * @param node     ModelObject context/topology/node
+     * @param nep      ModelObject context/topology/node/ownedNodeEdgePoint
+     * @return nep reference instance
+     */
+    public static TapiNepRef create(Topology topology, Node node, OwnedNodeEdgePoint nep) {
+        return TapiNepRef.create(topology.uuid().toString(), node.uuid().toString(), nep.uuid().toString());
+    }
+
+    /**
+     * Factory method to create {@link TapiCepRef}.
+     *
+     * @param cep ModelObject context/connection/connectionEndPoint
+     * @return cep reference instance
+     */
+    public static TapiCepRef create(ConnectionEndPoint cep) {
+        return TapiCepRef.create(cep.topologyId().toString(), cep.nodeId().toString(),
+                cep.ownedNodeEdgePointId().toString(), cep.connectionEndPointId().toString());
+    }
+
+}
diff --git a/apps/odtn/api/src/main/java/org/onosproject/odtn/utils/tapi/TapiConnectionHandler.java b/apps/odtn/api/src/main/java/org/onosproject/odtn/utils/tapi/TapiConnectionHandler.java
index b3d6f3e..6e3b729 100644
--- a/apps/odtn/api/src/main/java/org/onosproject/odtn/utils/tapi/TapiConnectionHandler.java
+++ b/apps/odtn/api/src/main/java/org/onosproject/odtn/utils/tapi/TapiConnectionHandler.java
@@ -100,6 +100,10 @@
         return this;
     }
 
+    public List<ConnectionEndPoint> getCeps() {
+        return obj.connectionEndPoint();
+    }
+
     public List<TapiConnectionHandler> getLowerConnections() {
 
         try {
diff --git a/apps/odtn/api/src/main/java/org/onosproject/odtn/utils/tapi/TapiNepRef.java b/apps/odtn/api/src/main/java/org/onosproject/odtn/utils/tapi/TapiNepRef.java
index af4d299..95b3e05 100644
--- a/apps/odtn/api/src/main/java/org/onosproject/odtn/utils/tapi/TapiNepRef.java
+++ b/apps/odtn/api/src/main/java/org/onosproject/odtn/utils/tapi/TapiNepRef.java
@@ -42,7 +42,7 @@
  * TAPI reference class should be used in ODTN ServiceApplication
  * in order to make independent ServiceApplication implementation from DCS.
  */
-public class TapiNepRef {
+public final class TapiNepRef {
 
     protected final Logger log = getLogger(getClass());
 
diff --git a/apps/odtn/api/src/main/java/org/onosproject/odtn/utils/tapi/TapiNodeRef.java b/apps/odtn/api/src/main/java/org/onosproject/odtn/utils/tapi/TapiNodeRef.java
index 8db2005..71cd256 100644
--- a/apps/odtn/api/src/main/java/org/onosproject/odtn/utils/tapi/TapiNodeRef.java
+++ b/apps/odtn/api/src/main/java/org/onosproject/odtn/utils/tapi/TapiNodeRef.java
@@ -34,7 +34,7 @@
  * TAPI reference class should be used in ODTN ServiceApplication
  * in order to make independent ServiceApplication implementation from DCS.
  */
-public class TapiNodeRef {
+public final class TapiNodeRef {
 
     protected final Logger log = getLogger(getClass());
 
@@ -42,7 +42,7 @@
     private final UUID nodeId;
     private DeviceId deviceId;
 
-    TapiNodeRef(String topologyId, String nodeId) {
+    private TapiNodeRef(String topologyId, String nodeId) {
         this.topologyId = UUID.fromString(topologyId);
         this.nodeId = UUID.fromString(nodeId);
     }