Package org.jclouds.compute.predicates
Class NodePredicates
java.lang.Object
org.jclouds.compute.predicates.NodePredicates
Container for node filters (predicates).
This class has static methods that create customized predicates to use with
ComputeService
.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.google.common.base.Predicate
<NodeMetadata> Match nodes with State == RUNNINGstatic final com.google.common.base.Predicate
<NodeMetadata> Match nodes with State == SUSPENDEDstatic final com.google.common.base.Predicate
<NodeMetadata> Match nodes with State == NODE_TERMINATED -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic 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> 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> 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> Return nodes with the specific ids Note: returns all nodes, regardless of the state.
-
Field Details
-
RUNNING
Match nodes with State == RUNNING -
TERMINATED
Match nodes with State == NODE_TERMINATED -
SUSPENDED
Match nodes with State == SUSPENDED
-
-
Constructor Details
-
NodePredicates
public NodePredicates()
-
-
Method Details
-
locationId
Return nodes in the specified location.- Parameters:
id
- id of the location- Returns:
- predicate
-
parentLocationId
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
return everything. -
inGroup
Return nodes in the specified group. Note: returns all nodes, regardless of the state.- Parameters:
group
- group to match the items- Returns:
- predicate
-
hasGroup
Return nodes who have a value forNodeMetadata.getGroup()
-
runningInGroup
Return nodes with specified group that are in the NODE_RUNNING state.- Parameters:
group
- group to match the items- Returns:
- predicate
-