Package org.jclouds.compute.predicates
Class NodePredicates
- java.lang.Object
-
- org.jclouds.compute.predicates.NodePredicates
-
public class NodePredicates extends Object
Container for node filters (predicates). This class has static methods that create customized predicates to use withComputeService.
-
-
Field Summary
Fields Modifier and Type Field Description static com.google.common.base.Predicate<NodeMetadata>RUNNINGMatch nodes with State == RUNNINGstatic com.google.common.base.Predicate<NodeMetadata>SUSPENDEDMatch nodes with State == SUSPENDEDstatic com.google.common.base.Predicate<NodeMetadata>TERMINATEDMatch nodes with State == NODE_TERMINATED
-
Constructor Summary
Constructors Constructor Description NodePredicates()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static com.google.common.base.Predicate<ComputeMetadata>all()return everything.static com.google.common.base.Predicate<NodeMetadata>hasGroup()Return nodes who have a value forNodeMetadata.getGroup()static com.google.common.base.Predicate<NodeMetadata>inGroup(String group)Return nodes in the specified group.static com.google.common.base.Predicate<ComputeMetadata>locationId(String id)Return nodes in the specified location.static com.google.common.base.Predicate<ComputeMetadata>parentLocationId(String id)Return nodes in the specified parent location.static com.google.common.base.Predicate<NodeMetadata>runningInGroup(String group)Return nodes with specified group that are in the NODE_RUNNING state.static <T extends ComputeMetadata>
com.google.common.base.Predicate<T>withIds(String... ids)Return nodes with the specific ids Note: returns all nodes, regardless of the state.
-
-
-
Field Detail
-
RUNNING
public static final com.google.common.base.Predicate<NodeMetadata> RUNNING
Match nodes with State == RUNNING
-
TERMINATED
public static final com.google.common.base.Predicate<NodeMetadata> TERMINATED
Match nodes with State == NODE_TERMINATED
-
SUSPENDED
public static final com.google.common.base.Predicate<NodeMetadata> SUSPENDED
Match nodes with State == SUSPENDED
-
-
Method Detail
-
locationId
public static com.google.common.base.Predicate<ComputeMetadata> locationId(String id)
Return nodes in the specified location.- Parameters:
id- id of the location- Returns:
- predicate
-
parentLocationId
public static com.google.common.base.Predicate<ComputeMetadata> parentLocationId(String id)
Return nodes in the specified parent location.- Parameters:
id- id of the location- Returns:
- predicate
-
withIds
public static <T extends ComputeMetadata> com.google.common.base.Predicate<T> withIds(String... ids)
Return nodes with the specific ids Note: returns all nodes, regardless of the state.- Parameters:
ids- ids of the resources- Returns:
- predicate
-
all
public static com.google.common.base.Predicate<ComputeMetadata> all()
return everything.
-
inGroup
public static com.google.common.base.Predicate<NodeMetadata> inGroup(String group)
Return nodes in the specified group. Note: returns all nodes, regardless of the state.- Parameters:
group- group to match the items- Returns:
- predicate
-
hasGroup
public static com.google.common.base.Predicate<NodeMetadata> hasGroup()
Return nodes who have a value forNodeMetadata.getGroup()
-
runningInGroup
public static com.google.common.base.Predicate<NodeMetadata> runningInGroup(String group)
Return nodes with specified group that are in the NODE_RUNNING state.- Parameters:
group- group to match the items- Returns:
- predicate
-
-