Class NodePredicates


  • public class NodePredicates
    extends Object
    Container for node filters (predicates). This class has static methods that create customized predicates to use with ComputeService.
    • 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
    • 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