Class ServerPredicates
- java.lang.Object
-
- com.elastisys.scale.cloudpool.openstack.predicates.ServerPredicates
-
public class ServerPredicates extends java.lang.ObjectPredicates relating to OpenstackServerinstances.
-
-
Constructor Summary
Constructors Constructor Description ServerPredicates()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.function.Predicate<? super org.openstack4j.model.compute.Server>withStateIn(org.openstack4j.model.compute.Server.Status... statuses)Creates aPredicatefunction that returnstruefor anyServerwith a status in a set of allowed values.static java.util.function.Predicate<org.openstack4j.model.compute.Server>withTag(java.lang.String tag, java.lang.String tagValue)Creates aPredicatethat checksServerinstances for the existence of a given meta data tag.
-
-
-
Method Detail
-
withTag
public static java.util.function.Predicate<org.openstack4j.model.compute.Server> withTag(java.lang.String tag, java.lang.String tagValue)Creates aPredicatethat checksServerinstances for the existence of a given meta data tag. The predicate will returntruefor allServerinstances with a given tag value in its user meta data.- Parameters:
tag- The meta data tag.value- The expected value of the meta data tag.- Returns:
- A predicate that returns
trueforServerinstances with the given tag value andfalsefor all otherServerinstances.
-
withStateIn
public static java.util.function.Predicate<? super org.openstack4j.model.compute.Server> withStateIn(org.openstack4j.model.compute.Server.Status... statuses)
Creates aPredicatefunction that returnstruefor anyServerwith a status in a set of allowed values.- Parameters:
statuses- The allowed serverServer.Statuses.- Returns:
- A predicate that returns
trueforServerinstances in a certain state.
-
-