Permalink
Browse files

renamed handler to make more sense for functionality. Closes #202

  • Loading branch information...
1 parent 76275cf commit 5c3f1e9fba12bb995f7e0fcf4cfeac642b54cbe3 @zznate committed May 17, 2013
@@ -15,14 +15,14 @@
/**
* @author zznate
*/
-public class RequestJsonHandler implements Handler<Message<JsonObject>> {
+public class PayloadRoutingHandler implements Handler<Message<JsonObject>> {
public static final String IHJSON_HANDLER_TOPIC = "request.json";
public static final String REQUEST_HANDLER_HEADER = "operations.";
private final Vertx vertx;
- public RequestJsonHandler(Vertx vertx) {
+ public PayloadRoutingHandler(Vertx vertx) {
this.vertx = vertx;
}
@@ -21,7 +21,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.usergrid.vx.experimental.IntraReq;
-import org.usergrid.vx.handler.RequestJsonHandler;
+import org.usergrid.vx.handler.PayloadRoutingHandler;
import org.vertx.java.core.Handler;
import org.vertx.java.core.Vertx;
import org.vertx.java.core.buffer.Buffer;
@@ -38,7 +38,7 @@
* <ol>
* <li>Extracts the request body into a {@link org.usergrid.vx.experimental.IntraReq} object</li>
* <li>Sends the IntraReq on the eventBus to the topic
- * {@link RequestJsonHandler#IHJSON_HANDLER_TOPIC} with an instance
+ * {@link org.usergrid.vx.handler.PayloadRoutingHandler#IHJSON_HANDLER_TOPIC} with an instance
* of {@link IHResponse}</li>
* <li>IHResponse with send the response via the end method of HttpServerRequest</li>
* </ol>
@@ -80,7 +80,7 @@ private void handleRequestAsync(final HttpServerRequest request, Buffer buffer)
logger.debug("IntraJsonHandler received payload: \n{}",
indentObjectMapper.writeValueAsString(req));
}
- vertx.eventBus().send(RequestJsonHandler.IHJSON_HANDLER_TOPIC,
+ vertx.eventBus().send(PayloadRoutingHandler.IHJSON_HANDLER_TOPIC,
req.toJson(),
new IHResponse(request));
} catch (Exception e) {
@@ -101,7 +101,7 @@ private void handleRequestAsync(final HttpServerRequest request, Buffer buffer)
public void handle(Message<JsonObject> event) {
if ( logger.isDebugEnabled()) {
logger.debug("in IntraHanlderJson's on handler topic {} with event {}",
- RequestJsonHandler.IHJSON_HANDLER_TOPIC,
+ PayloadRoutingHandler.IHJSON_HANDLER_TOPIC,
event.body.toString() );
}
request.response.end(event.body.toString());
@@ -20,8 +20,8 @@
import org.apache.cassandra.service.CassandraDaemon;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import org.usergrid.vx.handler.PayloadRoutingHandler;
import org.usergrid.vx.handler.http.payload.IntraHandlerJson;
-import org.usergrid.vx.handler.RequestJsonHandler;
import org.usergrid.vx.handler.http.HelloHandler;
import org.usergrid.vx.handler.http.NoMatchHandler;
import org.usergrid.vx.handler.http.rest.KeyspaceMetaHandler;
@@ -85,8 +85,8 @@ public boolean isRunning() {
}
public static void registerRequestHandler(Vertx x) {
- x.eventBus().registerHandler(RequestJsonHandler.IHJSON_HANDLER_TOPIC,
- new RequestJsonHandler(vertx));
+ x.eventBus().registerHandler(PayloadRoutingHandler.IHJSON_HANDLER_TOPIC,
+ new PayloadRoutingHandler(vertx));
}
public static void registerOperationHandlers(Vertx x) {

0 comments on commit 5c3f1e9

Please sign in to comment.