import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.tapi.connectivity.rev171113.connectivity.context.ConnectivityService;
import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.tapi.connectivity.rev171113.connectivity.context.ConnectivityServiceKey;
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.get.node.edge.point.details.output.NodeEdgePoint;
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.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.tapi.topology.rev171113.node.OwnedNodeEdgePointKey;
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.TopologyKey;
public NrpDao(ReadWriteTransaction tx) {
+ if(tx == null) throw new NullPointerException();
this.tx = tx;
this.rtx = tx;
}
this.tx = null;
}
- private Function<NodeEdgePoint, OwnedNodeEdgePoint> toNep = nep -> new OwnedNodeEdgePointBuilder(nep).build();
-
public Node createSystemNode(String nodeId, List<OwnedNodeEdgePoint> neps) {
verifyTx();
Uuid uuid = new Uuid(nodeId);
}
public void updateNep(Uuid nodeId, OwnedNodeEdgePoint nep) {
+ verifyTx();
InstanceIdentifier<OwnedNodeEdgePoint> nodeIdent = node(nodeId).child(OwnedNodeEdgePoint.class, new OwnedNodeEdgePointKey(nep.getUuid()));
tx.put(LogicalDatastoreType.OPERATIONAL, nodeIdent, nep);
}
return topo(TapiConstants.PRESTO_EXT_TOPO).child(Node.class, new NodeKey(new Uuid(TapiConstants.PRESTO_ABSTRACT_NODE)));
}
+ public void removeSip(Uuid uuid) {
+ removeSips(Stream.of(uuid));
+ }
+
public void removeSips(Stream<Uuid> uuids) {
verifyTx();
if (uuids == null) {
public List<ConnectivityService> getConnectivityServiceList() {
try {
- return rtx.read(LogicalDatastoreType.OPERATIONAL,
+ org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.tapi.connectivity.rev171113.Context1 connections = rtx.read(LogicalDatastoreType.OPERATIONAL,
ctx().augmentation(org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.tapi.connectivity.rev171113.Context1.class))
- .checkedGet().orNull().getConnectivityService();
+ .checkedGet().orNull();
+ return connections == null ? null : connections.getConnectivityService();
} catch (ReadFailedException e) {
LOG.warn("reading connectivity services failed", e);
return null;