2 * Copyright © 2018 Orange, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.transportpce.servicehandler.service;
10 import com.google.common.util.concurrent.ListenableFuture;
12 import java.util.concurrent.ExecutionException;
14 import org.opendaylight.mdsal.binding.api.DataBroker;
15 import org.opendaylight.mdsal.binding.api.NotificationPublishService;
16 import org.opendaylight.transportpce.pce.service.PathComputationService;
17 import org.opendaylight.transportpce.renderer.NetworkModelWavelengthService;
18 import org.opendaylight.transportpce.renderer.provisiondevice.RendererServiceOperations;
19 import org.opendaylight.transportpce.servicehandler.impl.ServicehandlerImpl;
20 import org.opendaylight.transportpce.servicehandler.listeners.PceListenerImpl;
21 import org.opendaylight.transportpce.servicehandler.listeners.RendererListenerImpl;
22 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev190531.ServiceCreateInput;
23 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev190531.ServiceCreateOutput;
24 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev190531.ServiceDeleteInput;
25 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev190531.ServiceDeleteOutput;
26 import org.opendaylight.yangtools.yang.common.RpcResult;
27 import org.slf4j.Logger;
28 import org.slf4j.LoggerFactory;
30 public class ServiceHandlerOperationsImpl implements ServiceHandlerOperations {
32 private static final Logger LOG = LoggerFactory.getLogger(ServiceHandlerOperationsImpl.class);
34 private ServicehandlerImpl serviceHandler;
36 public ServiceHandlerOperationsImpl(DataBroker databroker, PathComputationService pathComputationService,
37 RendererServiceOperations rendererServiceOperations, NotificationPublishService notificationPublishService,
38 PceListenerImpl pceListenerImpl, RendererListenerImpl rendererListenerImpl,
39 NetworkModelWavelengthService networkModelWavelengthService) {
40 this.serviceHandler = new ServicehandlerImpl(databroker, pathComputationService, rendererServiceOperations,
41 notificationPublishService, pceListenerImpl, rendererListenerImpl,networkModelWavelengthService);
45 public ServiceCreateOutput serviceCreate(ServiceCreateInput input) {
46 ListenableFuture<RpcResult<ServiceCreateOutput>> output = this.serviceHandler.serviceCreate(input);
47 ServiceCreateOutput outputresult = null;
49 outputresult = output.get().getResult();
50 } catch (InterruptedException | ExecutionException e) {
51 LOG.error("Rpc service create failed", e);
57 public ServiceDeleteOutput serviceDelete(ServiceDeleteInput input) {
62 LOG.info("init ServiceHandlerOperationsImpl...");
66 LOG.info("close ServiceHandlerOperationsImpl...");