Initial OR-TAPI mapping: Services
[transportpce.git] / tapi / src / main / java / org / opendaylight / transportpce / tapi / impl / TapiProvider.java
index e8c0bcadcd23155c0365da8c6f0c23ba2cfb0406..68c9f023699fce3c319a24dc0f03d475d3af1dec 100644 (file)
@@ -7,12 +7,15 @@
  */
 package org.opendaylight.transportpce.tapi.impl;
 
+import java.util.HashMap;
 import org.eclipse.jdt.annotation.NonNull;
 import org.opendaylight.mdsal.binding.api.DataBroker;
 import org.opendaylight.mdsal.binding.api.DataTreeIdentifier;
 import org.opendaylight.mdsal.binding.api.RpcProviderService;
 import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
 import org.opendaylight.transportpce.common.network.NetworkTransactionService;
+import org.opendaylight.transportpce.servicehandler.service.ServiceDataStoreOperations;
+import org.opendaylight.transportpce.tapi.connectivity.ConnectivityUtils;
 import org.opendaylight.transportpce.tapi.connectivity.TapiConnectivityImpl;
 import org.opendaylight.transportpce.tapi.topology.TapiTopologyImpl;
 import org.opendaylight.transportpce.tapi.topology.TopologyUtils;
@@ -42,15 +45,17 @@ public class TapiProvider {
     private final RpcProviderService rpcProviderService;
     private ObjectRegistration<TapiConnectivityService> rpcRegistration;
     private final OrgOpenroadmServiceService serviceHandler;
+    private final ServiceDataStoreOperations serviceDataStoreOperations;
     private final TapiListener tapiListener;
     private final NetworkTransactionService networkTransactionService;
 
     public TapiProvider(DataBroker dataBroker, RpcProviderService rpcProviderService,
-            OrgOpenroadmServiceService serviceHandler, TapiListener tapiListener,
-            NetworkTransactionService networkTransactionService) {
+            OrgOpenroadmServiceService serviceHandler, ServiceDataStoreOperations serviceDataStoreOperations,
+            TapiListener tapiListener, NetworkTransactionService networkTransactionService) {
         this.dataBroker = dataBroker;
         this.rpcProviderService = rpcProviderService;
         this.serviceHandler = serviceHandler;
+        this.serviceDataStoreOperations = serviceDataStoreOperations;
         this.tapiListener = tapiListener;
         this.networkTransactionService = networkTransactionService;
     }
@@ -64,8 +69,12 @@ public class TapiProvider {
         LOG.info("Empty TAPI context created: {}", tapiContext.getTapiContext());
 
         TopologyUtils topologyUtils = new TopologyUtils(this.networkTransactionService, this.dataBroker);
-        TapiInitialORMapping tapiInitialORMapping = new TapiInitialORMapping(topologyUtils, tapiContext);
+        ConnectivityUtils connectivityUtils = new ConnectivityUtils(this.serviceDataStoreOperations, new HashMap<>(),
+                tapiContext);
+        TapiInitialORMapping tapiInitialORMapping = new TapiInitialORMapping(topologyUtils, connectivityUtils,
+                tapiContext, this.serviceDataStoreOperations);
         tapiInitialORMapping.performTopoInitialMapping();
+        tapiInitialORMapping.performServInitialMapping();
 
         TapiConnectivityImpl tapi = new TapiConnectivityImpl(this.serviceHandler);
         TapiTopologyImpl topo = new TapiTopologyImpl(this.dataBroker, tapiContext, topologyUtils);