Search in sources :

Example 26 with NodeIdentifier

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev171207.NodeIdentifier in project bgpcep by opendaylight.

the class NodeNlriParser method parseObjectType.

@Override
protected ObjectType parseObjectType(final ByteBuf buffer) {
    final NodeCaseBuilder builder = new NodeCaseBuilder();
    builder.setNodeDescriptors(new NodeDescriptorsBuilder((org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev171207.NodeIdentifier) SimpleNlriTypeRegistry.getInstance().parseTlv(buffer)).build());
    return builder.build();
}
Also used : NodeCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev171207.linkstate.object.type.NodeCaseBuilder) IsisNodeCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev171207.node.identifier.c.router.identifier.IsisNodeCaseBuilder) OspfNodeCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev171207.node.identifier.c.router.identifier.OspfNodeCaseBuilder) AdvertisingNodeDescriptorsBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev171207.linkstate.object.type.prefix._case.AdvertisingNodeDescriptorsBuilder) LocalNodeDescriptorsBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev171207.linkstate.object.type.link._case.LocalNodeDescriptorsBuilder) NodeDescriptorsBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev171207.linkstate.object.type.node._case.NodeDescriptorsBuilder) RemoteNodeDescriptorsBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev171207.linkstate.object.type.link._case.RemoteNodeDescriptorsBuilder)

Example 27 with NodeIdentifier

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev171207.NodeIdentifier in project bgpcep by opendaylight.

the class AbstractNodeDescriptorTlvCodec method parseNodeDescriptor.

protected static NodeIdentifier parseNodeDescriptor(final ByteBuf value, final Map<QName, Object> parsedSubTlvs) {
    parsedSubTlvs.putAll(SimpleNlriTypeRegistry.getInstance().parseSubTlvs(value));
    final AsNumber asNumber = (AsNumber) parsedSubTlvs.get(AsNumTlvParser.AS_NUMBER_QNAME);
    final DomainIdentifier domainId = (DomainIdentifier) parsedSubTlvs.get(DomainIdTlvParser.DOMAIN_ID_QNAME);
    final AreaIdentifier areaId = (AreaIdentifier) parsedSubTlvs.get(AreaIdTlvParser.AREA_ID_QNAME);
    final CRouterIdentifier routerId = (CRouterIdentifier) parsedSubTlvs.get(CRouterIdentifier.QNAME);
    return new NodeIdentifier() {

        @Override
        public Class<? extends DataContainer> getImplementedInterface() {
            return NodeIdentifier.class;
        }

        @Override
        public AsNumber getAsNumber() {
            return asNumber;
        }

        @Override
        public DomainIdentifier getDomainId() {
            return domainId;
        }

        @Override
        public AreaIdentifier getAreaId() {
            return areaId;
        }

        @Override
        public CRouterIdentifier getCRouterIdentifier() {
            return routerId;
        }
    };
}
Also used : CRouterIdentifier(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev171207.node.identifier.CRouterIdentifier) AreaIdentifier(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev171207.AreaIdentifier) NodeIdentifier(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev171207.NodeIdentifier) AsNumber(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.AsNumber) DomainIdentifier(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev171207.DomainIdentifier)

Example 28 with NodeIdentifier

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev171207.NodeIdentifier in project openflowplugin by opendaylight.

the class OpenflowpluginTestServiceProvider method register.

public ObjectRegistration<OpenflowpluginTestServiceProvider> register(final ProviderContext ctx) {
    RoutedRpcRegistration<SalFlowService> addRoutedRpcImplementation = ctx.<SalFlowService>addRoutedRpcImplementation(SalFlowService.class, this);
    setFlowRegistration(addRoutedRpcImplementation);
    InstanceIdentifierBuilder<Nodes> builderII = InstanceIdentifier.<Nodes>builder(Nodes.class);
    NodeId nodeId = new NodeId(OpenflowpluginTestActivator.NODE_ID);
    NodeKey nodeKey = new NodeKey(nodeId);
    InstanceIdentifierBuilder<Node> nodeIdentifier = builderII.<Node, NodeKey>child(Node.class, nodeKey);
    InstanceIdentifier<Node> instance = nodeIdentifier.build();
    flowRegistration.registerPath(NodeContext.class, instance);
    RoutedRpcRegistration<SalFlowService> flowRegistration2 = getFlowRegistration();
    return new AbstractObjectRegistration<OpenflowpluginTestServiceProvider>(this) {

        @Override
        protected void removeRegistration() {
            flowRegistration2.close();
        }
    };
}
Also used : AbstractObjectRegistration(org.opendaylight.yangtools.concepts.AbstractObjectRegistration) SalFlowService(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.SalFlowService) Node(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node) NodeId(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId) NodeKey(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey) Nodes(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes)

Example 29 with NodeIdentifier

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev171207.NodeIdentifier in project genius by opendaylight.

