import org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
+import org.opendaylight.unimgr.mef.nrp.api.TopologyManager;
import org.opendaylight.unimgr.mef.nrp.cisco.xr.common.helper.InterfaceHelper;
import org.opendaylight.unimgr.mef.nrp.common.NrpDao;
import org.opendaylight.unimgr.mef.nrp.common.TapiUtils;
new TopologyKey(new TopologyId(TopologyNetconf.QNAME.getLocalName())));
+ private final TopologyManager topologyManager;
+
LoadingCache<NodeKey, KeyedInstanceIdentifier<Node, NodeKey>> mountIds = CacheBuilder.newBuilder()
.maximumSize(20)
.build(
private CapabilitiesService capabilitiesService;
- public TopologyDataHandler(DataBroker dataBroker, MountPointService mountService) {
+ public TopologyDataHandler(TopologyManager topologyManager, DataBroker dataBroker, MountPointService mountService) {
+ this.topologyManager = topologyManager;
Objects.requireNonNull(dataBroker);
Objects.requireNonNull(mountService);
this.dataBroker = dataBroker;
ReadWriteTransaction tx = dataBroker.newReadWriteTransaction();
NrpDao dao = new NrpDao(tx);
- dao.createSystemNode(DriverConstants.XR_NODE, null);
+ dao.createNode(topologyManager.getSystemTopologyId(), DriverConstants.XR_NODE, ETH.class, null);
Futures.addCallback(tx.submit(), new FutureCallback<Void>() {
@Override
return Stream.empty();
}
-
}
<reference id="dataBroker" interface="org.opendaylight.controller.md.sal.binding.api.DataBroker" />
<reference id="mountPointService" interface="org.opendaylight.controller.md.sal.binding.api.MountPointService" />
+ <reference id="topologyManager" interface="org.opendaylight.unimgr.mef.nrp.api.TopologyManager" />
<service id="xrDriverService" interface="org.opendaylight.unimgr.mef.nrp.api.ActivationDriverBuilder">
<bean class="org.opendaylight.unimgr.mef.nrp.cisco.xr.l2vpn.driver.XrDriverBuilder">
<bean id="topologyHandler" class="org.opendaylight.unimgr.mef.nrp.cisco.xr.TopologyDataHandler" init-method="init" destroy-method="close">
<argument ref="dataBroker" />
<argument ref="mountPointService" />
+ <argument ref="topologyManager" />
</bean>
</blueprint>
--- /dev/null
+/*
+ * Copyright (c) 2017 Cisco Systems Inc and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.unimgr.mef.nrp.api;
+
+/**
+ * @author bartosz.michalik@amartus.com
+ */
+public interface TopologyManager {
+ String getSystemTopologyId();
+}
this.tx = null;
}
- public Node createSystemNode(String nodeId, List<OwnedNodeEdgePoint> neps) {
-
- return createSystemNode(nodeId, ETH.class, neps);
- }
-
-
- public Node createSystemNode(String nodeId, Class<? extends LayerProtocolName> name, List<OwnedNodeEdgePoint> neps) {
+ public Node createNode(String topologyId, String nodeId, Class<? extends LayerProtocolName> name, List<OwnedNodeEdgePoint> neps) {
verifyTx();
Uuid uuid = new Uuid(nodeId);
return topology.orNull();
}
+ public Node getNode(String uuidTopo, String uuidNode) throws ReadFailedException {
+ Optional<Node> topology = rtx.read(LogicalDatastoreType.OPERATIONAL, node(new Uuid(uuidTopo), new Uuid(uuidNode))).checkedGet();
+ return topology.orNull();
+ }
+
public static InstanceIdentifier<Context> ctx() {
return InstanceIdentifier.create(Context.class);
}
public static InstanceIdentifier<Topology> topo(String topoId) {
+ return topo(new Uuid(topoId));
+ }
+
+ public static InstanceIdentifier<Topology> topo(Uuid topoId) {
return ctx()
.augmentation(Context1.class)
- .child(Topology.class, new TopologyKey(new Uuid(topoId)));
+ .child(Topology.class, new TopologyKey(topoId));
}
public static InstanceIdentifier<Node> node(String nodeId) {
return node(new Uuid(nodeId));
}
+ public static InstanceIdentifier<Node> node(Uuid topologyId, Uuid nodeId) {
+ return topo(topologyId).child(Node.class, new NodeKey(nodeId));
+ }
+
public static InstanceIdentifier<Node> node(Uuid nodeId) {
- return topo(TapiConstants.PRESTO_SYSTEM_TOPO).child(Node.class, new NodeKey(nodeId));
+ return node(new Uuid(TapiConstants.PRESTO_SYSTEM_TOPO), nodeId);
}
public static InstanceIdentifier<Node> abstractNode() {
package org.opendaylight.unimgr.mef.nrp.impl;
-import static org.opendaylight.unimgr.mef.nrp.api.TapiConstants.PRESTO_CTX;
-import static org.opendaylight.unimgr.mef.nrp.api.TapiConstants.PRESTO_EXT_TOPO;
-import static org.opendaylight.unimgr.mef.nrp.api.TapiConstants.PRESTO_SYSTEM_TOPO;
-
-import java.util.Arrays;
-import java.util.Collections;
-
+import com.google.common.base.Optional;
+import com.google.common.util.concurrent.CheckedFuture;
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
+import org.opendaylight.unimgr.mef.nrp.api.TapiConstants;
+import org.opendaylight.unimgr.mef.nrp.api.TopologyManager;
import org.opendaylight.unimgr.mef.nrp.common.TapiUtils;
import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.tapi.common.rev171113.Context;
import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.tapi.common.rev171113.ContextBuilder;
import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.tapi.topology.rev171113.node.TransferTimingBuilder;
import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.tapi.topology.rev171113.topology.Node;
import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.tapi.topology.rev171113.topology.NodeBuilder;
-import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.tapi.topology.rev171113.topology.NodeKey;
import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.tapi.topology.rev171113.topology.context.Topology;
import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.tapi.topology.rev171113.topology.context.TopologyBuilder;
import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.tapi.topology.rev171113.topology.context.TopologyKey;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import com.google.common.base.Optional;
-import com.google.common.util.concurrent.CheckedFuture;
+import java.util.Arrays;
+import java.util.Collections;
+
+import static org.opendaylight.unimgr.mef.nrp.api.TapiConstants.*;
/**
* @author bartosz.michalik@amartus.com
*/
-public class NrpInitializer {
+public class NrpInitializer implements TopologyManager {
private static final Logger LOG = LoggerFactory.getLogger(NrpInitializer.class);
private final DataBroker dataBroker;
public void close() {
}
+
+ @Override
+ public String getSystemTopologyId() {
+ return TapiConstants.PRESTO_SYSTEM_TOPO;
+ }
}
private DataBroker broker;
private ConnectivityServiceIdResourcePool serviceIdPool;
- private ExecutorService executor = new ThreadPoolExecutor(4, 16,
- 30, TimeUnit.MINUTES,
- new LinkedBlockingQueue<>());
+ private ExecutorService executor = null;
final static InstanceIdentifier<Context1> connectivityCtx = NrpDao.ctx().augmentation(Context1.class);
Objects.requireNonNull(validator);
Objects.requireNonNull(broker);
Objects.requireNonNull(serviceIdPool);
+ if(executor == null) {
+ executor = new ThreadPoolExecutor(4, 16,
+ 30, TimeUnit.MINUTES,
+ new LinkedBlockingQueue<>());
+ }
LOG.info("TapiConnectivityService initialized");
}
+ @Override
+ public void close() throws Exception {
+ executor.shutdown();
+ }
+
@Override
public Future<RpcResult<CreateConnectivityServiceOutput>> createConnectivityService(CreateConnectivityServiceInput input) {
return executor.submit(new CreateConnectivityAction(this, input));
return executor.submit(new ListConnectivityAction(this));
}
- @Override
- public void close() throws Exception {
- executor.shutdown();
- }
-
public void setValidator(RequestValidator validator) {
this.validator = validator;
}
public void setExecutor(ExecutorService executor) {
+ if(executor != null) throw new IllegalStateException();
this.executor = executor;
}
--- /dev/null
+/*
+ * Copyright (c) 2018 Cisco Systems Inc and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.unimgr.mef.nrp.impl.topologytervice;
+
+import com.google.common.base.Optional;
+import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+import org.opendaylight.controller.md.sal.binding.api.ReadOnlyTransaction;
+import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
+import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
+import org.opendaylight.unimgr.mef.nrp.common.NrpDao;
+import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.tapi.common.rev171113.Uuid;
+import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.tapi.topology.rev171113.*;
+import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.tapi.topology.rev171113.get.link.details.output.LinkBuilder;
+import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.tapi.topology.rev171113.get.node.details.output.NodeBuilder;
+import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.tapi.topology.rev171113.get.topology.details.output.TopologyBuilder;
+import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.tapi.topology.rev171113.topology.Link;
+import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.tapi.topology.rev171113.topology.LinkKey;
+import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.tapi.topology.rev171113.topology.Node;
+import org.opendaylight.yangtools.yang.binding.KeyedInstanceIdentifier;
+import org.opendaylight.yangtools.yang.common.RpcError;
+import org.opendaylight.yangtools.yang.common.RpcResult;
+import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.List;
+import java.util.Objects;
+import java.util.concurrent.*;
+import java.util.stream.Collectors;
+
+/**
+ * @author bartosz.michalik@amartus.com
+ */
+public class TapiTopologyServiceImpl implements TapiTopologyService, AutoCloseable {
+ private static final Logger LOG = LoggerFactory.getLogger(TapiTopologyServiceImpl.class);
+ private DataBroker broker;
+
+
+ // TODO decide on strategy for executor service
+ private ExecutorService executor = null;
+
+ public void init() {
+ Objects.requireNonNull(broker);
+ if(executor == null) {
+ executor = new ThreadPoolExecutor(4, 16,
+ 30, TimeUnit.MINUTES,
+ new LinkedBlockingQueue<>());
+ }
+ LOG.info("TapiTopologyService initialized");
+ }
+
+ @Override
+ public void close() throws Exception {
+ if(!executor.isTerminated()) {
+ executor.shutdownNow();
+ }
+ }
+
+ public void setExecutor(ExecutorService executor) {
+ if(executor != null) throw new IllegalStateException();
+ this.executor = executor;
+ }
+
+ @Override
+ public Future<RpcResult<GetNodeDetailsOutput>> getNodeDetails(GetNodeDetailsInput input) {
+ return executor.submit(() -> {
+ NrpDao nrpDao = new NrpDao(broker.newReadOnlyTransaction());
+
+ Node node = nrpDao.getNode(input.getTopologyIdOrName(), input.getNodeIdOrName());
+ if(node == null) return RpcResultBuilder.<GetNodeDetailsOutput>failed().withError(RpcError.ErrorType.APPLICATION,
+ String.format("No node for id: %s in topology %s", input.getNodeIdOrName(), input.getTopologyIdOrName())).build();
+
+ GetNodeDetailsOutput output = new GetNodeDetailsOutputBuilder().setNode(new NodeBuilder(node).build()).build();
+ return RpcResultBuilder.success(output).build();
+ });
+ }
+
+ @Override
+ public Future<RpcResult<GetNodeEdgePointDetailsOutput>> getNodeEdgePointDetails(GetNodeEdgePointDetailsInput input) {
+ return null; //TODO not implemented
+ }
+
+ @Override
+ public Future<RpcResult<GetLinkDetailsOutput>> getLinkDetails(GetLinkDetailsInput input) {
+ return executor.submit(() -> {
+ RpcResult<GetLinkDetailsOutput> out = RpcResultBuilder.<GetLinkDetailsOutput>failed().withError(RpcError.ErrorType.APPLICATION, "No link in topology").build();
+ try {
+ ReadOnlyTransaction rtx = broker.newReadOnlyTransaction();
+ KeyedInstanceIdentifier<Link, LinkKey> linkId = NrpDao.topo(input.getTopologyIdOrName()).child(Link.class, new LinkKey(new Uuid(input.getLinkIdOrName())));
+ Optional<Link> optional = rtx.read(LogicalDatastoreType.OPERATIONAL, linkId).checkedGet();
+ if(optional.isPresent()) {
+ out = RpcResultBuilder
+ .success(new GetLinkDetailsOutputBuilder()
+ .setLink(new LinkBuilder(optional.get()).build()).build())
+ .build();
+ }
+ } catch(ReadFailedException e) {
+ out = RpcResultBuilder.<GetLinkDetailsOutput>failed().withError(RpcError.ErrorType.APPLICATION, String.format("Cannot read link %s",input.getLinkIdOrName()) ,e).build();
+ }
+ return out;
+ });
+ }
+
+ private RpcResult<GetTopologyListOutput> getTopologies() {
+ ReadOnlyTransaction rtx = broker.newReadOnlyTransaction();
+ RpcResult<GetTopologyListOutput> out = RpcResultBuilder.success(new GetTopologyListOutputBuilder().build()).build();
+ try {
+ List<? extends Topology> topologies;
+ Optional<Context1> ctx = rtx.read(LogicalDatastoreType.OPERATIONAL, NrpDao.ctx()
+ .augmentation(Context1.class)).checkedGet();
+ if(ctx.isPresent()) {
+ topologies = ctx.get().getTopology();
+
+ out = RpcResultBuilder.success(
+ new GetTopologyListOutputBuilder()
+ .setTopology(topologies.stream().map(t -> new org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.tapi.topology.rev171113.get.topology.list.output.TopologyBuilder(t).build()).collect(Collectors.toList()))
+ ).build();
+ }
+ } catch (ReadFailedException e) {
+ out = RpcResultBuilder.<GetTopologyListOutput>failed().withError(RpcError.ErrorType.APPLICATION, "Cannot read topologies" ,e).build();
+ }
+ return out;
+ }
+
+ @Override
+ public Future<RpcResult<GetTopologyListOutput>> getTopologyList() {
+ return executor.submit(this::getTopologies);
+ }
+
+ @Override
+ public Future<RpcResult<GetTopologyDetailsOutput>> getTopologyDetails(GetTopologyDetailsInput input) {
+ return executor.submit(() -> {
+ NrpDao nrpDao = new NrpDao(broker.newReadOnlyTransaction());
+ org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.tapi.topology.rev171113.topology.context.Topology topo = nrpDao.getTopology(input.getTopologyIdOrName());
+
+ if(topo == null) return RpcResultBuilder.<GetTopologyDetailsOutput>failed().withError(RpcError.ErrorType.APPLICATION, String.format("No topology for id: %s", input.getTopologyIdOrName())).build();
+
+ GetTopologyDetailsOutput result = new GetTopologyDetailsOutputBuilder()
+ .setTopology(new TopologyBuilder(topo).build())
+ .build();
+ return RpcResultBuilder.success(result).build();
+ });
+ }
+
+ public void setBroker(DataBroker broker) {
+ this.broker = broker;
+ }
+}
</bean>
<service id="unimgrProviderService" interface="org.opendaylight.unimgr.api.IUnimgrConsoleProvider" ref="unimgrProvider" odl:type="default" />
+ <service interface="org.opendaylight.unimgr.mef.nrp.api.TopologyManager" ref="topologyService" odl:type="default" />
<bean id="activationDriverRepo" class="org.opendaylight.unimgr.mef.nrp.impl.ActivationDriverRepoServiceImpl">
<argument ref="driverBuilders" />
</bean>
- <bean id="topologyService" class="org.opendaylight.unimgr.mef.nrp.impl.NrpInitializer" init-method="init" destroy-method="close">
+ <bean id="topologyService" class="org.opendaylight.unimgr.mef.nrp.impl.NrpInitializer" init-method="init" destroy-method="close"
+ activation="eager">
<argument index="0" ref="dataBroker" />
</bean>
</property>
</bean>
+ <bean id="tapiTopologyService" class="org.opendaylight.unimgr.mef.nrp.impl.topologytervice.TapiTopologyServiceImpl" init-method="init">
+ <property name="broker" ref="dataBroker" />
+ </bean>
+
<bean id="basicDecomposer" class="org.opendaylight.unimgr.mef.nrp.impl.decomposer.BasicDecomposer">
<argument ref="dataBroker" />
</bean>
<odl:rpc-implementation ref="tapiConnectivityService" interface="org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.tapi.connectivity.rev171113.TapiConnectivityService" />
+ <odl:rpc-implementation ref="tapiTopologyService" interface="org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.tapi.topology.rev171113.TapiTopologyService" />
<reference id="dataBroker" interface="org.opendaylight.controller.md.sal.binding.api.DataBroker"/>
<reference-list id="driverBuilders" interface="org.opendaylight.unimgr.mef.nrp.api.ActivationDriverBuilder" availability="optional">
import org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
+import org.opendaylight.unimgr.mef.nrp.api.TapiConstants;
import org.opendaylight.unimgr.mef.nrp.common.NrpDao;
import org.opendaylight.unimgr.mef.nrp.common.TapiUtils;
import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.tapi.common.rev171113.Context;
private BiConsumer<NrpDao,String> removeNep = (dao, nepId) -> dao.removeNep(testSystemNodeName,nepId,false);
private BiConsumer<NrpDao,String> removeNode = (dao, nepId) -> dao.removeNode(testSystemNodeName,false);
- private BiConsumer<NrpDao,String> addNode = (dao, nepId) -> dao.createSystemNode(testSystemNodeName,createTestOwnedNodeEdgePointList());
+ private BiConsumer<NrpDao,String> addNode = (dao, nepId) -> dao.createNode(TapiConstants.PRESTO_SYSTEM_TOPO, testSystemNodeName, ETH.class,createTestOwnedNodeEdgePointList());
private BiConsumer<NrpDao,OwnedNodeEdgePoint> update = (dao, nep) -> dao.updateNep(testSystemNodeName,nep);
private <T extends Object> CheckedFuture<Void, TransactionCommitFailedException> performNrpDaoAction(BiConsumer<NrpDao,T> action, T attr) {
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
import org.opendaylight.unimgr.mef.nrp.api.EndPoint;
import org.opendaylight.unimgr.mef.nrp.api.TapiConstants;
+import org.opendaylight.unimgr.mef.nrp.api.TopologyManager;
import org.opendaylight.unimgr.mef.nrp.common.NrpDao;
import org.opendaylight.unimgr.mef.nrp.common.TapiUtils;
import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.tapi.common.rev171113.*;
import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.tapi.topology.rev171113.Context1;
import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.tapi.topology.rev171113.link.*;
import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.tapi.topology.rev171113.node.OwnedNodeEdgePointBuilder;
-import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.tapi.topology.rev171113.node.edge.point.LayerProtocolBuilder;
import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.tapi.topology.rev171113.risk.parameter.pac.RiskCharacteristicBuilder;
import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.tapi.topology.rev171113.topology.*;
import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.tapi.topology.rev171113.topology.context.*;
protected DataBroker dataBroker;
+ protected NrpInitializer topologyManager;
+
@Before
public void setupBroker() throws Exception {
dataBroker = getDataBroker();
- new NrpInitializer(dataBroker).init();
+ topologyManager = new NrpInitializer(dataBroker);
+ topologyManager.init();
}
protected EndPoint ep(String nepId) {
return new EndPoint(ep, null);
}
- protected void l(ReadWriteTransaction tx, String nA, String nepA, String nB, String nepB, OperationalState state) {
- l(tx, nA, nepA, nB, nepB, state, ForwardingDirection.BIDIRECTIONAL);
+ protected Link l(ReadWriteTransaction tx, String nA, String nepA, String nB, String nepB, OperationalState state) {
+ return l(tx, nA, nepA, nB, nepB, state, ForwardingDirection.BIDIRECTIONAL);
}
- protected void l(ReadWriteTransaction tx, String nA, String nepA, String nB, String nepB, OperationalState state, ForwardingDirection dir) {
+ protected Link l(ReadWriteTransaction tx, String nA, String nepA, String nB, String nepB, OperationalState state, ForwardingDirection dir) {
Uuid uuid = new Uuid(nepA + "-" + nepB);
NrpDao dao = new NrpDao(tx);
.build();
tx.put(LogicalDatastoreType.OPERATIONAL, NrpDao.topo(PRESTO_SYSTEM_TOPO).child(Link.class, new LinkKey(uuid)), link);
+ return link;
}
private LpTransition emptyLpTransition() {
.forEach(nrpDao::addSip);
}
- return nrpDao.createSystemNode(node, eps.stream()
+ return nrpDao.createNode(TapiConstants.PRESTO_SYSTEM_TOPO, node, ETH.class, eps.stream()
.map(e-> {
OwnedNodeEdgePointBuilder builder = new OwnedNodeEdgePointBuilder()
.setLinkPortDirection(e.getDir())
protected Node getAbstractNode() {
try(ReadOnlyTransaction tx = dataBroker.newReadOnlyTransaction()) {
- Optional<Node> opt = tx.read(LogicalDatastoreType.OPERATIONAL,NRP_ABSTRACT_NODE_IID).checkedGet();
+ Optional<Node> opt =
+ tx.read(LogicalDatastoreType.OPERATIONAL,NRP_ABSTRACT_NODE_IID).checkedGet();
if (opt.isPresent()) {
return opt.get();
} else {
import org.opendaylight.unimgr.mef.nrp.impl.ConnectivityServiceIdResourcePool;
import org.opendaylight.unimgr.mef.nrp.impl.decomposer.BasicDecomposer;
import org.opendaylight.unimgr.utils.ActivationDriverMocks;
+import org.opendaylight.yang.gen.v1.urn.mef.yang.mef.common.types.rev171221.PositiveInteger;
+import org.opendaylight.yang.gen.v1.urn.mef.yang.nrm.connectivity.rev171221.carrier.eth.connectivity.end.point.resource.CeVlanIdListAndUntag;
+import org.opendaylight.yang.gen.v1.urn.mef.yang.nrm.connectivity.rev171221.carrier.eth.connectivity.end.point.resource.CeVlanIdListAndUntagBuilder;
+import org.opendaylight.yang.gen.v1.urn.mef.yang.nrm.connectivity.rev171221.vlan.id.list.and.untag.VlanIdBuilder;
+import org.opendaylight.yang.gen.v1.urn.mef.yang.nrp._interface.rev171221.EndPoint2;
+import org.opendaylight.yang.gen.v1.urn.mef.yang.nrp._interface.rev171221.EndPoint2Builder;
+import org.opendaylight.yang.gen.v1.urn.mef.yang.nrp._interface.rev171221.NrpConnectivityServiceEndPointAttrs;
+import org.opendaylight.yang.gen.v1.urn.mef.yang.nrp._interface.rev171221.nrp.connectivity.service.end.point.attrs.NrpCarrierEthConnectivityEndPointResource;
+import org.opendaylight.yang.gen.v1.urn.mef.yang.nrp._interface.rev171221.nrp.connectivity.service.end.point.attrs.NrpCarrierEthConnectivityEndPointResourceBuilder;
import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.tapi.common.rev171113.PortDirection;
import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.tapi.common.rev171113.PortRole;
import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.tapi.common.rev171113.Uuid;
verifyZeroInteractions(ad2);
ReadOnlyTransaction tx2 = dataBroker.newReadOnlyTransaction();
+
Context1 connCtx = tx2.read(LogicalDatastoreType.OPERATIONAL, TapiConnectivityServiceImpl.connectivityCtx).checkedGet().get();
assertEquals(2, connCtx.getConnection().size());
connCtx.getConnection().forEach(this::verifyConnection);
}
private List<EndPoint> eps(String ... uuids) {
+
+ EndPoint2Builder builder = new EndPoint2Builder();
+ EndPoint2 epAugmentation = builder.setNrpCarrierEthConnectivityEndPointResource(new NrpCarrierEthConnectivityEndPointResourceBuilder()
+ .setCeVlanIdListAndUntag(new CeVlanIdListAndUntagBuilder()
+ .setVlanId(Collections.singletonList(
+ new VlanIdBuilder().setVlanId(new PositiveInteger(100L)).build()))
+ .build()
+
+ ).build()
+ ).build();
+
+
return Arrays.stream(uuids).map(uuid -> new EndPointBuilder()
.setLocalId("e:" + uuid)
.setRole(PortRole.SYMMETRIC)
.setDirection(PortDirection.BIDIRECTIONAL)
.setServiceInterfacePoint(new Uuid("sip:" + uuid))
+ .addAugmentation(EndPoint2.class, epAugmentation)
.build()).collect(Collectors.toList());
}
--- /dev/null
+/*
+ * Copyright (c) 2018 Cisco Systems Inc and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.unimgr.mef.nrp.impl.topologyservice;
+
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+import org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction;
+import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
+import org.opendaylight.unimgr.mef.nrp.api.TapiConstants;
+import org.opendaylight.unimgr.mef.nrp.impl.AbstractTestWithTopo;
+import org.opendaylight.unimgr.mef.nrp.impl.topologytervice.TapiTopologyServiceImpl;
+import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.tapi.common.rev171113.OperationalState;
+import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.tapi.topology.rev171113.*;
+import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.tapi.topology.rev171113.get.link.details.output.Link;
+import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.tapi.topology.rev171113.get.topology.list.output.Topology;
+import org.opendaylight.yangtools.yang.common.RpcResult;
+
+import java.util.List;
+import java.util.Set;
+import java.util.concurrent.ExecutionException;
+import java.util.stream.Collectors;
+
+/**
+ * @author bartosz.michalik@amartus.com
+ */
+public class TapiTopologyServiceImplIntTest extends AbstractTestWithTopo {
+
+ private String uuid1 = "uuid1";
+ private String uuid2 = "uuid2";
+
+ private TapiTopologyServiceImpl tapiTopologyService;
+
+ @Before
+ public void setUp() throws Exception {
+ tapiTopologyService = new TapiTopologyServiceImpl();
+ tapiTopologyService.setBroker(dataBroker);
+ tapiTopologyService.init();
+ }
+
+ @Test
+ public void getTopologies() throws TransactionCommitFailedException, ExecutionException, InterruptedException {
+ ReadWriteTransaction tx = dataBroker.newReadWriteTransaction();
+ n(tx, uuid1, uuid1 + ":1", uuid1 + ":2", uuid1 + ":3");
+ tx.submit().checkedGet();
+
+ RpcResult<GetTopologyListOutput> output = tapiTopologyService.getTopologyList().get();
+
+ Assert.assertTrue(output.isSuccessful());
+
+ List<Topology> topologies = output.getResult().getTopology();
+
+ Assert.assertEquals(2, topologies.size());
+
+ }
+
+ @Test
+ public void getTopologyUnknown() throws TransactionCommitFailedException, ExecutionException, InterruptedException {
+ ReadWriteTransaction tx = dataBroker.newReadWriteTransaction();
+ n(tx, uuid1, uuid1 + ":1", uuid1 + ":2", uuid1 + ":3");
+ tx.submit().checkedGet();
+
+ RpcResult<GetTopologyDetailsOutput> output = tapiTopologyService
+ .getTopologyDetails(new GetTopologyDetailsInputBuilder().setTopologyIdOrName("unknown").build()).get();
+
+ Assert.assertFalse(output.isSuccessful());
+
+ }
+
+
+ @Test
+ public void getTopologySystem() throws TransactionCommitFailedException, ExecutionException, InterruptedException {
+ ReadWriteTransaction tx = dataBroker.newReadWriteTransaction();
+ n(tx, uuid1, uuid1 + ":1", uuid1 + ":2", uuid1 + ":3");
+ tx.submit().checkedGet();
+
+ RpcResult<GetTopologyDetailsOutput> output = tapiTopologyService
+ .getTopologyDetails(new GetTopologyDetailsInputBuilder().setTopologyIdOrName(TapiConstants.PRESTO_SYSTEM_TOPO).build()).get();
+
+ Assert.assertTrue(output.isSuccessful());
+
+ Assert.assertEquals(TapiConstants.PRESTO_SYSTEM_TOPO, output.getResult().getTopology().getUuid().getValue());
+
+ }
+
+
+ @Test
+ public void getTopologyNode() throws TransactionCommitFailedException, ExecutionException, InterruptedException {
+ ReadWriteTransaction tx = dataBroker.newReadWriteTransaction();
+ n(tx, uuid1, uuid1 + ":1", uuid1 + ":2", uuid1 + ":3");
+ tx.submit().checkedGet();
+
+ RpcResult<GetNodeDetailsOutput> output = tapiTopologyService
+ .getNodeDetails(new GetNodeDetailsInputBuilder()
+ .setNodeIdOrName(uuid1)
+ .setTopologyIdOrName(TapiConstants.PRESTO_SYSTEM_TOPO).build())
+ .get();
+
+ Assert.assertTrue(output.isSuccessful());
+
+ Assert.assertEquals(uuid1, output.getResult().getNode().getUuid().getValue());
+
+ }
+
+ @Test
+ public void getTopologyNodeWrongTopology() throws TransactionCommitFailedException, ExecutionException, InterruptedException {
+ ReadWriteTransaction tx = dataBroker.newReadWriteTransaction();
+ n(tx, uuid1, uuid1 + ":1", uuid1 + ":2", uuid1 + ":3");
+ tx.submit().checkedGet();
+
+ RpcResult<GetNodeDetailsOutput> output = tapiTopologyService
+ .getNodeDetails(new GetNodeDetailsInputBuilder()
+ .setNodeIdOrName(uuid1)
+ .setTopologyIdOrName("some_topo").build())
+ .get();
+
+ Assert.assertFalse(output.isSuccessful());
+ }
+
+
+ @Test
+ public void getLinkNotFound() throws TransactionCommitFailedException, ExecutionException, InterruptedException {
+ ReadWriteTransaction tx = dataBroker.newReadWriteTransaction();
+ n(tx, uuid1, uuid1 + ":1", uuid1 + ":2", uuid1 + ":3");
+ tx.submit().checkedGet();
+
+ RpcResult<GetLinkDetailsOutput> output = tapiTopologyService
+ .getLinkDetails(new GetLinkDetailsInputBuilder()
+ .setLinkIdOrName("any_link")
+ .setTopologyIdOrName("some_topo").build())
+ .get();
+
+ Assert.assertFalse(output.isSuccessful());
+ }
+
+ @Test
+ public void getLink() throws TransactionCommitFailedException, ExecutionException, InterruptedException {
+ ReadWriteTransaction tx = dataBroker.newReadWriteTransaction();
+ String linkId = uuid1 + "-" + uuid2;
+ n(tx, uuid1, uuid1 + ":1", uuid1 + ":2", uuid1 + ":3");
+ n(tx, uuid2, uuid2 + ":1", uuid2 + ":2", uuid2 + ":3");
+ org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.tapi.topology.rev171113.topology.Link l = l(tx, uuid1, uuid1 + ":1", uuid2, uuid2 + ":1", OperationalState.ENABLED);
+ tx.submit().checkedGet();
+
+ RpcResult<GetLinkDetailsOutput> output = tapiTopologyService
+ .getLinkDetails(new GetLinkDetailsInputBuilder()
+ .setLinkIdOrName(l.getUuid().getValue())
+ .setTopologyIdOrName(TapiConstants.PRESTO_SYSTEM_TOPO).build())
+ .get();
+
+ Assert.assertTrue(output.isSuccessful());
+ Link link = output.getResult().getLink();
+ Set<String> nodeUuids = link.getNode().stream().map(u -> u.getValue()).collect(Collectors.toSet());
+ Assert.assertTrue(nodeUuids.contains(uuid1));
+ Assert.assertTrue(nodeUuids.contains(uuid2));
+ }
+
+}
import org.opendaylight.controller.md.sal.binding.api.DataTreeModification;
import org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
+import org.opendaylight.unimgr.mef.nrp.api.TopologyManager;
import org.opendaylight.unimgr.mef.nrp.common.NrpDao;
import org.opendaylight.unimgr.mef.nrp.common.ResourceNotAvailableException;
import org.opendaylight.unimgr.mef.nrp.common.TapiUtils;
import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.tapi.common.rev171113.*;
import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.tapi.common.rev171113.context.attrs.ServiceInterfacePoint;
import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.tapi.common.rev171113.context.attrs.ServiceInterfacePointBuilder;
-import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.tapi.common.rev171113.context.attrs.ServiceInterfacePointKey;
-import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.tapi.common.rev171113.service._interface.point.LayerProtocolBuilder;
import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.tapi.common.rev171113.service._interface.point.StateBuilder;
import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.tapi.topology.rev171113.node.OwnedNodeEdgePoint;
import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.tapi.topology.rev171113.node.OwnedNodeEdgePointBuilder;
private TopologyTransaction topologyTransaction;
private DataObjectModificationQualifier dataObjectModificationQualifier;
+ private final TopologyManager topologyManager;
+
private final DataBroker dataBroker;
- public TopologyDataHandler(DataBroker dataBroker) {
+ public TopologyDataHandler(DataBroker dataBroker, TopologyManager topologyManager) {
Objects.requireNonNull(dataBroker);
this.dataBroker = dataBroker;
+ this.topologyManager = topologyManager;
topologyTransaction = new TopologyTransaction(dataBroker);
}
ReadWriteTransaction tx = dataBroker.newReadWriteTransaction();
NrpDao dao = new NrpDao(tx);
- dao.createSystemNode(OVS_NODE, null);
+ dao.createNode(topologyManager.getSystemTopologyId(), OVS_NODE, ETH.class, null);
Futures.addCallback(tx.submit(), new FutureCallback<Void>() {
@Override
public static String getOvsNode() {
return OVS_NODE;
}
+
}
\ No newline at end of file
odl:use-default-for-reference-types="true">
<reference id="dataBroker" interface="org.opendaylight.controller.md.sal.binding.api.DataBroker" />
-
+ <reference id="topologyManager" interface="org.opendaylight.unimgr.mef.nrp.api.TopologyManager" />
<service id="ovsDriverService" interface="org.opendaylight.unimgr.mef.nrp.api.ActivationDriverBuilder">
<bean class="org.opendaylight.unimgr.mef.nrp.ovs.driver.OvsDriver">
<argument ref="dataBroker" />
</bean>
</service>
- <bean id="topologyHandler" class="org.opendaylight.unimgr.mef.nrp.ovs.tapi.TopologyDataHandler" init-method="init" destroy-method="close">
+ <bean id="topologyHandler" class="org.opendaylight.unimgr.mef.nrp.ovs.tapi.TopologyDataHandler" init-method="init" destroy-method="close">
<argument ref="dataBroker" />
+ <argument ref="topologyManager" />
</bean>
</blueprint>
import org.junit.Before;
import org.junit.Test;
+import org.mockito.Mockito;
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.controller.md.sal.binding.test.AbstractDataBrokerTest;
+import org.opendaylight.unimgr.mef.nrp.api.TapiConstants;
+import org.opendaylight.unimgr.mef.nrp.api.TopologyManager;
import org.opendaylight.unimgr.mef.nrp.ovs.FlowTopologyTestUtils;
import org.opendaylight.unimgr.mef.nrp.ovs.OvsdbTopologyTestUtils;
import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.tapi.common.rev171113.Uuid;
//given
dataBroker = getDataBroker();
helper = new TopologyDataHandlerTestUtils(dataBroker);
+ TopologyManager topologyManager = Mockito.mock(TopologyManager.class);
+ Mockito.when(topologyManager.getSystemTopologyId()).thenReturn(TapiConstants.PRESTO_SYSTEM_TOPO);
//helper.createOvsdbTopology();
OvsdbTopologyTestUtils.createOvsdbTopology(dataBroker);
FlowTopologyTestUtils.createFlowTopology(dataBroker,getLinkList());
helper.createPrestoSystemTopology();
- topologyDataHandler = new TopologyDataHandler(dataBroker);
+ topologyDataHandler = new TopologyDataHandler(dataBroker, topologyManager);
topologyDataHandler.init();
}
--- /dev/null
+#!/usr/bin/python
+
+"""
+This script creates topology to experiment with ovs drivers.
+"""
+
+import re
+import sys
+import os
+import time
+
+from mininet.cli import CLI
+from mininet.log import setLogLevel, info, error
+from mininet.net import Mininet
+from mininet.link import Intf
+from mininet.util import quietRun
+from mininet.node import Controller, RemoteController
+from mininet.topo import Topo
+from mininet.node import Node
+from mininet.util import waitListening
+from functools import partial
+from mininet.node import OVSSwitch
+
+class PocTopo( Topo ):
+ "Topology prepared for Presto NRP tutorial"
+
+ def __init__( self ):
+
+ # Initialize topology
+ Topo.__init__( self )
+
+ # Add hosts and switches
+ h1 = self.addHost( 'h1' )
+ h2 = self.addHost( 'h2' )
+
+ s1 = self.addSwitch( 's1' )
+ s2 = self.addSwitch( 's2' )
+ s3 = self.addSwitch( 's3' )
+
+ # Add links
+ self.addLink( h1, s1 )
+ self.addLink( h2, s2 )
+ self.addLink( s1, s3 )
+ self.addLink( s2, s3 )
+
+
+#topos = { 'poctopo': ( lambda: PocTopo() ) }
+
+if __name__ == '__main__':
+ setLogLevel( 'info' )
+
+ os.system('ovs-vsctl set-manager ptcp:6640')
+
+ defaultIF1 = 'enp0s9'
+ defaultIF2 = 'enp0s10'
+ defaultControllerIP = '127.0.0.1'
+ defaultInputSwitch = 0
+ defaultOutputSwitch = 1
+
+ # try to get hw intfs from the command line; by default, use eth1 and eth2
+ odl_controller_ip = sys.argv[ 1 ] if len( sys.argv ) > 1 else defaultControllerIP
+ intfName = sys.argv[ 2 ] if len( sys.argv ) > 2 else ""
+ intfName2 = sys.argv[ 3 ] if len( sys.argv ) > 3 else ""
+
+ input_switch = 0
+ output_switch = 1
+
+ OVSSwitch13 = partial( OVSSwitch, protocols='OpenFlow13' )
+
+ topo = PocTopo( )
+
+ net = Mininet(topo, switch=OVSSwitch13, controller=partial( RemoteController, ip=odl_controller_ip, port=6633 ) )
+
+ if intfName != "":
+ switch = net.switches[ input_switch ]
+ info( '*** Adding hardware interface', intfName, 'to switch', switch.name, '\n' )
+ Intf( intfName, node=switch )
+
+ if intfName2 != "":
+ switch2 = net.switches[ output_switch ]
+ info( '*** Adding hardware interface', intfName2, 'to switch', switch2.name, '\n' )
+ Intf(intfName2, node=switch2)
+
+
+ net.start()
+
+ os.system('ovs-ofctl -O OpenFlow13 del-flows s'+str(input_switch+1))
+ os.system('ovs-ofctl -O OpenFlow13 del-flows s'+str(output_switch+1))
+ CLI( net )
+ net.stop()
\ No newline at end of file
--- /dev/null
+{
+ "id": "66973884-02f6-13a3-47c1-88211945d148",
+ "name": "localhost",
+ "values": [
+ {
+ "enabled": true,
+ "key": "host",
+ "value": "http://{{ip_address}}:8181",
+ "type": "text"
+ },
+ {
+ "enabled": true,
+ "key": "ip_address",
+ "value": "127.0.0.1",
+ "type": "text"
+ },
+ {
+ "enabled": true,
+ "key": "mininet_ip_address",
+ "value": "127.0.0.1",
+ "type": "text"
+ },
+ {
+ "enabled": true,
+ "key": "sip1_uuid",
+ "value": "sip:ovs-node:s1:s1-eth1",
+ "type": "text"
+ },
+ {
+ "enabled": true,
+ "key": "sip2_uuid",
+ "value": "sip:ovs-node:s2:s2-eth1",
+ "type": "text"
+ },
+ {
+ "enabled": true,
+ "key": "service_uuid",
+ "value": "cs:161001131f5:6ced9ae1",
+ "type": "text"
+ }
+ ],
+ "timestamp": 1516124582615,
+ "_postman_variable_scope": "environment",
+ "_postman_exported_at": "2018-01-16T17:44:14.646Z",
+ "_postman_exported_using": "Postman/5.4.0"
+}
\ No newline at end of file
{
- "id": "46c77098-5939-1f56-2e3a-4a3997be95c0",
- "name": "CableLabs - Unimgr",
- "description": "",
- "order": [
- "dc89d7f7-9c7e-d6c7-3d9b-9e68d72a1ceb",
- "abe347a4-a35a-5ba6-ec40-863431d0b64d",
- "d96aaa33-486c-20d9-2c6f-57b876cadbb8",
- "a91dba5c-e518-c2fa-83f7-24ac35c63f86",
- "298c2bfa-448c-6fe0-916e-0411fff21843",
- "eabf5f1b-d081-d13c-0bf8-c438b9726aaf",
- "c780ad05-96af-c239-d6a6-df12b0f37ea6",
- "5e449224-8792-762b-75fa-da41bdcee322",
- "1d7e32ea-677e-8c88-1c41-ca2dae24396d",
- "6e1f7bca-5c00-418c-8e54-f4bd0c4abd6f",
- "cb3f77ff-f006-e6dd-eaef-2186e4bb69da",
- "9af14fa4-0baf-f0d5-2975-7f442bdf1685",
- "53b95ff4-54a2-2dd7-1045-ba855a9a909c",
- "79f845a9-45f3-3f07-d924-d9a8b48a213b",
- "0bfdcc50-3ee5-4bbc-1006-d9a900dac3c9"
- ],
- "folders": [],
- "timestamp": 0,
- "owner": 0,
- "remoteLink": "",
- "public": false,
- "requests": [
+ "variables": [],
+ "info": {
+ "name": "MEF LSO simplified",
+ "_postman_id": "b27154fd-9d18-b9c7-5b8c-1422a15e86c9",
+ "description": "",
+ "schema": "https://schema.getpostman.com/json/collection/v2.0.0/collection.json"
+ },
+ "item": [
{
- "id": "0bfdcc50-3ee5-4bbc-1006-d9a900dac3c9",
- "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n",
- "url": "http://localhost:8181/restconf/config/network-topology:network-topology/topology/unimgr:evc/link/evc:%2F%2F1/cl-unimgr-mef:egress-bw",
- "preRequestScript": "",
- "pathVariables": {},
- "method": "GET",
- "data": [],
- "dataMode": "params",
- "version": 2,
- "tests": "",
- "currentHelper": "normal",
- "helperAttributes": {},
- "time": 1453244942574,
- "name": "Get EVC egress bw-speed",
- "description": "",
- "collectionId": "46c77098-5939-1f56-2e3a-4a3997be95c0",
- "responses": []
+ "name": "Step 0 Init - add OVSDB Node",
+ "request": {
+ "url": "{{host}}/restconf/config/network-topology:network-topology/topology/ovsdb:1/",
+ "method": "POST",
+ "header": [
+ {
+ "key": "Content-Type",
+ "value": "application/json",
+ "description": ""
+ },
+ {
+ "key": "Authorization",
+ "value": "Basic YWRtaW46YWRtaW4=",
+ "description": ""
+ }
+ ],
+ "body": {
+ "mode": "raw",
+ "raw": "{\n \"node\": [\n {\n \"node-id\": \"odl\",\n \"connection-info\": {\n \"remote-ip\": \"{{mininet_ip_address}}\",\n \"remote-port\": 6640\n }\n }\n ]\n}"
+ },
+ "description": ""
+ },
+ "response": []
},
{
- "id": "1d7e32ea-677e-8c88-1c41-ca2dae24396d",
- "headers": "Content-Type: application/json\nAuthorization: Basic YWRtaW46YWRtaW4=\n",
- "url": "http://localhost:8181/restconf/config/network-topology:network-topology/topology/unimgr:uni/node/uni:%2F%2F192.168.2.10",
- "preRequestScript": "",
- "pathVariables": {},
- "method": "DELETE",
- "data": [],
- "dataMode": "raw",
- "version": 2,
- "tests": "",
- "currentHelper": "normal",
- "helperAttributes": {},
- "time": 1453243682727,
- "name": "Delete UNI 2",
- "description": "",
- "collectionId": "46c77098-5939-1f56-2e3a-4a3997be95c0",
- "responses": [],
- "rawModeData": ""
+ "name": "Step 1 change statistics manager mode - disable",
+ "request": {
+ "url": "{{host}}/restconf/operations/statistics-manager-control:change-statistics-work-mode",
+ "method": "POST",
+ "header": [
+ {
+ "key": "Content-Type",
+ "value": "application/json",
+ "description": ""
+ },
+ {
+ "key": "Authorization",
+ "value": "Basic YWRtaW46YWRtaW4=",
+ "description": ""
+ }
+ ],
+ "body": {
+ "mode": "raw",
+ "raw": "{\n \"input\": {\n \"mode\": \"FULLY_DISABLED\"\n }\n}"
+ },
+ "description": ""
+ },
+ "response": []
},
{
- "id": "298c2bfa-448c-6fe0-916e-0411fff21843",
- "headers": "Authorization: Basic YWRtaW46YWRtaW4=\n",
- "url": "http://localhost:8181/restconf/config/network-topology:network-topology/topology/unimgr:uni/node/uni:%2F%2F192.168.1.30",
- "preRequestScript": "",
- "pathVariables": {},
- "method": "GET",
- "data": [],
- "dataMode": "params",
- "version": 2,
- "tests": "",
- "currentHelper": "normal",
- "helperAttributes": {},
- "time": 1446585683690,
- "name": "Get Specific Config Uni",
- "description": "",
- "collectionId": "46c77098-5939-1f56-2e3a-4a3997be95c0",
- "responses": []
+ "name": "Step 1a - get Tapi Topology - mef:presto-nrp-topology",
+ "request": {
+ "url": "{{host}}/restconf/operational/tapi-common:context/tapi-topology:topology/mef:presto-nrp-topology",
+ "method": "GET",
+ "header": [
+ {
+ "key": "Authorization",
+ "value": "Basic YWRtaW46YWRtaW4=",
+ "description": ""
+ }
+ ],
+ "body": {
+ "mode": "raw",
+ "raw": ""
+ },
+ "description": ""
+ },
+ "response": []
},
{
- "id": "53b95ff4-54a2-2dd7-1045-ba855a9a909c",
- "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n",
- "url": "http://localhost:8181/restconf/config/network-topology:network-topology/topology/unimgr:uni/node/uni:%2F%2F192.168.2.11/cl-unimgr-mef:speed",
- "preRequestScript": "",
- "pathVariables": {},
- "method": "GET",
- "data": [],
- "dataMode": "params",
- "version": 2,
- "tests": "",
- "currentHelper": "normal",
- "helperAttributes": {},
- "time": 1453244973214,
- "name": "Get UNI Node bw-speed",
- "description": "",
- "collectionId": "46c77098-5939-1f56-2e3a-4a3997be95c0",
- "responses": []
+ "name": "Step 2 - create connnectivity service",
+ "event": [
+ {
+ "listen": "test",
+ "script": {
+ "type": "text/javascript",
+ "exec": [
+ "var jsonData = JSON.parse(responseBody);",
+ "",
+ "postman.setEnvironmentVariable(\"service_uuid\", jsonData.output.service.uuid);"
+ ]
+ }
+ }
+ ],
+ "request": {
+ "url": "{{host}}/restconf/operations/tapi-connectivity:create-connectivity-service",
+ "method": "POST",
+ "header": [
+ {
+ "key": "Content-Type",
+ "value": "application/json",
+ "description": ""
+ },
+ {
+ "key": "Authorization",
+ "value": "Basic YWRtaW46YWRtaW4=",
+ "description": ""
+ }
+ ],
+ "body": {
+ "mode": "raw",
+ "raw": "{\r\n \"input\": {\r\n \"end-point\": [\r\n {\r\n \"service-interface-point\": \"{{sip1_uuid}}\",\r\n \"direction\": \"BIDIRECTIONAL\",\r\n \"layer-protocol\": [{\r\n \"local-id\":\"eth\",\r\n \"layer-protocol-name\" : \"tapi-common:ETH\"\r\n }],\r\n \"nrp-interface:nrp-carrier-eth-connectivity-end-point-resource\": {\r\n \"ce-vlan-id-list-and-untag\": {\r\n \"vlan-id\":[\r\n {\r\n \"vlan-id\": 301\r\n }\r\n ]\r\n }\r\n }\r\n },\r\n {\r\n \"service-interface-point\": \"{{sip2_uuid}}\",\r\n \"direction\": \"BIDIRECTIONAL\",\r\n \"layer-protocol\": [{\r\n \"local-id\":\"eth\",\r\n \"layer-protocol-name\" : \"tapi-common:ETH\"\r\n }],\r\n \"nrp-interface:nrp-carrier-eth-connectivity-end-point-resource\": {\r\n \"ce-vlan-id-list-and-untag\": {\r\n \"vlan-id\":[\r\n {\r\n \"vlan-id\": 301\r\n }\r\n ]\r\n }\r\n }\r\n }\r\n ],\r\n \"conn-constraint\": {\r\n \"service-type\": \"POINT_TO_POINT_CONNECTIVITY\",\r\n \"service-level\": \"BEST_EFFORT\"\r\n },\r\n \"nrp-interface:nrp-carrier-eth-connectivity-resource\": {\r\n \"max-frame-size\": \"2000\"\r\n }\r\n }\r\n}"
+ },
+ "description": ""
+ },
+ "response": []
},
{
- "id": "5e449224-8792-762b-75fa-da41bdcee322",
- "headers": "Content-Type: application/json\nAuthorization: Basic YWRtaW46YWRtaW4=\n",
- "url": "http://localhost:8181/restconf/config/network-topology:network-topology/topology/unimgr:uni/node/uni:%2F%2F192.168.2.11",
- "preRequestScript": "",
- "pathVariables": {},
- "method": "DELETE",
- "data": [],
- "dataMode": "raw",
- "version": 2,
- "tests": "",
- "currentHelper": "normal",
- "helperAttributes": {},
- "time": 1453243668536,
- "name": "Delete UNI 1",
- "description": "",
- "collectionId": "46c77098-5939-1f56-2e3a-4a3997be95c0",
- "responses": [],
- "rawModeData": ""
+ "name": "Step 3 - get connnectivity service list",
+ "request": {
+ "url": "{{host}}/restconf/operations/tapi-connectivity:get-connectivity-service-list",
+ "method": "POST",
+ "header": [
+ {
+ "key": "Content-Type",
+ "value": "application/json",
+ "description": ""
+ },
+ {
+ "key": "Authorization",
+ "value": "Basic YWRtaW46YWRtaW4=",
+ "description": ""
+ }
+ ],
+ "body": {
+ "mode": "raw",
+ "raw": ""
+ },
+ "description": ""
+ },
+ "response": []
},
{
- "id": "6e1f7bca-5c00-418c-8e54-f4bd0c4abd6f",
- "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n",
- "url": "http://localhost:8181/restconf/config/network-topology:network-topology/topology/unimgr:evc/link/evc:%2F%2F1/cl-unimgr-mef:ingress-bw",
- "preRequestScript": "",
- "pathVariables": {},
- "method": "PUT",
- "data": [],
- "dataMode": "raw",
- "version": 2,
- "tests": "",
- "currentHelper": "normal",
- "helperAttributes": {},
- "time": 1453244573378,
- "name": "update ingress bw-speed",
- "description": "",
- "collectionId": "46c77098-5939-1f56-2e3a-4a3997be95c0",
- "responses": [],
- "rawModeData": "{\n \"ingress-bw\": {\n \"speed-100M\": {}\n }\n}"
+ "name": "Step 4 - delete connectivity service",
+ "request": {
+ "url": "{{host}}/restconf/operations/tapi-connectivity:delete-connectivity-service",
+ "method": "POST",
+ "header": [
+ {
+ "key": "Content-Type",
+ "value": "application/json",
+ "description": ""
+ },
+ {
+ "key": "Authorization",
+ "value": "Basic YWRtaW46YWRtaW4=",
+ "description": ""
+ }
+ ],
+ "body": {
+ "mode": "raw",
+ "raw": "{\n \"input\" : {\n \"service-id-or-name\" : \"{{service_uuid}}\"\n }\n}"
+ },
+ "description": ""
+ },
+ "response": []
},
{
- "id": "79f845a9-45f3-3f07-d924-d9a8b48a213b",
- "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n",
- "url": "http://localhost:8181/restconf/config/network-topology:network-topology/topology/unimgr:evc/link/evc:%2F%2F1/cl-unimgr-mef:ingress-bw",
- "preRequestScript": "",
- "pathVariables": {},
- "method": "GET",
- "data": [],
- "dataMode": "params",
- "version": 2,
- "tests": "",
- "currentHelper": "normal",
- "helperAttributes": {},
- "time": 1453244872644,
- "name": "Get EVC ingress bw-speed",
- "description": "",
- "collectionId": "46c77098-5939-1f56-2e3a-4a3997be95c0",
- "responses": []
+ "name": "del OVSDB Node copy",
+ "request": {
+ "url": "{{host}}/restconf/config/network-topology:network-topology/topology/ovsdb%3A1/node/odl",
+ "method": "DELETE",
+ "header": [
+ {
+ "key": "Content-Type",
+ "value": "application/json",
+ "description": ""
+ },
+ {
+ "key": "Authorization",
+ "value": "Basic YWRtaW46YWRtaW4=",
+ "description": ""
+ }
+ ],
+ "body": {
+ "mode": "raw",
+ "raw": ""
+ },
+ "description": ""
+ },
+ "response": []
},
{
- "id": "9af14fa4-0baf-f0d5-2975-7f442bdf1685",
- "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n",
- "url": "http://localhost:8181/restconf/config/network-topology:network-topology/topology/unimgr:uni/node/uni:%2F%2F192.168.2.11/cl-unimgr-mef:speed",
- "preRequestScript": "",
- "pathVariables": {},
- "method": "PUT",
- "data": [],
- "dataMode": "raw",
- "version": 2,
- "tests": "",
- "currentHelper": "normal",
- "helperAttributes": {},
- "time": 1453244780757,
- "name": "update UNI Node bw-speed",
- "description": "",
- "collectionId": "46c77098-5939-1f56-2e3a-4a3997be95c0",
- "responses": [],
- "rawModeData": "{\n \"speed\": {\n \"speed-10G\": {}\n }\n}"
+ "name": "Init - get OVSDB Node copy",
+ "request": {
+ "url": "{{host}}/restconf/config/network-topology:network-topology",
+ "method": "GET",
+ "header": [
+ {
+ "key": "Content-Type",
+ "value": "application/json",
+ "description": ""
+ },
+ {
+ "key": "Authorization",
+ "value": "Basic YWRtaW46YWRtaW4=",
+ "description": ""
+ },
+ {
+ "key": "Accept",
+ "value": "application/json",
+ "description": ""
+ }
+ ],
+ "body": {
+ "mode": "raw",
+ "raw": "{\n \"node\": [\n {\n \"node-id\": \"odl\",\n \"connection-info\": {\n \"remote-ip\": \"127.0.0.1\",\n \"remote-port\": 6640\n }\n }\n ]\n}"
+ },
+ "description": ""
+ },
+ "response": []
},
{
- "folder": null,
- "id": "a91dba5c-e518-c2fa-83f7-24ac35c63f86",
- "name": "Get Config Topology",
- "dataMode": "params",
- "data": [],
- "rawModeData": null,
- "descriptionFormat": "html",
- "description": "",
- "headers": "Authorization: Basic YWRtaW46YWRtaW4=\n",
- "method": "GET",
- "pathVariables": {},
- "url": "http://localhost:8181/restconf/config/network-topology:network-topology",
- "preRequestScript": "",
- "tests": "",
- "currentHelper": "normal",
- "helperAttributes": {},
- "collectionId": "46c77098-5939-1f56-2e3a-4a3997be95c0"
+ "name": "get topology list RPC",
+ "request": {
+ "url": "{{host}}/restconf/operations/tapi-topology:get-topology-list",
+ "method": "POST",
+ "header": [
+ {
+ "key": "Authorization",
+ "value": "Basic YWRtaW46YWRtaW4=",
+ "description": ""
+ },
+ {
+ "key": "Accept",
+ "value": "application/json",
+ "description": ""
+ }
+ ],
+ "body": {},
+ "description": ""
+ },
+ "response": []
},
{
- "id": "abe347a4-a35a-5ba6-ec40-863431d0b64d",
- "headers": "Content-Type: application/json\nAuthorization: Basic YWRtaW46YWRtaW4=\n",
- "url": "http://localhost:8181/restconf/config/network-topology:network-topology/topology/unimgr:uni/node/uni:%2F%2F192.168.2.10",
- "preRequestScript": "",
- "pathVariables": {},
- "method": "PUT",
- "data": [],
- "dataMode": "raw",
- "version": 2,
- "tests": "",
- "currentHelper": "normal",
- "helperAttributes": {},
- "time": 1453243618910,
- "name": "Create UNI 2",
- "description": "",
- "collectionId": "46c77098-5939-1f56-2e3a-4a3997be95c0",
- "rawModeData": "{\n \"network-topology:node\": [\n {\n \"node-id\": \"uni://192.168.2.10\",\n \"speed\": {\n \"speed-1G\": 1\n },\n \"uni:mac-layer\": \"IEEE 802.3-2005\",\n \"uni:physical-medium\": \"UNI TypeFull Duplex 2 Physical Interface\",\n \"uni:mtu-size\": 0,\n \"uni:type\": \"\",\n \"uni:mac-address\": \"68:5b:35:bb:f8:3c\",\n \"uni:ip-address\": \"192.168.2.10\",\n \"uni:mode\": \"Full Duplex\"\n }\n ]\n}"
+ "name": "get topology details RPC",
+ "request": {
+ "url": "{{host}}/restconf/operations/tapi-topology:get-topology-details",
+ "method": "POST",
+ "header": [
+ {
+ "key": "Authorization",
+ "value": "Basic YWRtaW46YWRtaW4=",
+ "description": ""
+ },
+ {
+ "key": "Accept",
+ "value": "application/json",
+ "description": ""
+ },
+ {
+ "key": "Content-Type",
+ "value": "application/json",
+ "description": ""
+ }
+ ],
+ "body": {
+ "mode": "raw",
+ "raw": "{\n\t\"input\" : {\n\t\t\"topology-id-or-name\" : \"mef:presto-nrp-topology\"\n\t}\n}"
+ },
+ "description": ""
+ },
+ "response": []
},
{
- "id": "c780ad05-96af-c239-d6a6-df12b0f37ea6",
- "headers": "Content-Type: application/json\nAuthorization: Basic YWRtaW46YWRtaW4=\n",
- "url": "http://localhost:8181/restconf/config/network-topology:network-topology/topology/unimgr:evc/link/evc:%2F%2F1",
- "preRequestScript": "",
- "pathVariables": {},
- "method": "DELETE",
- "data": [],
- "dataMode": "raw",
- "version": 2,
- "tests": "",
- "currentHelper": "normal",
- "helperAttributes": {},
- "time": 1452717219049,
- "name": "Delete EVC",
- "description": "",
- "collectionId": "46c77098-5939-1f56-2e3a-4a3997be95c0",
- "responses": [],
- "rawModeData": ""
- },
- {
- "id": "cb3f77ff-f006-e6dd-eaef-2186e4bb69da",
- "headers": "Authorization: Basic YWRtaW46YWRtaW4=\nContent-Type: application/json\n",
- "url": "http://localhost:8181/restconf/config/network-topology:network-topology/topology/unimgr:evc/link/evc:%2F%2F1/cl-unimgr-mef:egress-bw",
- "preRequestScript": "",
- "pathVariables": {},
- "method": "PUT",
- "data": [],
- "dataMode": "raw",
- "version": 2,
- "tests": "",
- "currentHelper": "normal",
- "helperAttributes": {},
- "time": 1453244557357,
- "name": "update egress bw-speed",
- "description": "",
- "collectionId": "46c77098-5939-1f56-2e3a-4a3997be95c0",
- "responses": [],
- "rawModeData": "{\n \"egress-bw\": {\n \"speed-100M\": {}\n }\n}"
- },
- {
- "folder": null,
- "id": "d96aaa33-486c-20d9-2c6f-57b876cadbb8",
- "name": "Get Operational Topology",
- "dataMode": "params",
- "data": [],
- "rawModeData": null,
- "descriptionFormat": "html",
- "description": "This restconf request will fetch the operational topology. Operational topology details are fetch by southbound plugin from all the connected ovsdb node.",
- "headers": "Authorization: Basic YWRtaW46YWRtaW4=\n",
- "method": "GET",
- "pathVariables": {},
- "url": "http://localhost:8181/restconf/operational/network-topology:network-topology/",
- "preRequestScript": "",
- "tests": "",
- "currentHelper": "normal",
- "helperAttributes": {},
- "collectionId": "46c77098-5939-1f56-2e3a-4a3997be95c0"
- },
- {
- "id": "dc89d7f7-9c7e-d6c7-3d9b-9e68d72a1ceb",
- "headers": "Content-Type: application/json\nAuthorization: Basic YWRtaW46YWRtaW4=\n",
- "url": "http://localhost:8181/restconf/config/network-topology:network-topology/topology/unimgr:uni/node/uni:%2F%2F192.168.2.11",
- "preRequestScript": "",
- "pathVariables": {},
- "method": "PUT",
- "data": [],
- "dataMode": "raw",
- "version": 2,
- "tests": "",
- "currentHelper": "normal",
- "helperAttributes": {},
- "time": 1453243591567,
- "name": "Create UNI 1",
- "description": "",
- "collectionId": "46c77098-5939-1f56-2e3a-4a3997be95c0",
- "rawModeData": "{\n \"network-topology:node\": [\n {\n \"node-id\": \"uni://192.168.2.11\",\n \"speed\": {\n \"speed-1G\": 1\n },\n \"uni:mac-layer\": \"IEEE 802.3-2005\",\n \"uni:physical-medium\": \"UNI TypeFull Duplex 2 Physical Interface\",\n \"uni:mtu-size\": 0,\n \"uni:type\": \"\",\n \"uni:mac-address\": \"68:5b:35:bb:f8:3e\",\n \"uni:ip-address\": \"192.168.2.11\",\n \"uni:mode\": \"Full Duplex\"\n }\n ]\n}"
- },
- {
- "id": "eabf5f1b-d081-d13c-0bf8-c438b9726aaf",
- "headers": "Content-Type: application/json\nAuthorization: Basic YWRtaW46YWRtaW4=\n",
- "url": "http://localhost:8181/restconf/config/network-topology:network-topology/topology/unimgr:evc/link/evc:%2F%2F1",
- "preRequestScript": "",
- "pathVariables": {},
- "method": "PUT",
- "data": [],
- "dataMode": "raw",
- "version": 2,
- "tests": "",
- "currentHelper": "normal",
- "helperAttributes": {},
- "time": 1453243654861,
- "name": "Create EVC",
- "description": "",
- "collectionId": "46c77098-5939-1f56-2e3a-4a3997be95c0",
- "responses": [],
- "rawModeData": "{\n \"link\": [\n {\n \"link-id\": \"evc://1\",\n \"source\": {\n \"source-node\": \"/network-topology/topology/node/uni://192.168.2.11\"\n },\n \"destination\": {\n \"dest-node\": \"/network-topology/topology/node/uni://192.168.2.10\"\n },\n \"cl-unimgr-mef:uni-source\": [\n {\n \"order\": \"0\",\n \"ip-address\": \"192.168.2.11\"\n }\n ],\n \"cl-unimgr-mef:uni-dest\": [\n {\n \"order\": \"0\",\n \"ip-address\": \"192.168.2.10\"\n }\n ],\n \"cl-unimgr-mef:cos-id\": \"string\",\n \"cl-unimgr-mef:ingress-bw\": {\n \"speed-10G\": {}\n },\n \"cl-unimgr-mef:egress-bw\": {\n \"speed-10G\": {}\n }\n }\n ]\n}"
+ "name": "get node details RPC",
+ "request": {
+ "url": "{{host}}/restconf/operations/tapi-topology:get-node-details",
+ "method": "POST",
+ "header": [
+ {
+ "key": "Authorization",
+ "value": "Basic YWRtaW46YWRtaW4=",
+ "description": ""
+ },
+ {
+ "key": "Accept",
+ "value": "application/json",
+ "description": ""
+ },
+ {
+ "key": "Content-Type",
+ "value": "application/json",
+ "description": ""
+ }
+ ],
+ "body": {
+ "mode": "raw",
+ "raw": "{\n\t\"input\" : {\n\t\t\"topology-id-or-name\" : \"mef:presto-nrp-topology\",\n\t\t\"node-id-or-name\" : \"mef:presto-nrp-abstract-node\"\n\t}\n}"
+ },
+ "description": ""
+ },
+ "response": []
}
]
}
\ No newline at end of file
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction;
import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
+import org.opendaylight.unimgr.mef.nrp.api.TopologyManager;
import org.opendaylight.unimgr.mef.nrp.common.NrpDao;
import org.opendaylight.unimgr.mef.nrp.common.TapiUtils;
import org.opendaylight.unimgr.mef.nrp.template.TemplateConstants;
import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.tapi.common.rev171113.ETH;
import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.tapi.common.rev171113.PortDirection;
import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.tapi.common.rev171113.PortRole;
-import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.tapi.common.rev171113.TerminationDirection;
import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.tapi.common.rev171113.Uuid;
import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.tapi.common.rev171113.context.attrs.ServiceInterfacePoint;
import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.tapi.common.rev171113.context.attrs.ServiceInterfacePointBuilder;
-import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.tapi.common.rev171113.service._interface.point.LayerProtocol;
-import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.tapi.common.rev171113.service._interface.point.LayerProtocolBuilder;
import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.tapi.topology.rev171113.node.OwnedNodeEdgePoint;
import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.tapi.topology.rev171113.node.OwnedNodeEdgePointBuilder;
import org.slf4j.Logger;
public class TopologyDataHandler {
private static final Logger LOG = LoggerFactory.getLogger(TopologyDataHandler.class);
private DataBroker dataBroker;
+ private TopologyManager topologyManager;
- public TopologyDataHandler(DataBroker dataBroker) {
+ public TopologyDataHandler(DataBroker dataBroker, TopologyManager topologyManager) {
this.dataBroker = dataBroker;
+ this.topologyManager = topologyManager;
}
public void init() {
NrpDao nrpDao = new NrpDao(tx);
//we are creating a list of NodeEdgePoints for the node no sips are added to the system
List<OwnedNodeEdgePoint> someEndpoints = createSomeEndpoints(1, 2, 5, 7);
- nrpDao.createSystemNode(TemplateConstants.DRIVER_ID, someEndpoints);
+ nrpDao.createNode(topologyManager.getSystemTopologyId(), TemplateConstants.DRIVER_ID, ETH.class, null);
//add sip for one of these endpoints
//create sid and add it to model
odl:use-default-for-reference-types="true">
<reference id="dataBroker" interface="org.opendaylight.controller.md.sal.binding.api.DataBroker" />
+ <reference id="topologyManager" interface="org.opendaylight.unimgr.mef.nrp.api.TopologyManager" />
<service interface="org.opendaylight.unimgr.mef.nrp.api.ActivationDriverBuilder">
<bean class="org.opendaylight.unimgr.mef.nrp.template.driver.TemplateDriver">
</service>
<bean id="topologyHandler" class="org.opendaylight.unimgr.mef.nrp.template.tapi.TopologyDataHandler" init-method="init" destroy-method="close">
<argument ref="dataBroker" />
+ <argument ref="topologyManager" />
</bean>
</blueprint>
@Before
public void testSetup() {
- topologyDataHandler = new TopologyDataHandler(dataBroker);
+ topologyDataHandler = new TopologyDataHandler(dataBroker, topologyManager);
}
@Test