2 * Copyright © 2019 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.tapi.topology;
10 import com.google.common.collect.ImmutableClassToInstanceMap;
11 import org.opendaylight.transportpce.common.network.NetworkTransactionService;
12 import org.opendaylight.transportpce.tapi.impl.rpc.GetLinkDetailsImpl;
13 import org.opendaylight.transportpce.tapi.impl.rpc.GetNodeDetailsImpl;
14 import org.opendaylight.transportpce.tapi.impl.rpc.GetNodeEdgePointDetailsImpl;
15 import org.opendaylight.transportpce.tapi.impl.rpc.GetServiceInterfacePointDetailsImpl;
16 import org.opendaylight.transportpce.tapi.impl.rpc.GetServiceInterfacePointListImpl;
17 import org.opendaylight.transportpce.tapi.impl.rpc.GetTopologyDetailsImpl;
18 import org.opendaylight.transportpce.tapi.impl.rpc.GetTopologyListImpl;
19 import org.opendaylight.transportpce.tapi.utils.TapiContext;
20 import org.opendaylight.transportpce.tapi.utils.TapiLink;
21 import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.common.rev221121.GetServiceInterfacePointDetails;
22 import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.common.rev221121.GetServiceInterfacePointList;
23 import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev221121.GetLinkDetails;
24 import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev221121.GetNodeDetails;
25 import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev221121.GetNodeEdgePointDetails;
26 import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev221121.GetTopologyDetails;
27 import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev221121.GetTopologyList;
28 import org.opendaylight.yangtools.yang.binding.Rpc;
30 public class TapiTopologyImpl {
32 private final NetworkTransactionService networkTransactionService;
33 private final TapiContext tapiContext;
34 private final TopologyUtils topologyUtils;
35 private final TapiLink tapiLink;
37 public TapiTopologyImpl(NetworkTransactionService networkTransactionService, TapiContext tapiContext,
38 TopologyUtils topologyUtils, TapiLink tapiLink) {
39 this.networkTransactionService = networkTransactionService;
40 this.tapiContext = tapiContext;
41 this.topologyUtils = topologyUtils;
42 this.tapiLink = tapiLink;
46 public ImmutableClassToInstanceMap<Rpc<?, ?>> registerRPCs() {
47 return ImmutableClassToInstanceMap.<Rpc<?, ?>>builder()
48 .put(GetNodeDetails.class, new GetNodeDetailsImpl(tapiContext))
49 .put(GetTopologyDetails.class, new GetTopologyDetailsImpl(tapiContext, topologyUtils, tapiLink,
50 networkTransactionService))
51 .put(GetNodeEdgePointDetails.class, new GetNodeEdgePointDetailsImpl(tapiContext))
52 .put(GetLinkDetails.class, new GetLinkDetailsImpl(tapiContext))
53 .put(GetTopologyList.class, new GetTopologyListImpl(tapiContext))
54 .put(GetServiceInterfacePointDetails.class, new GetServiceInterfacePointDetailsImpl(tapiContext))
55 .put(GetServiceInterfacePointList.class, new GetServiceInterfacePointListImpl(tapiContext))