org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes.getNode()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(9.5k)|赞(0)|评价(0)|浏览(90)

本文整理了Java中org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes.getNode()方法的一些代码示例,展示了Nodes.getNode()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Nodes.getNode()方法的具体详情如下:
包路径:org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes
类名称:Nodes
方法名:getNode

Nodes.getNode介绍

[英]A list of nodes (as defined by the 'grouping node').
[中]节点列表(由“分组节点”定义)。

代码示例

代码示例来源:origin: opendaylight/controller

public NodesBuilder(Nodes base) {
  this._node = base.getNode();
  if (base instanceof NodesImpl) {
    NodesImpl impl = (NodesImpl) base;
    if (!impl.augmentation.isEmpty()) {
      this.augmentation = new HashMap<>(impl.augmentation);
    }
  } else if (base instanceof AugmentationHolder) {
    @SuppressWarnings("unchecked")
    Map<Class<? extends Augmentation<Nodes>>, Augmentation<Nodes>> aug =((AugmentationHolder<Nodes>) base).augmentations();
    if (!aug.isEmpty()) {
      this.augmentation = new HashMap<>(aug);
    }
  }
}

代码示例来源:origin: opendaylight/controller

if (!Objects.equals(_node, other.getNode())) {
  return false;

代码示例来源:origin: opendaylight/controller

/**
 * @return <code>java.util.List</code> <code>node</code>, or an empty list if it is not present
 */
default @NonNull List<Node> nonnullNode() {
  return CodeHelpers.nonnull(getNode());
}

代码示例来源:origin: org.opendaylight.openflowplugin/test-provider

private List<Node> getNodes() {
ReadOnlyTransaction readOnlyTransaction = dataProviderService
 .newReadOnlyTransaction();
InstanceIdentifier<Nodes> nodesID = InstanceIdentifier.create(Nodes.class);
Nodes nodes = TestProviderTransactionUtil.getDataObject(readOnlyTransaction,
 nodesID);
if (nodes == null) {
 throw new RuntimeException("nodes are not found, pls add the node.");
}
return nodes.getNode();
}

代码示例来源:origin: org.opendaylight.vtn/manager.implementation

/**
 * Return a list of VTN nodes associated with the given MD-SAL node
 * list.
 *
 * @param nodes  A MD-SAL node list.
 * @return  A list of {@link VtnNode} instances.
 *          {@code null} if no node is present.
 */
private List<VtnNode> getVtnNodeList(Nodes nodes) {
  if (nodes == null) {
    return null;
  }
  List<Node> nodeList = nodes.getNode();
  if (nodeList == null || nodeList.isEmpty()) {
    return null;
  }
  List<VtnNode> vnodeList = new ArrayList<VtnNode>();
  for (Node node: nodeList) {
    NodeId id = node.getId();
    SalNode snode = SalNode.create(id);
    if (snode == null) {
      LOG.debug("Ignore unsupported node: {}", id);
      continue;
    }
    VtnNode vnode = InventoryUtils.toVtnNodeBuilder(node).build();
    vnodeList.add(vnode);
  }
  return (vnodeList.isEmpty()) ? null : vnodeList;
}

代码示例来源:origin: org.opendaylight.netvirt/vpnmanager-impl

/**
 * Retrieves the ids of the currently operative DPNs
 *
 * @param dataBroker dataBroker service reference
 * @return the list of DPNs currently operative
 */
public static List<BigInteger> getOperativeDPNs(DataBroker dataBroker) {
  List<BigInteger> result = new LinkedList<BigInteger>();
  InstanceIdentifier<Nodes> nodesInstanceIdentifier = InstanceIdentifier.builder(Nodes.class).build();
  Optional<Nodes> nodesOptional = MDSALUtil.read(dataBroker, LogicalDatastoreType.OPERATIONAL,
      nodesInstanceIdentifier);
  if (!nodesOptional.isPresent()) {
    return result;
  }
  Nodes nodes = nodesOptional.get();
  List<Node> nodeList = nodes.getNode();
  for (Node node : nodeList) {
    NodeId nodeId = node.getId();
    if (nodeId != null) {
      BigInteger dpnId = MDSALUtil.getDpnIdFromNodeName(nodeId);
      result.add(dpnId);
    }
  }
  return result;
}

代码示例来源:origin: org.opendaylight.netvirt/cloud-servicechain-impl

/**
   * Returns the ids of the currently operative DPNs
   *
   * @param dataBroker
   * @return
   */
  public static List<BigInteger> getOperativeDPNs(DataBroker dataBroker) {
    List<BigInteger> result = new LinkedList<BigInteger>();
    InstanceIdentifier<Nodes> nodesInstanceIdentifier = InstanceIdentifier.builder(Nodes.class).build();
    Optional<Nodes> nodesOptional = MDSALUtil.read(dataBroker, LogicalDatastoreType.OPERATIONAL,
                            nodesInstanceIdentifier);
    if (!nodesOptional.isPresent()) {
      return result;
    }
    Nodes nodes = nodesOptional.get();
    List<Node> nodeList = nodes.getNode();
    for (Node node : nodeList) {
      NodeId nodeId = node.getId();
      if (nodeId != null) {
        BigInteger dpnId = MDSALUtil.getDpnIdFromNodeName(nodeId);
        result.add(dpnId);
      }
    }
    return result;
  }
}

