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;
11 import java.util.concurrent.ExecutionException;
12 import org.opendaylight.mdsal.binding.api.DataBroker;
13 import org.opendaylight.mdsal.binding.api.NotificationPublishService;
14 import org.opendaylight.transportpce.pce.service.PathComputationService;
15 import org.opendaylight.transportpce.renderer.provisiondevice.RendererServiceOperations;
16 import org.opendaylight.transportpce.servicehandler.impl.ServicehandlerImpl;
17 import org.opendaylight.transportpce.servicehandler.listeners.PceListenerImpl;
18 import org.opendaylight.transportpce.servicehandler.listeners.RendererListenerImpl;
19 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev190531.ServiceCreateInput;
20 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev190531.ServiceCreateOutput;
21 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev190531.ServiceDeleteInput;
22 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev190531.ServiceDeleteOutput;
23 import org.opendaylight.yangtools.yang.common.RpcResult;
24 import org.slf4j.Logger;
25 import org.slf4j.LoggerFactory;
27 public class ServiceHandlerOperationsImpl implements ServiceHandlerOperations {
29 private static final Logger LOG = LoggerFactory.getLogger(ServiceHandlerOperationsImpl.class);
31 private ServicehandlerImpl serviceHandler;
33 public ServiceHandlerOperationsImpl(DataBroker databroker, PathComputationService pathComputationService,
34 RendererServiceOperations rendererServiceOperations, NotificationPublishService notificationPublishService,
35 PceListenerImpl pceListenerImpl, RendererListenerImpl rendererListenerImpl) {
36 this.serviceHandler = new ServicehandlerImpl(databroker, pathComputationService, rendererServiceOperations,
37 notificationPublishService, pceListenerImpl, rendererListenerImpl);
41 public ServiceCreateOutput serviceCreate(ServiceCreateInput input) {
42 ListenableFuture<RpcResult<ServiceCreateOutput>> output = this.serviceHandler.serviceCreate(input);
43 ServiceCreateOutput outputresult = null;
45 outputresult = output.get().getResult();
46 } catch (InterruptedException | ExecutionException e) {
47 LOG.error("Rpc service create failed", e);
53 public ServiceDeleteOutput serviceDelete(ServiceDeleteInput input) {
58 LOG.info("init ServiceHandlerOperationsImpl...");
62 LOG.info("close ServiceHandlerOperationsImpl...");