public static Predicate<Entity> attributeNotNull(final String attributeName) { return attributeSatisfies(attributeName, Predicates.notNull()); }
public static <T> Predicate<Entity> attributeNotNull(final AttributeSensor<T> attribute) { return attributeSatisfies(attribute, Predicates.<T>notNull()); }
public static <T> Predicate<Entity> attributeEqualTo(final AttributeSensor<T> attribute, final T val) { return attributeSatisfies(attribute, Predicates.equalTo(val)); }
public static Predicate<Entity> attributeEqualTo(final String attributeName, final Object val) { return attributeSatisfies(attributeName, Predicates.equalTo(val)); }
public static <T> Predicate<Entity> attributeNotEqualTo(final AttributeSensor<T> attribute, final T val) { return attributeSatisfies(attribute, Predicates.not(Predicates.equalTo(val))); }
public static <T> Predicate<Entity> attributeNotEqualTo(final String attributeName, final Object val) { return attributeSatisfies(attributeName, Predicates.not(Predicates.equalTo(val))); }
@Override public void onCallback(String childId, boolean success) { Optional<Entity> child = Iterables.tryFind(getChildren(), EntityPredicates.idEqualTo(childId)); if (child.isPresent()) { ((AsyncEntity)child.get()).onCallback(success); } else { LOG.warn("Child not found with resourceId '"+childId+"'; not injecting state from callback"); } Optional<Entity> unstartedVm = Iterables.tryFind(getChildren(), EntityPredicates.attributeSatisfies(Attributes.SERVICE_STATE_EXPECTED, new Predicate<Lifecycle.Transition>() { @Override public boolean apply(Transition input) { return input == null || input.getState() == Lifecycle.STARTING; }})); if (!unstartedVm.isPresent()) { // No VMs are still starting; we are finished starting ServiceStateLogic.ServiceNotUpLogic.clearNotUpIndicator(this, START.getName()); ServiceStateLogic.setExpectedState(this, Lifecycle.RUNNING); } }