*/
public Predicate<NodeMetadata> getNodePredicate(Exchange exchange) {
final String nodeId = getNodeId(exchange);
final String imageId = getImageId(exchange);
final String group = getGroup(exchange);
final NodeState queryState = getNodeState(exchange);
Predicate<NodeMetadata> predicate = new Predicate<NodeMetadata>() {
public boolean apply(NodeMetadata metadata) {
if (nodeId != null && !nodeId.equals(metadata.getId())) {
return false;
}
if (imageId != null && !imageId.equals(metadata.getImageId())) {
return false;
}
if (queryState != null && !queryState.equals(metadata.getState())) {
return false;
}
if (group != null && !group.equals(metadata.getGroup())) {
return false;
}