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.NetworkModelListenerImpl;
18 import org.opendaylight.transportpce.servicehandler.listeners.PceListenerImpl;
19 import org.opendaylight.transportpce.servicehandler.listeners.RendererListenerImpl;
20 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev190531.ServiceCreateInput;
21 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev190531.ServiceCreateOutput;
22 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev190531.ServiceDeleteInput;
23 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev190531.ServiceDeleteOutput;
24 import org.opendaylight.yangtools.yang.common.RpcResult;
25 import org.slf4j.Logger;
26 import org.slf4j.LoggerFactory;
28 public class ServiceHandlerOperationsImpl implements ServiceHandlerOperations {
30 private static final Logger LOG = LoggerFactory.getLogger(ServiceHandlerOperationsImpl.class);
32 private ServicehandlerImpl serviceHandler;
34 public ServiceHandlerOperationsImpl(DataBroker databroker, PathComputationService pathComputationService,
35 RendererServiceOperations rendererServiceOperations, NotificationPublishService notificationPublishService,
36 PceListenerImpl pceListenerImpl, RendererListenerImpl rendererListenerImpl,
37 NetworkModelListenerImpl networkModelListenerImpl, ServiceDataStoreOperations serviceDataStoreOperations) {
38 this.serviceHandler = new ServicehandlerImpl(databroker, pathComputationService, rendererServiceOperations,
39 notificationPublishService, pceListenerImpl, rendererListenerImpl, networkModelListenerImpl,
40 serviceDataStoreOperations);
44 public ServiceCreateOutput serviceCreate(ServiceCreateInput input) {
45 ListenableFuture<RpcResult<ServiceCreateOutput>> output = this.serviceHandler.serviceCreate(input);
46 ServiceCreateOutput outputresult = null;
48 outputresult = output.get().getResult();
49 } catch (InterruptedException | ExecutionException e) {
50 LOG.error("Rpc service create failed", e);
56 public ServiceDeleteOutput serviceDelete(ServiceDeleteInput input) {
61 LOG.info("init ServiceHandlerOperationsImpl...");
65 LOG.info("close ServiceHandlerOperationsImpl...");