public class MachinePoolPredicates
extends java.lang.Object
Constructor and Description |
---|
MachinePoolPredicates() |
Modifier and Type | Method and Description |
---|---|
static com.google.common.base.Predicate<org.jclouds.compute.domain.NodeMetadata> |
compose(com.google.common.base.Predicate<org.jclouds.compute.domain.NodeMetadata>... predicates) |
static com.google.common.base.Predicate<org.jclouds.compute.domain.NodeMetadata> |
except(MachineSet removedItems) |
static com.google.common.base.Predicate<org.jclouds.compute.domain.NodeMetadata> |
except(com.google.common.base.Predicate<org.jclouds.compute.domain.NodeMetadata> predicateToExclude) |
static boolean |
isSubMapOf(java.util.Map<java.lang.String,java.lang.String> sub,
java.util.Map<java.lang.String,java.lang.String> bigger) |
static boolean |
matches(ReusableMachineTemplate template,
org.jclouds.compute.domain.NodeMetadata m)
True iff the node matches the criteria specified in this template.
|
static com.google.common.base.Predicate<org.jclouds.compute.domain.NodeMetadata> |
matching(ReusableMachineTemplate template) |
static com.google.common.base.Predicate<org.jclouds.compute.domain.NodeMetadata> |
withTag(java.lang.String tag) |
public static com.google.common.base.Predicate<org.jclouds.compute.domain.NodeMetadata> except(MachineSet removedItems)
public static com.google.common.base.Predicate<org.jclouds.compute.domain.NodeMetadata> except(com.google.common.base.Predicate<org.jclouds.compute.domain.NodeMetadata> predicateToExclude)
public static com.google.common.base.Predicate<org.jclouds.compute.domain.NodeMetadata> matching(ReusableMachineTemplate template)
public static com.google.common.base.Predicate<org.jclouds.compute.domain.NodeMetadata> withTag(java.lang.String tag)
public static com.google.common.base.Predicate<org.jclouds.compute.domain.NodeMetadata> compose(com.google.common.base.Predicate<org.jclouds.compute.domain.NodeMetadata>... predicates)
public static boolean matches(ReusableMachineTemplate template, org.jclouds.compute.domain.NodeMetadata m)
NB: This only checks some of the most common fields, plus a hashcode (in strict mode). In strict mode you're practically guaranteed to match only machines created by this template. (Add a tag(uid) and you _will_ be guaranteed, strict mode or not.)
Outside strict mode, some things (OS and hypervisor) can fall through the gaps. But if that is a problem we can easily add them in.
(Caveat: If explicit Hardware, Image, and/or Template were specified in the template, then the hash code probably will not detect it.)
public static boolean isSubMapOf(java.util.Map<java.lang.String,java.lang.String> sub, java.util.Map<java.lang.String,java.lang.String> bigger)