2 * Copyright (c) 2015 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
9 package org.opendaylight.netconf.topology.example;
11 import akka.actor.ActorSystem;
12 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
13 import org.opendaylight.controller.md.sal.common.api.clustering.EntityOwnershipService;
14 import org.opendaylight.netconf.topology.NodeManagerCallback;
15 import org.opendaylight.netconf.topology.NodeManagerCallback.NodeManagerCallbackFactory;
16 import org.opendaylight.netconf.topology.TopologyManagerCallback;
17 import org.opendaylight.netconf.topology.TopologyManagerCallback.TopologyManagerCallbackFactory;
18 import org.opendaylight.netconf.topology.util.BaseTopologyManager;
20 public class ExampleTopology {
22 private static final String TOPOLOGY_NETCONF = "topology-netconf";
23 private BaseTopologyManager netconfNodeBaseTopologyManager;
24 private final DataBroker dataBroker;
26 public ExampleTopology(final EntityOwnershipService entityOwnershipService, final DataBroker dataBroker) {
27 final ActorSystem actorSystem = ActorSystem.create("netconf-cluster");
29 this.dataBroker = dataBroker;
31 final NodeManagerCallbackFactory nodeManagerCallbackFactory = new NodeManagerCallbackFactory() {
33 public NodeManagerCallback create(String nodeId, String topologyId, ActorSystem actorSystem) {
34 return new ExampleNodeManagerCallback();
38 final TopologyManagerCallbackFactory topologyManagerCallbackFactory = new TopologyManagerCallbackFactory() {
40 public TopologyManagerCallback create(ActorSystem actorSystem, String topologyId) {
41 return new ExampleTopologyManagerCallback(actorSystem, dataBroker, topologyId, nodeManagerCallbackFactory);
45 // netconfNodeBaseTopologyManager = new BaseTopologyManager<>(dataBroker, TOPOLOGY_NETCONF,
46 // topologyManagerCallbackFactory,
47 // new SingleStateAggregator(),
48 // new SalNodeWriter(dataBroker, TOPOLOGY_NETCONF),
49 // new TopologyRoleChangeStrategy(dataBroker, entityOwnershipService, "netconf", TOPOLOGY_NETCONF));