本文整理汇总了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;
}
示例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";
}
};
}
示例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";
}
};
}
示例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);
}
示例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);
}