• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java ContainerNode类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.opendaylight.yangtools.yang.data.api.schema.ContainerNode的典型用法代码示例。如果您正苦于以下问题:Java ContainerNode类的具体用法?Java ContainerNode怎么用?Java ContainerNode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ContainerNode类属于org.opendaylight.yangtools.yang.data.api.schema包,在下文中一共展示了ContainerNode类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: writeInitialParent

import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode; //导入依赖的package包/类
private void writeInitialParent() {
    final ClientTransaction tx = history.createTransaction();

    final DOMDataTreeWriteCursor cursor = tx.openCursor();

    final ContainerNode root = ImmutableContainerNodeBuilder.create()
            .withNodeIdentifier(new NodeIdentifier(ClusterUtils.PREFIX_SHARDS_QNAME))
            .withChild(ImmutableMapNodeBuilder.create()
                    .withNodeIdentifier(new NodeIdentifier(ClusterUtils.SHARD_LIST_QNAME))
                    .build())
            .build();

    cursor.merge(ClusterUtils.PREFIX_SHARDS_PATH.getLastPathArgument(), root);
    cursor.close();

    final DOMStoreThreePhaseCommitCohort cohort = tx.ready();

    submitBlocking(cohort);
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:20,代码来源:PrefixedShardConfigWriter.java


示例2: verifyEntityCandidate

import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode; //导入依赖的package包/类
protected void verifyEntityCandidate(NormalizedNode<?, ?> node, String entityType,
        YangInstanceIdentifier entityId, String candidateName, boolean expectPresent) {
    try {
        assertNotNull("Missing " + EntityOwners.QNAME.toString(), node);
        assertTrue(node instanceof ContainerNode);

        ContainerNode entityOwnersNode = (ContainerNode) node;

        MapEntryNode entityTypeEntry = getMapEntryNodeChild(entityOwnersNode, EntityType.QNAME,
                ENTITY_TYPE_QNAME, entityType, true);

        MapEntryNode entityEntry = getMapEntryNodeChild(entityTypeEntry, ENTITY_QNAME, ENTITY_ID_QNAME,
                entityId, true);

        getMapEntryNodeChild(entityEntry, Candidate.QNAME, CANDIDATE_NAME_QNAME, candidateName, expectPresent);
    } catch (AssertionError e) {
        throw new AssertionError("Verification of entity candidate failed - returned data was: " + node, e);
    }
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:20,代码来源:AbstractEntityOwnershipTest.java


示例3: testMergeWithInvalidChildNodeNames

import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode; //导入依赖的package包/类
@Test
public void testMergeWithInvalidChildNodeNames() throws DataValidationFailedException {
    ContainerNode augContainer = ImmutableContainerNodeBuilder.create().withNodeIdentifier(
            new YangInstanceIdentifier.NodeIdentifier(AUG_CONTAINER)).withChild(
                    ImmutableNodes.containerNode(AUG_INNER_CONTAINER)).build();

    DataContainerChild<?, ?> outerNode = outerNode(outerNodeEntry(1, innerNode("one", "two")));
    ContainerNode normalizedNode = ImmutableContainerNodeBuilder.create()
            .withNodeIdentifier(new YangInstanceIdentifier.NodeIdentifier(TEST_QNAME)).withChild(outerNode)
            .withChild(augContainer).withChild(ImmutableNodes.leafNode(AUG_QNAME, "aug")).build();

    YangInstanceIdentifier path = TestModel.TEST_PATH;

    pruningDataTreeModification.merge(path, normalizedNode);

    dataTree.commit(getCandidate());

    ContainerNode prunedNode = ImmutableContainerNodeBuilder.create().withNodeIdentifier(
            new YangInstanceIdentifier.NodeIdentifier(TEST_QNAME)).withChild(outerNode).build();

    Optional<NormalizedNode<?, ?>> actual = dataTree.takeSnapshot().readNode(path);
    assertEquals("After pruning present", true, actual.isPresent());
    assertEquals("After pruning", prunedNode, actual.get());
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:25,代码来源:PruningDataTreeModificationTest.java


示例4: testWriteWithInvalidChildNodeNames

import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode; //导入依赖的package包/类
@Test
public void testWriteWithInvalidChildNodeNames() throws DataValidationFailedException {
    ContainerNode augContainer = ImmutableContainerNodeBuilder.create().withNodeIdentifier(
            new YangInstanceIdentifier.NodeIdentifier(AUG_CONTAINER)).withChild(
                    ImmutableNodes.containerNode(AUG_INNER_CONTAINER)).build();

    DataContainerChild<?, ?> outerNode = outerNode(outerNodeEntry(1, innerNode("one", "two")));
    ContainerNode normalizedNode = ImmutableContainerNodeBuilder.create()
            .withNodeIdentifier(new YangInstanceIdentifier.NodeIdentifier(TEST_QNAME)).withChild(outerNode)
            .withChild(augContainer).withChild(ImmutableNodes.leafNode(AUG_QNAME, "aug"))
            .withChild(ImmutableNodes.leafNode(NAME_QNAME, "name")).build();

    YangInstanceIdentifier path = TestModel.TEST_PATH;

    pruningDataTreeModification.write(path, normalizedNode);

    dataTree.commit(getCandidate());

    ContainerNode prunedNode = ImmutableContainerNodeBuilder.create()
            .withNodeIdentifier(new YangInstanceIdentifier.NodeIdentifier(TEST_QNAME)).withChild(outerNode)
            .withChild(ImmutableNodes.leafNode(NAME_QNAME, "name")).build();

    Optional<NormalizedNode<?, ?>> actual = dataTree.takeSnapshot().readNode(path);
    assertEquals("After pruning present", true, actual.isPresent());
    assertEquals("After pruning", prunedNode, actual.get());
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:27,代码来源:PruningDataTreeModificationTest.java


示例5: createCrossShardContainer

import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode; //导入依赖的package包/类
private static ContainerNode createCrossShardContainer() {

        final MapEntryNode outerListEntry1 =
                ImmutableNodes.mapEntryBuilder(TestModel.OUTER_LIST_QNAME, TestModel.ID_QNAME, 1)
                        .withChild(createInnerMapNode(1))
                        .build();
        final MapEntryNode outerListEntry2 =
                ImmutableNodes.mapEntryBuilder(TestModel.OUTER_LIST_QNAME, TestModel.ID_QNAME, 2)
                        .withChild(createInnerMapNode(2))
                        .build();

        final MapNode outerList = ImmutableNodes.mapNodeBuilder(TestModel.OUTER_LIST_QNAME)
                .withChild(outerListEntry1)
                .withChild(outerListEntry2)
                .build();

        final ContainerNode testContainer = ImmutableContainerNodeBuilder.create()
                .withNodeIdentifier(new NodeIdentifier(TestModel.TEST_QNAME))
                .withChild(outerList)
                .build();

        return testContainer;
    }
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:24,代码来源:DistributedShardFrontendTest.java


示例6: testWritesIntoDefaultShard

import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode; //导入依赖的package包/类
@Test
public void testWritesIntoDefaultShard() throws Exception {
    initEmptyDatastores();

    final DOMDataTreeIdentifier configRoot =
            new DOMDataTreeIdentifier(LogicalDatastoreType.CONFIGURATION, YangInstanceIdentifier.EMPTY);

    final DOMDataTreeProducer producer = leaderShardFactory.createProducer(Collections.singleton(configRoot));

    final DOMDataTreeCursorAwareTransaction tx = producer.createTransaction(true);
    final DOMDataTreeWriteCursor cursor =
            tx.createCursor(new DOMDataTreeIdentifier(
                    LogicalDatastoreType.CONFIGURATION, YangInstanceIdentifier.EMPTY));
    Assert.assertNotNull(cursor);

    final ContainerNode test =
            ImmutableContainerNodeBuilder.create()
                    .withNodeIdentifier(new NodeIdentifier(TestModel.TEST_QNAME)).build();

    cursor.write(test.getIdentifier(), test);
    cursor.close();

    tx.submit().checkedGet();
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:25,代码来源:DistributedShardedDOMDataTreeTest.java


示例7: bindingRoutedRpcProvider_DomInvokerTest

import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode; //导入依赖的package包/类
@Test
public void bindingRoutedRpcProvider_DomInvokerTest() throws Exception {

    knockService//
            .registerPath(TestContext.class, BA_NODE_A_ID) //
            .registerPath(TestContext.class, BA_NODE_B_ID) //
            .setKnockKnockResult(knockResult(true, "open"));

    OpendaylightOfMigrationTestModelService baKnockInvoker =
            providerRegistry.getRpcService(OpendaylightOfMigrationTestModelService.class);
    assertNotSame(knockService, baKnockInvoker);

    KnockKnockInput knockKnockA = knockKnock(BA_NODE_A_ID) //
            .setQuestion("who's there?").build();

    ContainerNode knockKnockDom = toDomRpc(KNOCK_KNOCK_QNAME, knockKnockA);
    assertNotNull(knockKnockDom);
    DOMRpcResult domResult = biRpcInvoker.invokeRpc(KNOCK_KNOCK_PATH, knockKnockDom).get();
    assertNotNull(domResult);
    assertNotNull("DOM result is successful.", domResult.getResult());
    assertTrue("Bidning Add Flow RPC was captured.", knockService.getReceivedKnocks().containsKey(BA_NODE_A_ID));
    assertEquals(knockKnockA, knockService.getReceivedKnocks().get(BA_NODE_A_ID).iterator().next());
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:24,代码来源:CrossBrokerRpcTest.java


示例8: bindingRpcInvoker_DomRoutedProviderTest

import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode; //导入依赖的package包/类
@Test
public void bindingRpcInvoker_DomRoutedProviderTest() throws Exception {
    KnockKnockOutputBuilder builder = new KnockKnockOutputBuilder();
    builder.setAnswer("open");
    final KnockKnockOutput output = builder.build();

    provisionRegistry.registerRpcImplementation((rpc, input) -> {
        ContainerNode result = testContext.getCodec().getCodecFactory().toNormalizedNodeRpcData(output);
        return Futures.immediateCheckedFuture(new DefaultDOMRpcResult(result));
    }, DOMRpcIdentifier.create(KNOCK_KNOCK_PATH, BI_NODE_C_ID));

    OpendaylightOfMigrationTestModelService baKnockInvoker =
            providerRegistry.getRpcService(OpendaylightOfMigrationTestModelService.class);
    Future<RpcResult<KnockKnockOutput>> baResult = baKnockInvoker.knockKnock((knockKnock(BA_NODE_C_ID).setQuestion("Who's there?").build()));
    assertNotNull(baResult);
    assertEquals(output, baResult.get().getResult());
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:18,代码来源:CrossBrokerRpcTest.java


示例9: testExecuteRpc

import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode; //导入依赖的package包/类
@Test
public void testExecuteRpc() {
    new JavaTestKit(node1) {
        {

            final ContainerNode invokeRpcResult = makeRPCOutput("bar");
            final DOMRpcResult rpcResult = new DefaultDOMRpcResult(invokeRpcResult);
            when(domRpcService1.invokeRpc(eq(TEST_RPC_TYPE), Mockito.<NormalizedNode<?, ?>>any())).thenReturn(
                    Futures.<DOMRpcResult, DOMRpcException>immediateCheckedFuture(rpcResult));

            final ExecuteRpc executeMsg = ExecuteRpc.from(TEST_RPC_ID, null);

            rpcInvoker1.tell(executeMsg, getRef());

            final RpcResponse rpcResponse = expectMsgClass(duration("5 seconds"), RpcResponse.class);

            assertEquals(rpcResult.getResult(), rpcResponse.getResultNormalizedNode());
        }
    };
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:21,代码来源:RpcBrokerTest.java


示例10: testInvokeRpc

import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode; //导入依赖的package包/类
/**
 * This test method invokes and executes the remote rpc.
 */
@Test
public void testInvokeRpc() throws Exception {
    final ContainerNode rpcOutput = makeRPCOutput("bar");
    final DOMRpcResult rpcResult = new DefaultDOMRpcResult(rpcOutput);

    final NormalizedNode<?, ?> invokeRpcInput = makeRPCInput("foo");
    @SuppressWarnings({"unchecked", "rawtypes"})
    final ArgumentCaptor<NormalizedNode<?, ?>> inputCaptor =
            (ArgumentCaptor) ArgumentCaptor.forClass(NormalizedNode.class);

    when(domRpcService2.invokeRpc(eq(TEST_RPC_TYPE), inputCaptor.capture())).thenReturn(
            Futures.<DOMRpcResult, DOMRpcException>immediateCheckedFuture(rpcResult));

    final CheckedFuture<DOMRpcResult, DOMRpcException> frontEndFuture =
            remoteRpcImpl1.invokeRpc(TEST_RPC_ID, invokeRpcInput);
    assertTrue(frontEndFuture instanceof RemoteDOMRpcFuture);

    final DOMRpcResult result = frontEndFuture.checkedGet(5, TimeUnit.SECONDS);
    assertEquals(rpcOutput, result.getResult());
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:24,代码来源:RemoteRpcImplementationTest.java


示例11: testInvokeRpcWithNullInput

import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode; //导入依赖的package包/类
/**
 * This test method invokes and executes the remote rpc.
 */
@Test
public void testInvokeRpcWithNullInput() throws Exception {
    final ContainerNode rpcOutput = makeRPCOutput("bar");
    final DOMRpcResult rpcResult = new DefaultDOMRpcResult(rpcOutput);

    @SuppressWarnings({"unchecked", "rawtypes"})
    final ArgumentCaptor<NormalizedNode<?, ?>> inputCaptor =
            (ArgumentCaptor) ArgumentCaptor.forClass(NormalizedNode.class);

    when(domRpcService2.invokeRpc(eq(TEST_RPC_TYPE), inputCaptor.capture())).thenReturn(
            Futures.<DOMRpcResult, DOMRpcException>immediateCheckedFuture(rpcResult));

    final CheckedFuture<DOMRpcResult, DOMRpcException> frontEndFuture =
            remoteRpcImpl1.invokeRpc(TEST_RPC_ID, null);
    assertTrue(frontEndFuture instanceof RemoteDOMRpcFuture);

    final DOMRpcResult result = frontEndFuture.checkedGet(5, TimeUnit.SECONDS);
    assertEquals(rpcOutput, result.getResult());
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:23,代码来源:RemoteRpcImplementationTest.java


示例12: testInvokeRpcWithNoOutput

import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode; //导入依赖的package包/类
/**
 * This test method invokes and executes the remote rpc.
 */
@Test
public void testInvokeRpcWithNoOutput() throws Exception {
    final ContainerNode rpcOutput = null;
    final DOMRpcResult rpcResult = new DefaultDOMRpcResult(rpcOutput);

    final NormalizedNode<?, ?> invokeRpcInput = makeRPCInput("foo");
    @SuppressWarnings({"unchecked", "rawtypes"})
    final ArgumentCaptor<NormalizedNode<?, ?>> inputCaptor =
            (ArgumentCaptor) ArgumentCaptor.forClass(NormalizedNode.class);

    when(domRpcService2.invokeRpc(eq(TEST_RPC_TYPE), inputCaptor.capture())).thenReturn(
            Futures.<DOMRpcResult, DOMRpcException>immediateCheckedFuture(rpcResult));

    final CheckedFuture<DOMRpcResult, DOMRpcException> frontEndFuture =
            remoteRpcImpl1.invokeRpc(TEST_RPC_ID, invokeRpcInput);
    assertTrue(frontEndFuture instanceof RemoteDOMRpcFuture);

    final DOMRpcResult result = frontEndFuture.checkedGet(5, TimeUnit.SECONDS);
    assertNull(result.getResult());
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:24,代码来源:RemoteRpcImplementationTest.java


示例13: invokeRpc

import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode; //导入依赖的package包/类
@Nonnull
@Override
public CheckedFuture<DOMRpcResult, DOMRpcException> invokeRpc(@Nonnull DOMRpcIdentifier rpc, @Nullable NormalizedNode<?, ?> input) {
    LOG.debug("get-singleton-constant invoked, current value: {}", constant);

    final LeafNode<Object> value = ImmutableLeafNodeBuilder.create()
            .withNodeIdentifier(new NodeIdentifier(CONSTANT))
            .withValue(constant)
            .build();

    final ContainerNode result = ImmutableContainerNodeBuilder.create()
            .withNodeIdentifier(new NodeIdentifier(OUTPUT))
            .withChild(value)
            .build();

    return Futures.immediateCheckedFuture(new DefaultDOMRpcResult(result));
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:18,代码来源:SingletonGetConstantService.java


示例14: invokeRpc

import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode; //导入依赖的package包/类
@Nonnull
@Override
public CheckedFuture<DOMRpcResult, DOMRpcException> invokeRpc(@Nonnull final DOMRpcIdentifier rpc,
                                                              @Nullable final NormalizedNode<?, ?> input) {
    LOG.debug("get-contexted-constant invoked, current value: {}", constant);

    final LeafNode<Object> value = ImmutableLeafNodeBuilder.create()
            .withNodeIdentifier(new YangInstanceIdentifier.NodeIdentifier(CONSTANT))
            .withValue(constant)
            .build();

    final ContainerNode result = ImmutableContainerNodeBuilder.create()
            .withNodeIdentifier(new YangInstanceIdentifier.NodeIdentifier(OUTPUT))
            .withChild(value)
            .build();

    return Futures.immediateCheckedFuture(new DefaultDOMRpcResult(result));
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:19,代码来源:RoutedGetConstantService.java


示例15: invokeRpc

import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode; //导入依赖的package包/类
@Nonnull
@Override
public CheckedFuture<DOMRpcResult, DOMRpcException> invokeRpc(@Nonnull final DOMRpcIdentifier rpc,
                                                              @Nullable final NormalizedNode<?, ?> input) {
    LOG.debug("get-constant invoked, current value: {}", constant);

    final LeafNode<Object> value = ImmutableLeafNodeBuilder.create()
            .withNodeIdentifier(new NodeIdentifier(CONSTANT))
            .withValue(constant)
            .build();

    final ContainerNode result = ImmutableContainerNodeBuilder.create()
            .withNodeIdentifier(new NodeIdentifier(OUTPUT))
            .withChild(value)
            .build();

    return Futures.immediateCheckedFuture(new DefaultDOMRpcResult(result));
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:19,代码来源:GetConstantService.java


示例16: initDataTree

import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode; //导入依赖的package包/类
private static void initDataTree() {

        inMemoryDataTree = new InMemoryDataTreeFactory().create(DataTreeConfiguration.DEFAULT_OPERATIONAL, context);

        final DataTreeModification initialDataTreeModification = inMemoryDataTree.takeSnapshot().newModification();

        final ContainerSchemaNode chipsListContSchemaNode = (ContainerSchemaNode) mainModule.getDataChildByName(chips);
        final ContainerNode chipsContainer = createChipsContainer(chipsListContSchemaNode);
        final YangInstanceIdentifier path1 = YangInstanceIdentifier.of(chips);
        initialDataTreeModification.write(path1, chipsContainer);

        final ContainerSchemaNode devTypesListContSchemaNode = (ContainerSchemaNode) mainModule
                .getDataChildByName(deviceTypeStr);
        final ContainerNode deviceTypesContainer = createDevTypeStrContainer(devTypesListContSchemaNode);
        final YangInstanceIdentifier path2 = YangInstanceIdentifier.of(deviceTypeStr);
        initialDataTreeModification.write(path2, deviceTypesContainer);

        initialDataTreeModification.ready();
        final DataTreeCandidate writeChipsCandidate = inMemoryDataTree.prepare(initialDataTreeModification);

        inMemoryDataTree.commit(writeChipsCandidate);

        LOG.debug("{}", inMemoryDataTree);
    }
 
开发者ID:opendaylight,项目名称:yangtools,代码行数:25,代码来源:DataTreeCandidateValidatorTest2.java


示例17: loadConfiguration

import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode; //导入依赖的package包/类
@Override
public synchronized void loadConfiguration(final NormalizedNode<?, ?> dto) {
    final ContainerNode protocolsContainer = (ContainerNode) dto;
    final MapNode protocolList = (MapNode) protocolsContainer.getChild(protocolYIId.getLastPathArgument()).get();
    final Collection<MapEntryNode> protocolsCollection = protocolList.getValue();
    final WriteTransaction wtx = this.dataBroker.newWriteOnlyTransaction();
    for (final MapEntryNode protocolEntry : protocolsCollection) {
        final Map.Entry<InstanceIdentifier<?>, DataObject> bi = this.bindingSerializer
                .fromNormalizedNode(this.protocolYIId, protocolEntry);
        if (bi != null) {
            final Protocol protocol = (Protocol) bi.getValue();
            processProtocol(protocol, wtx);
        }
    }
    try {
        wtx.submit().get();
    } catch (final ExecutionException | InterruptedException e) {
        LOG.warn("Failed to create Protocol", e);
    }
}
 
开发者ID:opendaylight,项目名称:bgpcep,代码行数:21,代码来源:ProtocolsConfigFileProcessor.java


示例18: loadConfiguration

import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode; //导入依赖的package包/类
@Override
public synchronized void loadConfiguration(final NormalizedNode<?, ?> dto) {
    final ContainerNode networkTopologyContainer = (ContainerNode) dto;
    final MapNode topologyList = (MapNode) networkTopologyContainer.getChild(
            this.topologyYii.getLastPathArgument()).get();
    final Collection<MapEntryNode> networkTopology = topologyList.getValue();
    if (networkTopology.isEmpty()) {
        return;
    }
    final WriteTransaction wtx = this.dataBroker.newWriteOnlyTransaction();

    for (final MapEntryNode topologyEntry : networkTopology) {
        final Map.Entry<InstanceIdentifier<?>, DataObject> bi =
                this.bindingSerializer.fromNormalizedNode(this.topologyYii, topologyEntry);
        if (bi != null) {
            processTopology((Topology) bi.getValue(), wtx);
        }
    }
    try {
        wtx.submit().get();
    } catch (final ExecutionException | InterruptedException e) {
        LOG.warn("Failed to create Network Topologies", e);
    }
}
 
开发者ID:opendaylight,项目名称:bgpcep,代码行数:25,代码来源:NetworkTopologyConfigFileProcessor.java


示例19: parserTest

import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode; //导入依赖的package包/类
@Test
public void parserTest() {
    final EsRouteCase expected = new EsRouteCaseBuilder().setEsRoute(new EsRouteBuilder()
            .setEsi(LAN_AUT_GEN_CASE).setOrigRouteIp(IP).build()).build();
    assertArrayEquals(RESULT, ByteArray.getAllBytes(this.parser.serializeEvpn(expected,
            Unpooled.wrappedBuffer(ROUDE_DISTIN))));

    final EvpnChoice result = this.parser.parseEvpn(Unpooled.wrappedBuffer(VALUE));
    assertEquals(expected, result);

    final DataContainerNodeBuilder<YangInstanceIdentifier.NodeIdentifier, ChoiceNode> choice = Builders
            .choiceBuilder();
    choice.withNodeIdentifier(EthSegRParser.ES_ROUTE_NID);
    final ContainerNode arbitraryC = createContBuilder(EthSegRParser.ES_ROUTE_NID)
            .addChild(LanParserTest.createLanChoice())
            .addChild(createValueBuilder(IP_MODEL, ORI_NID).build()).build();
    final EvpnChoice modelResult = this.parser.serializeEvpnModel(arbitraryC);
    assertEquals(expected, modelResult);

    final EvpnChoice keyResult = this.parser.createRouteKey(arbitraryC);
    assertEquals(expected, keyResult);
}
 
开发者ID:opendaylight,项目名称:bgpcep,代码行数:23,代码来源:EthSegRParserTest.java


示例20: processDestination

import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode; //导入依赖的package包/类
@Override
protected void processDestination(final DOMDataWriteTransaction tx, final YangInstanceIdentifier routesPath,
    final ContainerNode destination, final ContainerNode attributes, final ApplyRoute function) {
    if (destination != null) {
        final Optional<DataContainerChild<? extends PathArgument, ?>> maybeRoutes = destination
                .getChild(NLRI_ROUTES_LIST);
        if (maybeRoutes.isPresent()) {
            final DataContainerChild<? extends PathArgument, ?> routes = maybeRoutes.get();
            if (routes instanceof UnkeyedListNode) {
                final YangInstanceIdentifier base = routesPath.node(routesContainerIdentifier()).node(routeNid());
                for (final UnkeyedListEntryNode e : ((UnkeyedListNode) routes).getValue()) {
                    final NodeIdentifierWithPredicates routeKey = createRouteKey(e);
                    function.apply(tx, base, routeKey, e, attributes);
                }
            } else {
                LOG.warn("Routes {} are not a map", routes);
            }
        }
    }
}
 
开发者ID:opendaylight,项目名称:bgpcep,代码行数:21,代码来源:EvpnRibSupport.java



注:本文中的org.opendaylight.yangtools.yang.data.api.schema.ContainerNode类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java MixedPrincipalException类代码示例发布时间:2022-05-23
下一篇:
Java Mode类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap