/*
- * Copyright © 2016 Orange and others. All rights reserved.
+ * Copyright © 2017 AT&T and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
*/
package org.opendaylight.transportpce.renderer;
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.binding.api.MountPointService;
-
-
+import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RpcRegistration;
+import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
+import org.opendaylight.transportpce.renderer.provisiondevice.RendererServiceOperations;
+import org.opendaylight.transportpce.renderer.rpcs.DeviceRendererRPCImpl;
+import org.opendaylight.transportpce.renderer.rpcs.TransportPCEServicePathRPCImpl;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev170426.TransportpceServicepathService;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.renderer.rev170228.RendererService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class RendererProvider {
private static final Logger LOG = LoggerFactory.getLogger(RendererProvider.class);
-
- private final DataBroker dataBroker;
-
- private final MountPointService mountPointService;
-
- public RendererProvider(final DataBroker dataBroker, final MountPointService mountPointService) {
- this.dataBroker = dataBroker;
- this.mountPointService = mountPointService;
+ private final RpcProviderRegistry rpcProviderRegistry;
+ private RpcRegistration<RendererService> deviceRendererRegistration;
+ private DeviceRendererRPCImpl deviceRendererRPCImpl;
+ private RpcRegistration<TransportpceServicepathService> tpceServiceRegistry;
+ private RendererServiceOperations rendererServiceOperations;
+
+ public RendererProvider(RpcProviderRegistry rpcProviderRegistry, DeviceRendererRPCImpl deviceRendererRPCImpl,
+ RendererServiceOperations rendererServiceOperations) {
+ this.rpcProviderRegistry = rpcProviderRegistry;
+ this.deviceRendererRPCImpl = deviceRendererRPCImpl;
+ this.rendererServiceOperations = rendererServiceOperations;
}
/**
*/
public void init() {
LOG.info("RendererProvider Session Initiated");
+ TransportPCEServicePathRPCImpl transportPCEServicePathRPCImpl =
+ new TransportPCEServicePathRPCImpl(this.rendererServiceOperations);
+ this.deviceRendererRegistration = this.rpcProviderRegistry
+ .addRpcImplementation(RendererService.class, this.deviceRendererRPCImpl);
+ this.tpceServiceRegistry = this.rpcProviderRegistry
+ .addRpcImplementation(TransportpceServicepathService.class, transportPCEServicePathRPCImpl);
}
/**
*/
public void close() {
LOG.info("RendererProvider Closed");
+ if (this.deviceRendererRegistration != null) {
+ this.deviceRendererRegistration.close();
+ }
+ if (this.tpceServiceRegistry != null) {
+ this.tpceServiceRegistry.close();
+ }
}
+
}