use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev200120.linkstate.object.type.NodeCase in project bgpcep by opendaylight.
the class LinkstateGraphBuilder method createObject.
@Override
protected void createObject(final ReadWriteTransaction trans, final InstanceIdentifier<LinkstateRoute> id, final LinkstateRoute value) {
final ObjectType t = value.getObjectType();
checkArgument(t != null, "Route %s value %s has null object type", id, value);
if (t instanceof LinkCase) {
createEdge(value, (LinkCase) t, value.getAttributes());
} else if (t instanceof NodeCase) {
createVertex(value, (NodeCase) t, value.getAttributes());
} else if (t instanceof PrefixCase) {
createPrefix(value, (PrefixCase) t, value.getAttributes());
} else {
LOG.debug(UNHANDLED_OBJECT_CLASS, t.implementedInterface());
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev200120.linkstate.object.type.NodeCase in project bgpcep by opendaylight.
the class LinkstateGraphBuilder method removeVertex.
private void removeVertex(final NodeCase nodeCase) {
VertexKey vertexKey = new VertexKey(getVertexId(nodeCase.getNodeDescriptors().getCRouterIdentifier()));
if (vertexKey == null || vertexKey.getVertexId() == Uint64.ZERO) {
LOG.warn("Unable to get Vertex Key from descriptor {}, skipping it", nodeCase.getNodeDescriptors());
return;
}
LOG.info("Deleted Vertex {} in TED[{}]", vertexKey, cgraph);
cgraph.deleteVertex(vertexKey);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev200120.linkstate.object.type.NodeCase in project bgpcep by opendaylight.
the class LinkstateTopologyBuilder method createObject.
@Override
protected void createObject(final ReadWriteTransaction trans, final InstanceIdentifier<LinkstateRoute> id, final LinkstateRoute value) {
final UriBuilder base = new UriBuilder(value);
final ObjectType t = value.getObjectType();
Preconditions.checkArgument(t != null, "Route %s value %s has null object type", id, value);
if (t instanceof LinkCase) {
createLink(trans, base, value, (LinkCase) t, value.getAttributes());
} else if (t instanceof NodeCase) {
createNode(trans, base, value, (NodeCase) t, value.getAttributes());
} else if (t instanceof PrefixCase) {
createPrefix(trans, base, value, (PrefixCase) t, value.getAttributes());
} else {
LOG.debug(UNHANDLED_OBJECT_CLASS, t.implementedInterface());
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev200120.linkstate.object.type.NodeCase in project bgpcep by opendaylight.
the class LinkstateTopologyBuilder method removeObject.
@Override
protected void removeObject(final ReadWriteTransaction trans, final InstanceIdentifier<LinkstateRoute> id, final LinkstateRoute value) {
if (value == null) {
LOG.error("Empty before-data received in delete data change notification for instance id {}", id);
return;
}
final UriBuilder base = new UriBuilder(value);
final ObjectType t = value.getObjectType();
if (t instanceof LinkCase) {
removeLink(trans, base, (LinkCase) t);
} else if (t instanceof NodeCase) {
removeNode(trans, base, (NodeCase) t);
} else if (t instanceof PrefixCase) {
removePrefix(trans, base, (PrefixCase) t);
} else {
LOG.debug(UNHANDLED_OBJECT_CLASS, t.implementedInterface());
}
}
Aggregations