- add T-API provider to lighty.
- add Lighty support to tapi221 functional test
JIRA: TRNSPRTPCE-237
Change-Id: I9d3520ad89c2d94535b213aee92f1fb414609226
<artifactId>transportpce-networkmodel</artifactId>
<version>${transportpce.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.opendaylight.transportpce</groupId>
+ <artifactId>transportpce-tapimodels</artifactId>
+ <version>${transportpce.version}</version>
+ </dependency>
<!-- TPCE Models - END -->
<!-- TPCE bundles - BEGIN -->
<artifactId>transportpce-servicehandler</artifactId>
<version>${transportpce.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.opendaylight.transportpce</groupId>
+ <artifactId>transportpce-tapi</artifactId>
+ <version>${transportpce.version}</version>
+ </dependency>
<!-- TPCE bundles - END -->
<dependency>
package io.lighty.controllers.tpce.module;
-import io.lighty.core.controller.api.AbstractLightyModule;
-import io.lighty.core.controller.api.LightyServices;
import org.opendaylight.transportpce.common.crossconnect.CrossConnectImpl;
import org.opendaylight.transportpce.common.crossconnect.CrossConnectImpl121;
import org.opendaylight.transportpce.common.crossconnect.CrossConnectImpl221;
import org.opendaylight.transportpce.networkmodel.NetworkUtilsImpl;
import org.opendaylight.transportpce.networkmodel.R2RLinkDiscovery;
import org.opendaylight.transportpce.networkmodel.service.NetworkModelServiceImpl;
-// OpenRoadmFctory and OpenRoadmTopology22 has been deleted
-import org.opendaylight.transportpce.networkmodel.util.OpenRoadmTopology;
-
import org.opendaylight.transportpce.olm.OlmPowerServiceRpcImpl;
import org.opendaylight.transportpce.olm.OlmProvider;
import org.opendaylight.transportpce.olm.power.PowerMgmt;
import org.opendaylight.transportpce.renderer.RendererProvider;
import org.opendaylight.transportpce.renderer.openroadminterface.OpenRoadmInterface121;
import org.opendaylight.transportpce.renderer.openroadminterface.OpenRoadmInterface221;
+import org.opendaylight.transportpce.renderer.openroadminterface.OpenRoadmInterfaceFactory;
// Adding OTN interface
import org.opendaylight.transportpce.renderer.openroadminterface.OpenRoadmOtnInterface221;
-
-import org.opendaylight.transportpce.renderer.openroadminterface.OpenRoadmInterfaceFactory;
import org.opendaylight.transportpce.renderer.provisiondevice.DeviceRendererServiceImpl;
// Add OTN
import org.opendaylight.transportpce.renderer.provisiondevice.OtnDeviceRendererServiceImpl;
-
import org.opendaylight.transportpce.renderer.provisiondevice.RendererServiceOperationsImpl;
import org.opendaylight.transportpce.renderer.rpcs.DeviceRendererRPCImpl;
-
import org.opendaylight.transportpce.servicehandler.impl.ServicehandlerProvider;
+import org.opendaylight.transportpce.servicehandler.listeners.PceListenerImpl;
+import org.opendaylight.transportpce.servicehandler.listeners.RendererListenerImpl;
+import org.opendaylight.transportpce.servicehandler.service.ServiceDataStoreOperations;
+import org.opendaylight.transportpce.servicehandler.service.ServiceDataStoreOperationsImpl;
+import org.opendaylight.transportpce.servicehandler.service.ServiceHandlerOperations;
+import org.opendaylight.transportpce.servicehandler.service.ServiceHandlerOperationsImpl;
+import org.opendaylight.transportpce.tapi.impl.TapiProvider;
+import org.opendaylight.transportpce.tapi.utils.TapiListener;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import io.lighty.core.controller.api.AbstractLightyModule;
+import io.lighty.core.controller.api.LightyServices;
+
public class TransportPCEImpl extends AbstractLightyModule implements TransportPCE {
private static final Logger LOG = LoggerFactory.getLogger(TransportPCEImpl.class);
private final NetworkModelWavelengthServiceImpl networkModelWavelengthService;
private final RendererServiceOperationsImpl rendererServiceOperations;
private final RendererProvider rendererProvider;
+ private final TapiProvider tapiProvider;
// service-handler beans
private final ServicehandlerProvider servicehandlerProvider;
LOG.info("Creating service-handler beans ...");
servicehandlerProvider = new ServicehandlerProvider(lightyServices.getBindingDataBroker(), lightyServices.getRpcProviderService(), lightyServices.getNotificationService(),
pathComputationService, rendererServiceOperations, networkModelWavelengthService, lightyServices.getBindingNotificationPublishService());
+ tapiProvider = initTapi(lightyServices);
}
rendererProvider.init();
LOG.info("Initializing service-handler beans ...");
servicehandlerProvider.init();
+ LOG.info("Initializing tapi beans ...");
+ tapiProvider.init();
LOG.info("Init done.");
return true;
}
@Override
protected boolean stopProcedure() {
+ tapiProvider.close();
LOG.info("Shutting down service-handler beans ...");
servicehandlerProvider.close();
LOG.info("Shutting down renderer beans ...");
return true;
}
+ /**
+ * Init tapi provider beans
+ * @param lightyServices
+ * @return TapiProvider
+ */
+ private TapiProvider initTapi(LightyServices lightyServices) {
+ RendererListenerImpl rendererListenerImpl = new RendererListenerImpl(
+ pathComputationService,
+ lightyServices.getBindingNotificationPublishService());
+ ServiceDataStoreOperations serviceDataStoreOperations = new ServiceDataStoreOperationsImpl(
+ lightyServices.getBindingDataBroker());
+ PceListenerImpl pceListenerImpl = new PceListenerImpl(
+ rendererServiceOperations,
+ pathComputationService,
+ lightyServices.getBindingNotificationPublishService(),
+ serviceDataStoreOperations ) ;
+ ServiceHandlerOperations serviceHandlerOperations = new ServiceHandlerOperationsImpl(
+ lightyServices.getBindingDataBroker(),
+ pathComputationService,
+ rendererServiceOperations,
+ lightyServices.getBindingNotificationPublishService(),
+ pceListenerImpl,
+ rendererListenerImpl,
+ networkModelWavelengthService);
+ return new TapiProvider(
+ lightyServices.getBindingDataBroker(),
+ lightyServices.getRpcProviderService(),
+ serviceHandlerOperations,
+ new TapiListener());
+ }
+
}
org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev190531.$YangModuleInfoImpl.getInstance(),
org.opendaylight.yang.gen.v1.http.org.openroadm.topology.rev190531.$YangModuleInfoImpl.getInstance(),
+ //tapi models
+ org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.oam.rev181210.$YangModuleInfoImpl.getInstance(),
+ org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.common.rev181210.$YangModuleInfoImpl.getInstance(),
+ org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.odu.rev181210.$YangModuleInfoImpl.getInstance(),
+ org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.dsr.rev181210.$YangModuleInfoImpl.getInstance(),
+ org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.photonic.media.rev181210.$YangModuleInfoImpl.getInstance(),
+ org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.connectivity.rev181210.$YangModuleInfoImpl.getInstance(),
+ org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.path.computation.rev181210.$YangModuleInfoImpl.getInstance(),
+ org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.$YangModuleInfoImpl.getInstance(),
+ org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.eth.rev181210.$YangModuleInfoImpl.getInstance(),
+
// API models / opendaylight
org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.alarmsuppression.rev171102.$YangModuleInfoImpl.getInstance(),
org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.networkutils.rev170818.$YangModuleInfoImpl.getInstance(),
org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.monitoring.extension.rev131210.$YangModuleInfoImpl.getInstance(),
org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.monitoring.rev101004.$YangModuleInfoImpl.getInstance(),
org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.notifications.rev120206.$YangModuleInfoImpl.getInstance(),
- org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.restconf.rev131019.$YangModuleInfoImpl.getInstance()
+ org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.restconf.rev131019.$YangModuleInfoImpl.getInstance(),
+ org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.tapi.rev180928.$YangModuleInfoImpl.getInstance()
);
public static final Set<YangModuleInfo> yangModels = Stream.concat(
# START_IGNORE_XTESTING
@classmethod
- @unittest.skipIf("USE_LIGHTY" in os.environ and os.environ['USE_LIGHTY'] == 'True',
- "not supported for lighty")
def setUpClass(cls):
cls.init_failed = False
- karaf_log = os.path.join(
- os.path.dirname(os.path.realpath(__file__)),
- "..", "..", "..", "karaf", "target", "assembly", "data", "log", "karaf.log")
- searched_expr = re.escape("Blueprint container for bundle "
- "org.opendaylight.netconf.restconf") + ".* was successfully created"
print("starting opendaylight...")
cls.odl_process = test_utils.start_tpce()
- found = test_utils.wait_until_log_contains(karaf_log, searched_expr, time_to_wait=60)
- cls.init_failed = not found
- if not cls.init_failed:
- print("opendaylight started")
-
- print("installing tapi feature...")
- result = test_utils.install_karaf_feature("odl-transportpce-tapi")
- if result.returncode != 0:
- cls.init_failed = True
- print("Restarting opendaylight...")
- test_utils.shutdown_process(cls.odl_process)
- cls.odl_process = test_utils.start_tpce()
+ if "USE_LIGHTY" not in os.environ or os.environ['USE_LIGHTY'] != 'True':
+ karaf_log = os.path.join(
+ os.path.dirname(os.path.realpath(__file__)),
+ "..", "..", "..", "karaf", "target", "assembly", "data", "log", "karaf.log")
+ searched_expr = re.escape("Blueprint container for bundle "
+ "org.opendaylight.netconf.restconf") + ".* was successfully created"
found = test_utils.wait_until_log_contains(karaf_log, searched_expr, time_to_wait=60)
cls.init_failed = not found
if not cls.init_failed:
- print("starting XPDRA...")
- cls.honeynode_process1 = test_utils.start_xpdra_honeynode()
+ print("opendaylight started")
+ print("installing tapi feature...")
+ result = test_utils.install_karaf_feature("odl-transportpce-tapi")
+ if result.returncode != 0:
+ cls.init_failed = True
+ print("Restarting opendaylight...")
+ test_utils.shutdown_process(cls.odl_process)
+ cls.odl_process = test_utils.start_tpce()
+ found = test_utils.wait_until_log_contains(karaf_log, searched_expr, time_to_wait=60)
+ cls.init_failed = not found
+ if not cls.init_failed:
+ print("starting XPDRA...")
+ cls.honeynode_process1 = test_utils.start_xpdra_honeynode()
- print("starting ROADMA...")
- cls.honeynode_process2 = test_utils.start_roadma_honeynode()
+ print("starting ROADMA...")
+ cls.honeynode_process2 = test_utils.start_roadma_honeynode()
- print("starting ROADMC...")
- cls.honeynode_process3 = test_utils.start_roadmc_honeynode()
+ print("starting ROADMC...")
+ cls.honeynode_process3 = test_utils.start_roadmc_honeynode()
- print("starting XPDRC...")
- cls.honeynode_process4 = test_utils.start_xpdrc_honeynode()
+ print("starting XPDRC...")
+ cls.honeynode_process4 = test_utils.start_xpdrc_honeynode()
- print("starting SPDRA...")
- cls.honeynode_process5 = test_utils.start_spdra_honeynode()
- print("all honeynodes started")
+ print("starting SPDRA...")
+ cls.honeynode_process5 = test_utils.start_spdra_honeynode()
+ print("all honeynodes started")
@classmethod
def tearDownClass(cls):