2 * Copyright (c) 2013 Cisco Systems, 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.bgpcep.pcep.topology.provider;
10 import io.netty.channel.ChannelFuture;
12 import java.net.InetSocketAddress;
14 import org.opendaylight.bgpcep.programming.spi.InstructionScheduler;
15 import org.opendaylight.controller.sal.binding.api.data.DataProviderService;
16 import org.opendaylight.protocol.pcep.PCEPDispatcher;
17 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.Topology;
18 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
20 import com.google.common.base.Preconditions;
22 public final class PCEPTopologyProvider {
23 private final PCEPDispatcher dispatcher;
24 private final TopologyProgramming topology;
25 private final ServerSessionManager manager;
26 private final TopologyRPCs element;
28 public PCEPTopologyProvider(final PCEPDispatcher dispatcher,
29 final InstructionScheduler scheduler,
30 final DataProviderService dataService,
31 final InstanceIdentifier<Topology> topology) {
32 this.dispatcher = Preconditions.checkNotNull(dispatcher);
35 this.manager = new ServerSessionManager(dataService, topology);
36 this.element = new TopologyRPCs(manager);
37 this.topology = new TopologyProgramming(scheduler, manager);
40 public ChannelFuture startServer(final InetSocketAddress address) {
41 return dispatcher.createServer(address, manager);