当前位置: 首页>>代码示例>>Java>>正文


Java NodeMetadata.getName方法代码示例

本文整理汇总了Java中org.jclouds.compute.domain.NodeMetadata.getName方法的典型用法代码示例。如果您正苦于以下问题:Java NodeMetadata.getName方法的具体用法?Java NodeMetadata.getName怎么用?Java NodeMetadata.getName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.jclouds.compute.domain.NodeMetadata的用法示例。


在下文中一共展示了NodeMetadata.getName方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: findLeftVmNames

import org.jclouds.compute.domain.NodeMetadata; //导入方法依赖的package包/类
private List<String> findLeftVmNames(Set<? extends NodeMetadata> successfulNodes, List<String> vmNames) {
  List<String> leftVmNames = new ArrayList<>();
  leftVmNames.addAll(vmNames);
  int unnamedVms = 0;
  for (NodeMetadata nodeMetadata : successfulNodes) {
    String nodeName = nodeMetadata.getName();
    if (leftVmNames.contains(nodeName)) {
      leftVmNames.remove(nodeName);
    } else {
      unnamedVms++;
    }
  }

  for (int i = 0; i < unnamedVms; i++) {
    if (leftVmNames.size() > 0) {
      logger.debug(String.format("Taking %s as one of the unnamed vms.", leftVmNames.get(0)));
      leftVmNames.remove(0);
    }
  }
  return leftVmNames;
}
 
开发者ID:karamelchef,项目名称:karamel,代码行数:22,代码来源:NovaLauncher.java

示例2: withPredicate

import org.jclouds.compute.domain.NodeMetadata; //导入方法依赖的package包/类
public static Predicate<NodeMetadata> withPredicate(final Set<String> ids, final Set<String> names,
                                                    final Set<String> groupNames) {
  return new Predicate<NodeMetadata>() {
    @Override
    public boolean apply(NodeMetadata nodeMetadata) {
      String id = nodeMetadata.getId();
      String name = nodeMetadata.getName();
      String group = nodeMetadata.getGroup();
      return ((id != null && ids.contains(id)) || (name != null && names.contains(name) ||
              (group != null && groupNames.contains(group))));
    }

    @Override
    public String toString() {
      return "machines predicate";
    }
  };
}
 
开发者ID:karamelchef,项目名称:karamel,代码行数:19,代码来源:NovaLauncher.java

示例3: withPredicate

import org.jclouds.compute.domain.NodeMetadata; //导入方法依赖的package包/类
public static Predicate<NodeMetadata> withPredicate(final Set<String> ids, final Set<String> names,
    final Set<String> groupNames) {
  return new Predicate<NodeMetadata>() {
    @Override
    public boolean apply(NodeMetadata nodeMetadata) {
      String id = nodeMetadata.getId();
      String name = nodeMetadata.getName();
      String group = nodeMetadata.getGroup();
      return ((id != null && ids.contains(id)) || (name != null && names.contains(name)
          || (group != null && groupNames.contains(group))));
    }

    @Override
    public String toString() {
      return "machines predicate";
    }
  };
}
 
开发者ID:karamelchef,项目名称:karamel,代码行数:19,代码来源:Ec2Launcher.java

示例4: exec

import org.jclouds.compute.domain.NodeMetadata; //导入方法依赖的package包/类
public void exec() {
    List<MonitoredVm> list = new ArrayList<MonitoredVm>();
    //get all servers
    Set<NodeMetadata> jCloudsNodes = (Set<NodeMetadata>) connector.listOfVMs();
    Iterator<NodeMetadata> iterator = jCloudsNodes.iterator();
    while (iterator.hasNext()) {
        NodeMetadata current = iterator.next();
        String name = (current.getName());
        MonitoredVm temp = new MonitoredVm(current.getId(), name, toState(current.getStatus()));
        list.add(temp);
    }
    ListManager.listManager(list, VMs, coord);
}
 
开发者ID:SINTEF-9012,项目名称:cloudml,代码行数:14,代码来源:OpenStackModule.java

示例5: exec

import org.jclouds.compute.domain.NodeMetadata; //导入方法依赖的package包/类
public void exec() {
    List<MonitoredVm> list = new ArrayList<MonitoredVm>();
    //get all servers
    Set<NodeMetadata> jCloudsNodes = (Set<NodeMetadata>) connector.listOfVMs();
    Iterator<NodeMetadata> iterator = jCloudsNodes.iterator();
    while (iterator.hasNext()) {
        NodeMetadata current = iterator.next();
        String name = (current.getName());
        MonitoredVm temp = new MonitoredVm(current.getId(), name, toState(current.getStatus()));
        list.add(temp);
    }
    ListManager.listManager(list, VMs, coord);

}
 
开发者ID:SINTEF-9012,项目名称:cloudml,代码行数:15,代码来源:JCloudsModule.java


注:本文中的org.jclouds.compute.domain.NodeMetadata.getName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。