import org.opendaylight.transportpce.nbinotifications.impl.NbiNotificationsProvider;
import org.opendaylight.transportpce.networkmodel.NetConfTopologyListener;
import org.opendaylight.transportpce.networkmodel.NetworkModelProvider;
+import org.opendaylight.transportpce.networkmodel.NetworkUtilsImpl;
import org.opendaylight.transportpce.networkmodel.listeners.PortMappingListener;
import org.opendaylight.transportpce.networkmodel.service.FrequenciesServiceImpl;
import org.opendaylight.transportpce.networkmodel.service.NetworkModelService;
lgServRPS,
networkModelService, deviceTransactionManager, portMapping,
lgServNS,
- new FrequenciesServiceImpl(lgServBDB));
+ new FrequenciesServiceImpl(lgServBDB),
+ new NetworkUtilsImpl(lgServBDB));
LOG.info("Creating PCE beans ...");
// TODO: pass those parameters through command line
@Reference DeviceTransactionManager deviceTransactionManager,
@Reference PortMapping portMapping,
@Reference NotificationService notificationService,
- @Reference FrequenciesService frequenciesService) {
+ @Reference FrequenciesService frequenciesService,
+ @Reference TransportpceNetworkutilsService networkUtils) {
this.dataBroker = dataBroker;
this.rpcProviderService = rpcProviderService;
this.notificationService = notificationService;
this.frequenciesService = frequenciesService;
this.listeners = new ArrayList<>();
- this.networkutilsService = new NetworkUtilsImpl(dataBroker);
+ this.networkutilsService = networkUtils;
this.topologyListener = new NetConfTopologyListener(networkModelService, dataBroker, deviceTransactionManager,
portMapping);
this.tpceNetwork = new TpceNetwork(networkTransactionService);
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.opendaylight.yangtools.yang.common.RpcResult;
import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
+import org.osgi.service.component.annotations.Activate;
+import org.osgi.service.component.annotations.Component;
+import org.osgi.service.component.annotations.Reference;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+@Component
public class NetworkUtilsImpl implements TransportpceNetworkutilsService {
private static final Logger LOG = LoggerFactory.getLogger(NetworkUtilsImpl.class);
private final DataBroker dataBroker;
- public NetworkUtilsImpl(DataBroker dataBroker) {
+ @Activate
+ public NetworkUtilsImpl(@Reference DataBroker dataBroker) {
this.dataBroker = dataBroker;
+ LOG.info("NetworkUtilsImpl instanciated");
}
@Override
NotificationService notificationService;
@Mock
FrequenciesService frequenciesService;
-
+ @Mock
+ TransportpceNetworkutilsService networkUtils;
@Test
void networkmodelProviderInitTest() {
when(networkTransactionService.commit()).then(answer);
new NetworkModelProvider(networkTransactionService, dataBroker, rpcProviderService, networkModelService,
- deviceTransactionManager, portMapping, notificationService, frequenciesService);
+ deviceTransactionManager, portMapping, notificationService, frequenciesService, networkUtils);
verify(rpcProviderService, times(1))
.registerRpcImplementation(any(), any(TransportpceNetworkutilsService.class));