代码示例来源:origin: org.opendaylight.openflowplugin.legacy/sal-compatibility

@Override
public ConcurrentMap<Node,Map<String,Property>> getNodeProps() {
  final ConcurrentHashMap<Node,Map<String,Property>> props = new ConcurrentHashMap<>();
  final Nodes nodes = this.readOperAllMDNodes();
  for (final org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node node : nodes.getNode()) {
    final FlowCapableNode fcn = node.getAugmentation(FlowCapableNode.class);
    if (fcn != null) {
      final ConcurrentHashMap<String,Property> perNodePropMap = new ConcurrentHashMap<String, Property>();
      final HashSet<Property> perNodeProps = NodeMapping.toADNodeProperties(fcn, node.getId());
      if (perNodeProps != null) {
        for (final Property perNodeProp : perNodeProps) {
          perNodePropMap.put(perNodeProp.getName(), perNodeProp);
        }
      }
      try {
        final Node adNode = NodeMapping.toADNode(node.getId());
        props.put(adNode, perNodePropMap);
      } catch (ConstructionException e) {
        LOG.warn("Failed to construct node for {}, skipping it", node, e);
      }
    }
  }
  return props;
}

代码示例来源:origin: org.opendaylight.openflowplugin/openflowplugin

public static List<Node> readAllNodes() {
  Nodes nodes = getDataObject(OFSessionUtil.getSessionManager().getDataBroker().newReadOnlyTransaction(), NODES_IDENTIFIER);
  return nodes.getNode();
}

代码示例来源:origin: org.opendaylight.nic/of-renderer

/**
   * Retrieve all the {@link Node} along with a list of their
   * associated {@link NodeConnector}.
   * @return nodes A map with {@link Node} as the key and a {@link List} of {@link NodeConnector}.
   */
  public static Map<Node, List<NodeConnector>> getNodes(final DataBroker dataBroker) {
    Map<Node, List<NodeConnector>> nodeMap = new HashMap<Node, List<NodeConnector>>();
    Nodes nodeList = new NodesBuilder().build();
    ReadTransaction tx = dataBroker.newReadOnlyTransaction();
    try {
      final InstanceIdentifier<Nodes> nodesIdentifier = InstanceIdentifier.create(Nodes.class);
      final CheckedFuture<Optional<Nodes>, ReadFailedException> txCheckedFuture = tx.read(LogicalDatastoreType
          .OPERATIONAL, nodesIdentifier);
      nodeList = txCheckedFuture.checkedGet().get();

      for (Node node : nodeList.getNode()) {
        LOG.info("Node ID : {}", node.getId());
        List<NodeConnector> nodeConnector = node.getNodeConnector();
        nodeMap.put(node, nodeConnector);
      }
    } catch (ReadFailedException e) {
      //TODO: Perform fail over
      LOG.error("Error reading Nodes from MD-SAL", e);
    }
    return nodeMap;
  }
}

