Skip to content

Commit

Permalink
Bundle up some changes
Browse files Browse the repository at this point in the history
  • Loading branch information
edwardcapriolo committed Mar 1, 2013
1 parent cb2755c commit 19bb9f8
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ public void handle(Message<JsonObject> event) {
}

public static void registerOperationHandlers(Vertx x) {
x.eventBus().registerHandler("request.autotimestamp", new AutotimestampHandler() );
x.eventBus().registerHandler("request.createkeyspace", new CreateKeyspaceHandler());
x.eventBus().registerHandler("request.setkeyspace", new SetKeyspaceHandler());
x.eventBus().registerHandler("request.createcolumnfamily", new CreateColumnFamilyHandler());
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package org.usergrid.vx.server.operations;

import org.vertx.java.core.Handler;
import org.vertx.java.core.eventbus.Message;
import org.vertx.java.core.json.JsonObject;

public class AutotimestampHandler implements Handler<Message<JsonObject>>{

@Override
public void handle(Message<JsonObject> event) {
Integer id = event.body.getInteger("id");
JsonObject params = event.body.getObject("op");
JsonObject state = event.body.getObject("state");
state.putBoolean("autotimestamp", params.getBoolean("autotimestamp"));
event.reply(new JsonObject()
.putString(id.toString(), "OK")
.putObject("state", state)
);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ public void assumeTest() throws Exception{
IntraClient2 ic2 = new IntraClient2("localhost", 8080);
IntraRes res = ic2.sendBlocking(req);
List<Map> x = (List<Map>) res.getOpsRes().get(7);
System.out.println(res);
Assert.assertEquals( "wow", x.get(0).get("value") );
}

Expand Down

0 comments on commit 19bb9f8

Please sign in to comment.