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

Java NodeKey类代码示例

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

本文整理汇总了Java中org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeKey的典型用法代码示例。如果您正苦于以下问题:Java NodeKey类的具体用法?Java NodeKey怎么用?Java NodeKey使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



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

示例1: registerEventSourceTest

import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeKey; //导入依赖的package包/类
@Test
public void registerEventSourceTest() throws Exception {
    topicTestHelper();
    Node nodeMock = mock(Node.class);
    EventSource eventSourceMock = mock(EventSource.class);
    NodeId nodeId = new NodeId("nodeIdValue1");
    nodeKey = new NodeKey(nodeId);
    doReturn(nodeKey).when(nodeMock).getKey();
    doReturn(nodeKey).when(eventSourceMock).getSourceNodeKey();
    BindingAwareBroker.RoutedRpcRegistration routedRpcRegistrationMock = mock(BindingAwareBroker.RoutedRpcRegistration.class);
    doReturn(routedRpcRegistrationMock).when(rpcProviderRegistryMock).addRoutedRpcImplementation(EventSourceService.class, eventSourceMock);
    doNothing().when(routedRpcRegistrationMock).registerPath(eq(NodeContext.class), any(KeyedInstanceIdentifier.class));
    assertNotNull("Return value has not been created correctly.", eventSourceTopology.registerEventSource(eventSourceMock));
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:15,代码来源:EventSourceTopologyTest.java


示例2: buildNodeAttribute

import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeKey; //导入依赖的package包/类
private void buildNodeAttribute(NodeBuilder builder, ComposeFabricInput input, FabricId fabricId) {

        builder.setKey(new NodeKey(fabricId));

        List<DeviceNodes> devices = input.getDeviceNodes();
        if (devices != null) {
            List<SupportingNode> snodes = Lists.newArrayList();
            for (DeviceNodes device : devices) {
                InstanceIdentifier<?> nodeRef = device.getDeviceRef().getValue();
                NodeId nodeid = nodeRef.firstKeyOf(Node.class).getNodeId();
                TopologyId topoId = nodeRef.firstKeyOf(Topology.class).getTopologyId();

                SupportingNodeBuilder snodeBuilder = new SupportingNodeBuilder();
                snodeBuilder.setNodeRef(nodeid);
                snodeBuilder.setTopologyRef(topoId);
                snodeBuilder.setKey(new SupportingNodeKey(nodeid, topoId));
                snodes.add(snodeBuilder.build());
            }
            builder.setSupportingNode(snodes);
        }
    }
 
开发者ID:opendaylight,项目名称:faas,代码行数:22,代码来源:FabricManagementAPIProvider.java


示例3: createBasicNode

import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeKey; //导入依赖的package包/类
public static Node createBasicNode(String nodeIdStr) {
    NodeId nodeId = new NodeId(nodeIdStr);
    NodeKey nodeKey = new NodeKey(nodeId);
    NodeBuilder nodeBuilder = new NodeBuilder();
    nodeBuilder.setKey(nodeKey);
    nodeBuilder.setNodeId(nodeId);
    List<SupportingNode> childNodeList = new ArrayList<>();
    nodeBuilder.setSupportingNode(childNodeList);
    List<TerminationPoint> ports = new ArrayList<>();
    TerminationPoint tpWest = createTp(VC_NODE_TP_WEST);
    ports.add(tpWest);
    TerminationPoint tpEast = createTp(VC_NODE_TP_EAST);
    ports.add(tpEast);
    nodeBuilder.setTerminationPoint(ports);

    return nodeBuilder.build();
}
 
开发者ID:opendaylight,项目名称:faas,代码行数:18,代码来源:FabMgrYangDataUtil.java


示例4: testPutCreateParentsSuccess

import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeKey; //导入依赖的package包/类
@Test
public void testPutCreateParentsSuccess() throws Exception {
    InstanceIdentifier<Node> iid = InstanceIdentifier.builder(NetworkTopology.class)
        .child(Topology.class, new TopologyKey(new TopologyId("topology-netconf")))
        .child(Node.class, new NodeKey(new NodeId(NODE_ID)))
        .build();
    Node node1 =
        createNetconfNode(NODE_ID, V3PO_1704_CAPABILITY, V3PO_1701_CAPABILITY, INTERFACES);
    WriteTransaction writeTx = getDataBroker().newWriteOnlyTransaction();
    writeTx.put(LogicalDatastoreType.OPERATIONAL, iid, node1, true);
    writeTx.submit().get();
    Assert.assertEquals(sf.get(), Integer.valueOf(1));
    sf = SettableFuture.create();
    writeTx = getDataBroker().newWriteOnlyTransaction();
    writeTx.delete(LogicalDatastoreType.OPERATIONAL, iid);
    writeTx.submit().get();
    Assert.assertEquals(sf.get(), Integer.valueOf(2));
}
 
开发者ID:opendaylight,项目名称:neutron,代码行数:19,代码来源:NeutronHostconfigVppListenerTest.java


示例5: createTP

import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeKey; //导入依赖的package包/类
private InstanceIdentifier<TerminationPoint> createTP(final IpAddress addr, final InstanceIdentifier<Node> sni,
        final Boolean inControl, final ReadWriteTransaction trans) {
    final String url = "ip://" + addr.toString();
    final TerminationPointKey tpk = new TerminationPointKey(new TpId(url));
    final TerminationPointBuilder tpb = new TerminationPointBuilder();
    tpb.setKey(tpk).setTpId(tpk.getTpId());
    tpb.addAugmentation(TerminationPoint1.class, new TerminationPoint1Builder().setIgpTerminationPointAttributes(
            new IgpTerminationPointAttributesBuilder().setTerminationPointType(
                    new IpBuilder().setIpAddress(Lists.newArrayList(addr)).build()).build()).build());

    final NodeKey nk = new NodeKey(new NodeId(url));
    final NodeBuilder nb = new NodeBuilder();
    nb.setKey(nk).setNodeId(nk.getNodeId());
    nb.setTerminationPoint(Lists.newArrayList(tpb.build()));
    if (sni != null) {
        nb.setSupportingNode(Lists.newArrayList(createSupportingNode(InstanceIdentifier.keyOf(sni).getNodeId(),
                inControl)));
    }
    final InstanceIdentifier<Node> nid = this.target.child(Node.class, nb.getKey());
    trans.put(LogicalDatastoreType.OPERATIONAL, nid, nb.build());
    return nid.child(TerminationPoint.class, tpb.getKey());
}
 
开发者ID:opendaylight,项目名称:bgpcep,代码行数:23,代码来源:NodeChangedListener.java


示例6: createNode

import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeKey; //导入依赖的package包/类
private static Node createNode(final NodeId nodeId, final TpId tpId, final String ipv4Address) {
    final TerminationPointBuilder tpBuilder = new TerminationPointBuilder();
    tpBuilder.setTpId(tpId);
    tpBuilder.setKey(new TerminationPointKey(tpId));
    tpBuilder.addAugmentation(TerminationPoint1.class, new TerminationPoint1Builder()
            .setIgpTerminationPointAttributes(new IgpTerminationPointAttributesBuilder()
                    .setTerminationPointType(new IpBuilder()
                            .setIpAddress(Collections.singletonList(new IpAddress(new Ipv4Address(ipv4Address))))
                            .build()).build()).build());
    final NodeBuilder nodeBuilder = new NodeBuilder();
    nodeBuilder.setNodeId(nodeId);
    nodeBuilder.setKey(new NodeKey(nodeId));
    nodeBuilder.setTerminationPoint(Lists.newArrayList(tpBuilder.build()));
    final SupportingNode supportingNode = new SupportingNodeBuilder()
            .setKey(new SupportingNodeKey(nodeId, new TopologyId("dummy")))
            .addAugmentation(SupportingNode1.class, new SupportingNode1Builder()
                    .setPathComputationClient(new PathComputationClientBuilder()
                            .setControlling(true).build()).build()).build();
    nodeBuilder.setSupportingNode(Lists.newArrayList(supportingNode));
    return nodeBuilder.build();
}
 
开发者ID:opendaylight,项目名称:bgpcep,代码行数:22,代码来源:TunnelProgrammingTest.java


示例7: removePrefix

import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeKey; //导入依赖的package包/类
private void removePrefix(final WriteTransaction trans, final UriBuilder base, final PrefixCase prefixCase) {
    final NodeId node = buildNodeId(base, prefixCase.getAdvertisingNodeDescriptors());
    final NodeHolder nh = this.nodes.get(node);
    if (nh != null) {
        LOG.debug("Removed prefix {}", prefixCase);
        final InstanceIdentifier<Node> nid = getNodeInstanceIdentifier(new NodeKey(nh.getNodeId()));
        final InstanceIdentifier<IgpNodeAttributes> inaId = nid.builder().augmentation(Node1.class)
                .child(IgpNodeAttributes.class).build();
        final IpPrefix ippfx = prefixCase.getPrefixDescriptors().getIpReachabilityInformation();
        if (ippfx == null) {
            LOG.warn("IP reachability not present in prefix {}, skipping it", prefixCase);
            return;
        }
        final PrefixKey pk = new PrefixKey(ippfx);
        trans.delete(LogicalDatastoreType.OPERATIONAL, inaId.child(Prefix.class, pk));
        nh.removePrefix(prefixCase);
        checkNodeForRemoval(trans, nh);
    } else {
        LOG.warn("Removing prefix from non-existing node {}", node);
    }
}
 
开发者ID:opendaylight,项目名称:bgpcep,代码行数:22,代码来源:LinkstateTopologyBuilder.java


示例8: ensureNodePresent

import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeKey; //导入依赖的package包/类
private InstanceIdentifier<IgpNodeAttributes> ensureNodePresent(final ReadWriteTransaction trans, final NodeId ni) {
    final NodeUsage present = this.nodes.get(ni);
    if (present != null) {
        return present.attrId;
    }

    final KeyedInstanceIdentifier<Node, NodeKey> nii = nodeInstanceId(ni);
    final InstanceIdentifier<IgpNodeAttributes> ret = nii.builder().augmentation(Node1.class)
            .child(IgpNodeAttributes.class).build();

    trans.merge(LogicalDatastoreType.OPERATIONAL, nii, new NodeBuilder().setKey(nii.getKey()).setNodeId(ni)
        .addAugmentation(Node1.class, new Node1Builder().setIgpNodeAttributes(
            new IgpNodeAttributesBuilder().setPrefix(Collections.emptyList()).build()).build()).build());

    this.nodes.put(ni, new NodeUsage(ret));
    return ret;
}
 
开发者ID:opendaylight,项目名称:bgpcep,代码行数:18,代码来源:AbstractReachabilityTopologyBuilder.java


示例9: getInstanceIdentifier

import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeKey; //导入依赖的package包/类
public static InstanceIdentifier<Node> getInstanceIdentifier(InstanceIdentifierCodec instanceIdentifierCodec,
        OpenVSwitch ovs) {
    if (ovs.getExternalIdsColumn() != null
            && ovs.getExternalIdsColumn().getData() != null
            && ovs.getExternalIdsColumn().getData().containsKey(SouthboundConstants.IID_EXTERNAL_ID_KEY)) {
        String iidString = ovs.getExternalIdsColumn().getData().get(SouthboundConstants.IID_EXTERNAL_ID_KEY);
        return (InstanceIdentifier<Node>) instanceIdentifierCodec.bindingDeserializerOrNull(iidString);
    } else {
        String nodeString = SouthboundConstants.OVSDB_URI_PREFIX + "://" + SouthboundConstants.UUID + "/"
                + ovs.getUuid().toString();
        NodeId nodeId = new NodeId(new Uri(nodeString));
        NodeKey nodeKey = new NodeKey(nodeId);
        return InstanceIdentifier.builder(NetworkTopology.class)
                .child(Topology.class,new TopologyKey(SouthboundConstants.OVSDB_TOPOLOGY_ID))
                .child(Node.class,nodeKey)
                .build();
    }
}
 
开发者ID:opendaylight,项目名称:ovsdb,代码行数:19,代码来源:SouthboundMapper.java


示例10: getBridge

import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeKey; //导入依赖的package包/类
private OvsdbBridgeAugmentation getBridge(InstanceIdentifier<OvsdbNodeAugmentation> key,
        Uri bridgeUri) {
    final InstanceIdentifier<OvsdbBridgeAugmentation> bridgeIid = InstanceIdentifier
            .create(NetworkTopology.class)
            .child(Topology.class, new TopologyKey(SouthboundConstants.OVSDB_TOPOLOGY_ID))
            .child(Node.class, new NodeKey(new NodeId(bridgeUri)))
            .augmentation(OvsdbBridgeAugmentation.class);

    OvsdbBridgeAugmentation bridge = null;
    try (ReadOnlyTransaction transaction = SouthboundProvider.getDb().newReadOnlyTransaction()) {
        final Optional<OvsdbBridgeAugmentation> bridgeOptional =
                transaction.read(LogicalDatastoreType.OPERATIONAL, bridgeIid).get();
        if (bridgeOptional.isPresent()) {
            bridge = bridgeOptional.get();
        }
    } catch (InterruptedException | ExecutionException e) {
        LOG.warn("Error reading from datastore", e);
    }
    return bridge;
}
 
开发者ID:opendaylight,项目名称:ovsdb,代码行数:21,代码来源:AutoAttachUpdateCommand.java


示例11: getControllerEntryIid

import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeKey; //导入依赖的package包/类
/**
 * Create the {@link InstanceIdentifier} for the {@link ControllerEntry}.
 *
 * @param controllerEntry the {@link ControllerEntry}
 * @param bridgeName the name of the bridge
 * @return the {@link InstanceIdentifier}
 */
private InstanceIdentifier<ControllerEntry> getControllerEntryIid(
        ControllerEntry controllerEntry, String bridgeName) {

    OvsdbConnectionInstance client = getOvsdbConnectionInstance();
    String nodeString = client.getNodeKey().getNodeId().getValue()
            + "/bridge/" + bridgeName;
    NodeId nodeId = new NodeId(new Uri(nodeString));
    NodeKey nodeKey = new NodeKey(nodeId);
    InstanceIdentifier<Node> bridgeIid = InstanceIdentifier.builder(NetworkTopology.class)
            .child(Topology.class,new TopologyKey(SouthboundConstants.OVSDB_TOPOLOGY_ID))
            .child(Node.class,nodeKey)
            .build();

    return bridgeIid
            .augmentation(OvsdbBridgeAugmentation.class)
            .child(ControllerEntry.class, controllerEntry.getKey());
}
 
开发者ID:opendaylight,项目名称:ovsdb,代码行数:25,代码来源:OvsdbControllerUpdateCommand.java


示例12: getManagerEntryIid

import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeKey; //导入依赖的package包/类
/**
 * Create the {@link InstanceIdentifier} for the {@link ManagerEntry}.
 *
 * @param managerEntry the {@link ManagerEntry}
 * @return the {@link InstanceIdentifier}
 */
private InstanceIdentifier<ManagerEntry> getManagerEntryIid(ManagerEntry managerEntry) {

    OvsdbConnectionInstance client = getOvsdbConnectionInstance();
    String nodeString = client.getNodeKey().getNodeId().getValue();
    NodeId nodeId = new NodeId(new Uri(nodeString));
    NodeKey nodeKey = new NodeKey(nodeId);
    InstanceIdentifier<Node> ovsdbNodeIid = InstanceIdentifier.builder(NetworkTopology.class)
            .child(Topology.class,new TopologyKey(SouthboundConstants.OVSDB_TOPOLOGY_ID))
            .child(Node.class,nodeKey)
            .build();

    return ovsdbNodeIid
            .augmentation(OvsdbNodeAugmentation.class)
            .child(ManagerEntry.class, managerEntry.getKey());
}
 
开发者ID:opendaylight,项目名称:ovsdb,代码行数:22,代码来源:OvsdbManagersUpdateCommand.java


示例13: testRemoveOldConfigs

import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeKey; //导入依赖的package包/类
@Test
public void testRemoveOldConfigs() throws Exception {
    ReadWriteTransaction transaction = mock(ReadWriteTransaction.class);
    Map<String, String> oldOtherConfigs = new HashMap<>();
    oldOtherConfigs.put("OpenvswitchOtherConfigsKey", "OpenvswitchOtherConfigsValue");
    doNothing().when(transaction).delete(any(LogicalDatastoreType.class), any(KeyedInstanceIdentifier.class));

    //suppress getNodeId()
    MemberModifier.suppress(
            MemberMatcher.method(OpenVSwitchUpdateCommand.class, "getNodeId", OpenVSwitch.class));
    PowerMockito.whenNew(NodeKey.class).withAnyArguments().thenReturn(mock(NodeKey.class));
    OpenVSwitch ovs = mock(OpenVSwitch.class);
    Whitebox.invokeMethod(openVSwitchUpdateCommand, "removeOldConfigs",
            transaction, oldOtherConfigs, ovs);
    verify(transaction).delete(any(LogicalDatastoreType.class), any(KeyedInstanceIdentifier.class));
}
 
开发者ID:opendaylight,项目名称:ovsdb,代码行数:17,代码来源:OpenVSwitchUpdateCommandTest.java


示例14: testRemoveExternalIds

import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeKey; //导入依赖的package包/类
@Test
public void testRemoveExternalIds() throws Exception {
    ReadWriteTransaction transaction = mock(ReadWriteTransaction.class);
    Map<String, String> oldExternalIds = new HashMap<>();
    oldExternalIds.put("OpenvswitchExternalIdKey", "OpenvswitchExternalIdValue");
    doNothing().when(transaction).delete(any(LogicalDatastoreType.class), any(KeyedInstanceIdentifier.class));

    //suppress getNodeId()
    MemberModifier.suppress(
            MemberMatcher.method(OpenVSwitchUpdateCommand.class, "getNodeId", OpenVSwitch.class));
    PowerMockito.whenNew(NodeKey.class).withAnyArguments().thenReturn(mock(NodeKey.class));
    OpenVSwitch ovs = mock(OpenVSwitch.class);
    Whitebox.invokeMethod(openVSwitchUpdateCommand, "removeExternalIds",
            transaction, oldExternalIds, ovs);
    verify(transaction).delete(any(LogicalDatastoreType.class), any(KeyedInstanceIdentifier.class));
}
 
开发者ID:opendaylight,项目名称:ovsdb,代码行数:17,代码来源:OpenVSwitchUpdateCommandTest.java


示例15: testGetManagerEntryIid

import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeKey; //导入依赖的package包/类
@Test
public void testGetManagerEntryIid() throws Exception {
    ManagerEntry managerEntry = mock(ManagerEntry.class);
    OvsdbConnectionInstance client = mock(OvsdbConnectionInstance.class, Mockito.RETURNS_DEEP_STUBS);
    when(ovsdbManagersUpdateCommand.getOvsdbConnectionInstance()).thenReturn(client);
    when(client.getNodeKey().getNodeId().getValue()).thenReturn(NODE_ID);
    PowerMockito.whenNew(Uri.class).withAnyArguments().thenReturn(mock(Uri.class));

    NodeId nodeId = mock(NodeId.class);
    PowerMockito.whenNew(NodeId.class).withAnyArguments().thenReturn(nodeId);
    NodeKey nodeKey = mock(NodeKey.class);
    PowerMockito.whenNew(NodeKey.class).withAnyArguments().thenReturn(nodeKey);
    when(managerEntry.getKey()).thenReturn(mock(ManagerEntryKey.class));
    assertEquals(KeyedInstanceIdentifier.class,
            Whitebox.invokeMethod(ovsdbManagersUpdateCommand, "getManagerEntryIid", managerEntry).getClass());
}
 
开发者ID:opendaylight,项目名称:ovsdb,代码行数:17,代码来源:OvsdbManagersUpdateCommandTest.java


示例16: testGetControllerEntryIid

import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeKey; //导入依赖的package包/类
@Test
public void testGetControllerEntryIid() throws Exception {
    ControllerEntry controllerEntry = mock(ControllerEntry.class);
    OvsdbConnectionInstance client = mock(OvsdbConnectionInstance.class);
    when(ovsdbControllerUpdateCommand.getOvsdbConnectionInstance()).thenReturn(client);
    NodeKey nodeKey = mock(NodeKey.class);
    when(client.getNodeKey()).thenReturn(nodeKey);
    NodeId nodeId = mock(NodeId.class);
    when(nodeKey.getNodeId()).thenReturn(nodeId);
    when(nodeId.getValue()).thenReturn(NODE_ID);
    PowerMockito.whenNew(Uri.class).withAnyArguments().thenReturn(mock(Uri.class));
    PowerMockito.whenNew(NodeId.class).withAnyArguments().thenReturn(nodeId);
    PowerMockito.whenNew(NodeKey.class).withAnyArguments().thenReturn(nodeKey);
    PowerMockito.whenNew(TopologyKey.class).withAnyArguments().thenReturn(mock(TopologyKey.class));
    //PowerMockito.suppress(MemberMatcher.methodsDeclaredIn(InstanceIdentifier.class));
    when(controllerEntry.getKey()).thenReturn(mock(ControllerEntryKey.class));
    assertEquals(KeyedInstanceIdentifier.class, (Whitebox
            .invokeMethod(ovsdbControllerUpdateCommand, "getControllerEntryIid", controllerEntry, BRIDGE_NAME)
            .getClass()));
}
 
开发者ID:opendaylight,项目名称:ovsdb,代码行数:21,代码来源:OvsdbControllerUpdateCommandTest.java


示例17: register

import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeKey; //导入依赖的package包/类
public void register(final EventSource eventSource){

        final NodeKey nodeKey = eventSource.getSourceNodeKey();
        final KeyedInstanceIdentifier<Node, NodeKey> sourcePath = EVENT_SOURCE_TOPOLOGY_PATH.child(Node.class, nodeKey);
        final RoutedRpcRegistration<EventSourceService> reg = rpcRegistry.addRoutedRpcImplementation(EventSourceService.class, eventSource);
        reg.registerPath(NodeContext.class, sourcePath);
        routedRpcRegistrations.put(nodeKey,reg);
        insert(sourcePath);

    }
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:11,代码来源:EventSourceTopology.java


示例18: unRegister

import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeKey; //导入依赖的package包/类
public void unRegister(final EventSource eventSource){
    final NodeKey nodeKey = eventSource.getSourceNodeKey();
    final KeyedInstanceIdentifier<Node, NodeKey> sourcePath = EVENT_SOURCE_TOPOLOGY_PATH.child(Node.class, nodeKey);
    final RoutedRpcRegistration<EventSourceService> removeRegistration = routedRpcRegistrations.remove(nodeKey);
    if(removeRegistration != null){
        removeRegistration.close();
    remove(sourcePath);
    }
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:10,代码来源:EventSourceTopology.java


示例19: registerTest

import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeKey; //导入依赖的package包/类
@Test
public void registerTest() throws Exception {
    topicTestHelper();
    Node nodeMock = mock(Node.class);
    EventSource eventSourceMock = mock(EventSource.class);
    NodeId nodeId = new NodeId("nodeIdValue1");
    nodeKey = new NodeKey(nodeId);
    doReturn(nodeKey).when(nodeMock).getKey();
    doReturn(nodeKey).when(eventSourceMock).getSourceNodeKey();
    BindingAwareBroker.RoutedRpcRegistration routedRpcRegistrationMock = mock(BindingAwareBroker.RoutedRpcRegistration.class);
    doReturn(routedRpcRegistrationMock).when(rpcProviderRegistryMock).addRoutedRpcImplementation(EventSourceService.class, eventSourceMock);
    doNothing().when(routedRpcRegistrationMock).registerPath(eq(NodeContext.class), any(KeyedInstanceIdentifier.class));
    eventSourceTopology.register(eventSourceMock);
    verify(routedRpcRegistrationMock, times(1)).registerPath(eq(NodeContext.class), any(KeyedInstanceIdentifier.class));
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:16,代码来源:EventSourceTopologyTest.java


示例20: unregisterTest

import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeKey; //导入依赖的package包/类
@Test
public void unregisterTest() throws Exception {
    topicTestHelper();
    EventSource eventSourceMock = mock(EventSource.class);
    NodeId nodeId = new NodeId("nodeIdValue1");
    nodeKey = new NodeKey(nodeId);
    Map<NodeKey, BindingAwareBroker.RoutedRpcRegistration<EventSourceService>> localMap = getRoutedRpcRegistrations();
    NodeKey nodeKeyMock = mock(NodeKey.class);
    doReturn(nodeKeyMock).when(eventSourceMock).getSourceNodeKey();
    BindingAwareBroker.RoutedRpcRegistration<EventSourceService> routedRpcRegistrationMock = mock(BindingAwareBroker.RoutedRpcRegistration.class);
    localMap.put(nodeKeyMock, routedRpcRegistrationMock);
    eventSourceTopology.unRegister(eventSourceMock);
    verify(routedRpcRegistrationMock, times(1)).close();
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:15,代码来源:EventSourceTopologyTest.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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