Search in sources :

Example 6 with LinkCase

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

Example 7 with LinkCase

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

Aggregations

LinkCase (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev171207.linkstate.object.type.LinkCase)4 ObjectType (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev171207.linkstate.ObjectType)2 NodeCase (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev171207.linkstate.object.type.NodeCase)2 PrefixCase (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev171207.linkstate.object.type.PrefixCase)2 LinkDescriptors (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev171207.linkstate.object.type.link._case.LinkDescriptors)2 ByteBuf (io.netty.buffer.ByteBuf)1 BigInteger (java.math.BigInteger)1 Test (org.junit.Test)1 SimpleNlriTypeRegistry (org.opendaylight.protocol.bgp.linkstate.spi.pojo.SimpleNlriTypeRegistry)1 AsNumber (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.AsNumber)1 DomainIdentifier (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev171207.DomainIdentifier)1 LocalNodeDescriptors (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev171207.linkstate.object.type.link._case.LocalNodeDescriptors)1 RemoteNodeDescriptors (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev171207.linkstate.object.type.link._case.RemoteNodeDescriptors)1 LinkStateAttribute (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev171207.linkstate.path.attribute.LinkStateAttribute)1 LinkAttributes (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev171207.linkstate.path.attribute.link.state.attribute.link.attributes._case.LinkAttributes)1 Attributes1 (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev171207.linkstate.routes.linkstate.routes.linkstate.route.Attributes1)1 IsisNodeCaseBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev171207.node.identifier.c.router.identifier.IsisNodeCaseBuilder)1 OspfNodeCaseBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev171207.node.identifier.c.router.identifier.OspfNodeCaseBuilder)1 IsisNodeBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev171207.node.identifier.c.router.identifier.isis.node._case.IsisNodeBuilder)1 OspfNodeBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev171207.node.identifier.c.router.identifier.ospf.node._case.OspfNodeBuilder)1