import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
+import org.opendaylight.mdsal.binding.api.DataBroker;
+import org.opendaylight.mdsal.binding.api.WriteTransaction;
+import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
import org.opendaylight.transportpce.common.NetworkUtils;
-import org.opendaylight.transportpce.common.device.DeviceTransactionManager;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev200113.network.nodes.NodeInfo;
import org.opendaylight.yang.gen.v1.http.org.openroadm.clli.network.rev181130.NetworkTypes1;
import org.opendaylight.yang.gen.v1.http.org.openroadm.clli.network.rev181130.NetworkTypes1Builder;
import org.opendaylight.yang.gen.v1.http.org.openroadm.clli.network.rev181130.Node1;
new NetworkKey(new NetworkId(NetworkUtils.CLLI_NETWORK_ID)));
WriteTransaction wrtx = controllerdb.newWriteOnlyTransaction();
wrtx.put(LogicalDatastoreType.CONFIGURATION, nwIID.build(), clliNetwork);
- wrtx.submit().get(1, TimeUnit.SECONDS);
+ wrtx.commit().get(1, TimeUnit.SECONDS);
LOG.info("CLLI-Network created successfully.");
} catch (ExecutionException | TimeoutException | InterruptedException e) {
LOG.warn("Failed to create CLLI-Network", e);
/**
* Create single node entry for CLLI topology.
*
- * @param deviceTransactionManager device transation manager
* @param deviceId device ID
+ * @param nodeInfo Some important and general data from device
*
* @return node builder status
*/
- public static Node createNode(DeviceTransactionManager deviceTransactionManager, String deviceId,
- String openRoadmVersion) {
- //Read clli from the device
- InfoSubtree infoSubtree = new InfoSubtree(openRoadmVersion);
- String clli;
-
- if (infoSubtree.getDeviceInfo(deviceId,deviceTransactionManager)) {
-
- clli = infoSubtree.getClli();
- } else {
- LOG.info("Unable for get Info subtree from the device");
- return null;
- }
-
+ public static Node createNode(String deviceId, NodeInfo nodeInfo) {
+ String clli = nodeInfo.getNodeClli();
/*
* Create node in the CLLI layer of the network model
* with nodeId equal to the clli attribute in the device