Search in sources :

Example 6 with NodeCase

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());
    }
}
Also used : ObjectType(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev200120.linkstate.ObjectType) OspfNodeCase(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev200120.node.identifier.c.router.identifier.OspfNodeCase) NodeCase(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev200120.linkstate.object.type.NodeCase) IsisNodeCase(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev200120.node.identifier.c.router.identifier.IsisNodeCase) PrefixCase(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev200120.linkstate.object.type.PrefixCase) LinkCase(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev200120.linkstate.object.type.LinkCase)

Example 7 with NodeCase

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);
}
Also used : VertexKey(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.graph.rev191125.graph.topology.graph.VertexKey)

Example 8 with NodeCase

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());
    }
}
Also used : ObjectType(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev200120.linkstate.ObjectType) NodeCase(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev200120.linkstate.object.type.NodeCase) PrefixCase(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev200120.linkstate.object.type.PrefixCase) LinkCase(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev200120.linkstate.object.type.LinkCase)

Example 9 with NodeCase

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());
    }
}
Also used : ObjectType(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev200120.linkstate.ObjectType) NodeCase(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev200120.linkstate.object.type.NodeCase) PrefixCase(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev200120.linkstate.object.type.PrefixCase) LinkCase(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev200120.linkstate.object.type.LinkCase)

Aggregations

NodeCase (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev200120.linkstate.object.type.NodeCase)5 ObjectType (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev200120.linkstate.ObjectType)3 LinkCase (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev200120.linkstate.object.type.LinkCase)3 PrefixCase (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev200120.linkstate.object.type.PrefixCase)3 NodeAttributes (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev200120.linkstate.path.attribute.link.state.attribute.node.attributes._case.NodeAttributes)2 IsisNodeCase (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev200120.node.identifier.c.router.identifier.IsisNodeCase)2 OspfNodeCase (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev200120.node.identifier.c.router.identifier.OspfNodeCase)2 NodeId (org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId)2 Uint32 (org.opendaylight.yangtools.yang.common.Uint32)2 Uint64 (org.opendaylight.yangtools.yang.common.Uint64)2 ByteBuf (io.netty.buffer.ByteBuf)1 ArrayList (java.util.ArrayList)1 Test (org.junit.Test)1 AsNumber (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.AsNumber)1 DomainName (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.DomainName)1 IpAddress (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress)1 DomainIdentifier (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev200120.DomainIdentifier)1 IsIsRouterIdentifierBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev200120.isis.lan.identifier.IsIsRouterIdentifierBuilder)1 LocalNodeDescriptors (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev200120.linkstate.object.type.link._case.LocalNodeDescriptors)1 RemoteNodeDescriptors (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev200120.linkstate.object.type.link._case.RemoteNodeDescriptors)1