org.jclouds.compute.predicates
Class NodePredicates

java.lang.Object
  extended by 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 with ComputeService.

Author:
Oleksiy Yarmula

Field Summary
static com.google.common.base.Predicate<NodeMetadata> RUNNING
          Match nodes with State == RUNNING
static com.google.common.base.Predicate<NodeMetadata> TERMINATED
          Match nodes with State == NODE_TERMINATED
 
Constructor Summary
NodePredicates()
           
 
Method Summary
static com.google.common.base.Predicate<ComputeMetadata> all()
          return everything.
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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

Constructor Detail

NodePredicates

public NodePredicates()
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

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


Copyright © 2009-2012 jclouds. All Rights Reserved.