sow-aggregated
Including the basic AMPS library:
import com.crankuptheamps.client.*;
import com.crankuptheamps.client.exception.*;
Constructing the command:
Command cmd = new Command(Message.Command.SOW);
cmd.setTopic(topic).setOptions(Message.Options.Projection("/id as /id, COUNT(/values) as /valueCount") +
Message.Options.Grouping("/id"))
;
The command can now be used in execute or executeAsync.