the class HwVTEPConfigListener method add.

@Override
public void add(@Nonnull Interface newInterface) {
    // HwVTEPs support only VXLAN
    IfTunnel ifTunnel = newInterface.getAugmentation(IfTunnel.class);
    if (ifTunnel != null && ifTunnel.getTunnelInterfaceType().isAssignableFrom(TunnelTypeVxlan.class)) {
        ParentRefs parentRefs = newInterface.getAugmentation(ParentRefs.class);
        if (parentRefs != null && parentRefs.getNodeIdentifier() != null) {
            LOG.debug("Received HwVTEP Interface Add Event: {}", newInterface.getName());
            LOG.trace("Received HwVTEP Interface Add Event: {}", newInterface);
            for (NodeIdentifier nodeIdentifier : parentRefs.getNodeIdentifier()) {
                if (SouthboundUtils.HWVTEP_TOPOLOGY.equals(nodeIdentifier.getTopologyId())) {
                    coordinator.enqueueJob(newInterface.getName(), () -> HwVTEPInterfaceConfigAddHelper.addConfiguration(txRunner, createPhysicalSwitchInstanceIdentifier(nodeIdentifier.getNodeId()), createGlobalNodeInstanceIdentifier(nodeIdentifier.getNodeId()), newInterface, ifTunnel), IfmConstants.JOB_MAX_RETRIES);
                }
            }
        }
    }
}
Also used : ParentRefs(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rev160406.ParentRefs) NodeIdentifier(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rev160406.interfaces._interface.NodeIdentifier) IfTunnel(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rev160406.IfTunnel) TunnelTypeVxlan(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rev160406.TunnelTypeVxlan)

Example 30 with NodeIdentifier

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev171207.NodeIdentifier in project genius by opendaylight.

the class HwVTEPConfigListener method update.

@Override
public void update(@Nonnull Interface originalInterface, @Nonnull Interface updatedInterface) {
    // HwVTEPs support only VXLAN
    IfTunnel ifTunnel = originalInterface.getAugmentation(IfTunnel.class);
    if (ifTunnel != null && ifTunnel.getTunnelInterfaceType().isAssignableFrom(TunnelTypeVxlan.class)) {
        ParentRefs parentRefs = originalInterface.getAugmentation(ParentRefs.class);
        if (parentRefs != null && parentRefs.getNodeIdentifier() != null) {
            LOG.debug("Received HwVTEP Interface Update Event: {}", originalInterface.getName());
            LOG.trace("Received HwVTEP Interface Update Event: updatedInterface: {}, OriginalInterface: {}", updatedInterface, originalInterface);
            for (NodeIdentifier nodeIdentifier : parentRefs.getNodeIdentifier()) {
                if (SouthboundUtils.HWVTEP_TOPOLOGY.equals(nodeIdentifier.getTopologyId())) {
                    coordinator.enqueueJob(originalInterface.getName(), () -> HwVTEPInterfaceConfigUpdateHelper.updateConfiguration(txRunner, createPhysicalSwitchInstanceIdentifier(nodeIdentifier.getNodeId()), createGlobalNodeInstanceIdentifier(nodeIdentifier.getNodeId()), updatedInterface, ifTunnel), IfmConstants.JOB_MAX_RETRIES);
                }
            }
        }
    }
}
Also used : ParentRefs(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rev160406.ParentRefs) NodeIdentifier(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rev160406.interfaces._interface.NodeIdentifier) IfTunnel(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rev160406.IfTunnel) TunnelTypeVxlan(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rev160406.TunnelTypeVxlan)

Aggregations

NodeIdentifier (org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier)19 Test (org.junit.Test)13 ContainerNode (org.opendaylight.yangtools.yang.data.api.schema.ContainerNode)13 ByteBuf (io.netty.buffer.ByteBuf)7 ChoiceNode (org.opendaylight.yangtools.yang.data.api.schema.ChoiceNode)7 UnkeyedListEntryNode (org.opendaylight.yangtools.yang.data.api.schema.UnkeyedListEntryNode)7 BigInteger (java.math.BigInteger)4 AsNumber (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.AsNumber)4 IfTunnel (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rev160406.IfTunnel)4 ImmutableLeafNodeBuilder (org.opendaylight.yangtools.yang.data.impl.schema.builder.impl.ImmutableLeafNodeBuilder)4 ParentRefs (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rev160406.ParentRefs)3 TunnelTypeVxlan (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rev160406.TunnelTypeVxlan)3 NodeIdentifier (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rev160406.interfaces._interface.NodeIdentifier)3 Esi (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev171213.esi.Esi)3 DomainIdentifier (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev171207.DomainIdentifier)3 CRouterIdentifier (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev171207.node.identifier.CRouterIdentifier)3 ArrayList (java.util.ArrayList)2 TimeoutException (java.util.concurrent.TimeoutException)2 Before (org.junit.Before)2 TransactionCommitFailedException (org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException)2