代码示例来源:origin: org.opendaylight.openflowplugin.legacy/sal-compatibility

@Override
public ConcurrentMap<NodeConnector,Map<String,Property>> getNodeConnectorProps(final Boolean refresh) {
  final ConcurrentHashMap<NodeConnector,Map<String,Property>> props = new ConcurrentHashMap<>();
  for (final org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node node : this.readOperAllMDNodes().getNode()) {
    for (final org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnector nc : node.getNodeConnector()) {
      final FlowCapableNodeConnector fcnc = nc.getAugmentation(FlowCapableNodeConnector.class);
      if (fcnc != null) {
        final ConcurrentHashMap<String,Property> ncpsm = new ConcurrentHashMap<>();
        final HashSet<Property> ncps = NodeMapping.toADNodeConnectorProperties(fcnc);
        if (ncps != null) {
          for (final Property p : ncps) {
            ncpsm.put(p.getName(), p);
          }
        }
        try {
          props.put(NodeMapping.toADNodeConnector(nc.getId(), node.getId()), ncpsm);
        } catch (ConstructionException e) {
          LOG.warn("Failed to instantiate node {} connector {}, not reporting it", node.getId(), nc.getId(), e);
        }
      }
    }
  }
  return props;
}

代码示例来源:origin: org.opendaylight.groupbasedpolicy/ofoverlay-renderer

private NodeInfo fetchAugmentation(String portName) {
  NodeInfo nodeInfo = null;
  if (dataProvider != null) {
    Optional<Nodes> result;
    try {
      result = dataProvider.newReadOnlyTransaction().read(LogicalDatastoreType.OPERATIONAL, nodesIid).get();
      if (result.isPresent()) {
        Nodes nodes = result.get();
        for (Node node : nodes.getNode()) {
          if (node.getNodeConnector() != null) {
            boolean found = false;
            for (NodeConnector nc : node.getNodeConnector()) {
              FlowCapableNodeConnector fcnc = nc.getAugmentation(FlowCapableNodeConnector.class);
              if (fcnc.getName().equals(portName)) {
                nodeInfo = new NodeInfo(nc, node);
                found = true;
                break;
              }
            }
            if (found)
              break;
          }
        }
      }
    } catch (InterruptedException | ExecutionException e) {
      LOG.error("Caught exception in fetchAugmentation portName", e);
    }
  }
  return nodeInfo;
}

代码示例来源:origin: org.opendaylight.groupbasedpolicy/ofoverlay-renderer

Optional<Nodes> potentialNodes = DataStoreHelper.readFromDs(LogicalDatastoreType.CONFIGURATION,
    InstanceIdentifier.builder(Nodes.class).build(), rTx);
if (!potentialNodes.isPresent() || potentialNodes.get().getNode() == null) {
  return ImmutableSetMultimap.of();
List<Node> nodes = potentialNodes.get().getNode();
SetMultimap<Node, Pair<InstanceIdentifier<NodeConnector>, MacAddress>> extIfacesByNode = HashMultimap.create();
for (Node node : nodes) {

代码示例来源:origin: org.opendaylight.tsdr/tsdr-datacollection

.get().get();
Set<InstanceIdentifier<Node>> nodeSet = new HashSet<>();
for (Node n : nodes.getNode()) {
  InstanceIdentifier<Node> nodeID = id.child(Node.class,
      n.getKey());

代码示例来源:origin: org.opendaylight.l2switch.arphandler/arphandler-impl

for (Node node : nodes.getNode()) {
  ArrayList<NodeConnectorRef> nodeConnectorRefs = new ArrayList<NodeConnectorRef>();
  List<NodeConnector> nodeConnectors = node.getNodeConnector();

代码示例来源:origin: org.opendaylight.alto.alto-hosttracker/alto-hosttracker-impl

.getNode()) {
List<NodeConnector> connectors = n.getNodeConnector();
if (connectors != null) {

代码示例来源:origin: org.opendaylight.l2switch.arphandler/arphandler-impl

for (Node node : nodes.getNode()) {

相关文章