Permalink
Browse files

Moved package names for payload and rest, more granular bus topics to…

… match packages. Closes #142
  • Loading branch information...
zznate committed May 17, 2013
1 parent 41948c2 commit 9f982b73f041f7b9a23f4b3b4391eb765991e8f8
@@ -18,7 +18,7 @@
public class RequestJsonHandler implements Handler<Message<JsonObject>> {
public static final String IHJSON_HANDLER_TOPIC = "request.json";
- public static final String REQUEST_HANDLER_HEADER = "request.";
+ public static final String REQUEST_HANDLER_HEADER = "operations.";
private final Vertx vertx;
@@ -125,7 +125,7 @@ public void handle(Message<JsonObject> event) {
operation.putArray("input", this.results.getObject("opsRes").getArray(input+"") );
vertx.eventBus().send("processors." + params.getString("processorname"), operation, this);
} else {
- vertx.eventBus().send("request." + operation.getString("type").toLowerCase(), operation, this);
+ vertx.eventBus().send("operations." + operation.getString("type").toLowerCase(), operation, this);
}
} else {
sendResults();
@@ -13,13 +13,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.usergrid.vx.experimental;
+package org.usergrid.vx.handler.http.payload;
import org.apache.commons.lang.exception.ExceptionUtils;
import org.codehaus.jackson.map.ObjectMapper;
import org.codehaus.jackson.map.SerializationConfig;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import org.usergrid.vx.experimental.IntraReq;
import org.usergrid.vx.handler.RequestJsonHandler;
import org.vertx.java.core.Handler;
import org.vertx.java.core.Vertx;
@@ -35,15 +36,15 @@
* JSON payload.
* Specifically, this class:
* <ol>
- * <li>Extracts the request body into a {@link IntraReq} object</li>
+ * <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
* of {@link IHResponse}</li>
* <li>IHResponse with send the response via the end method of HttpServerRequest</li>
* </ol>
*
* In debug mode, this class will dump the payload received in the form of what was
- * paesed into {@link IntraReq}
+ * paesed into {@link org.usergrid.vx.experimental.IntraReq}
*/
public class IntraHandlerJson implements Handler<HttpServerRequest>{
@@ -1,4 +1,4 @@
-package org.usergrid.vx.handler.rest;
+package org.usergrid.vx.handler.http.rest;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -1,12 +1,8 @@
-package org.usergrid.vx.handler.rest;
+package org.usergrid.vx.handler.http.rest;
import org.apache.cassandra.db.ConsistencyLevel;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import org.usergrid.vx.experimental.IntraOp;
-import org.usergrid.vx.experimental.IntraReq;
-import org.usergrid.vx.experimental.Operations;
-import org.vertx.java.core.buffer.Buffer;
import org.vertx.java.core.http.HttpServerRequest;
/**
@@ -1,4 +1,4 @@
-package org.usergrid.vx.handler.rest;
+package org.usergrid.vx.handler.http.rest;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -1,4 +1,4 @@
-package org.usergrid.vx.handler.rest;
+package org.usergrid.vx.handler.http.rest;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -16,27 +16,19 @@
package org.usergrid.vx.server;
import java.util.concurrent.atomic.AtomicBoolean;
-import java.util.concurrent.atomic.AtomicInteger;
import org.apache.cassandra.service.CassandraDaemon;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import org.usergrid.vx.experimental.IntraHandlerJson;
+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.OperationsRequestHandler;
-import org.usergrid.vx.handler.http.TimeoutHandler;
-import org.usergrid.vx.handler.rest.KeyspaceMetaHandler;
-import org.usergrid.vx.handler.rest.IntraHandlerRest;
-import org.usergrid.vx.handler.rest.SystemMetaHandler;
+import org.usergrid.vx.handler.http.rest.KeyspaceMetaHandler;
+import org.usergrid.vx.handler.http.rest.SystemMetaHandler;
import org.usergrid.vx.server.operations.*;
-import org.vertx.java.core.Handler;
import org.vertx.java.core.Vertx;
-import org.vertx.java.core.eventbus.Message;
import org.vertx.java.core.http.RouteMatcher;
-import org.vertx.java.core.json.JsonArray;
-import org.vertx.java.core.json.JsonObject;
public class IntravertCassandraServer implements CassandraDaemon.Server {
private static final int PORT = 8080;
@@ -98,27 +90,27 @@ public static void registerRequestHandler(Vertx x) {
}
public static void registerOperationHandlers(Vertx x) {
- x.eventBus().registerHandler("request.autotimestamp", new AutotimestampHandler() );
- x.eventBus().registerHandler("request.batchset", new BatchHandler() );
- x.eventBus().registerHandler("request.componentselect", new ComponentSelectHandler() );
- x.eventBus().registerHandler("request.createkeyspace", new CreateKeyspaceHandler());
- x.eventBus().registerHandler("request.setkeyspace", new SetKeyspaceHandler());
- x.eventBus().registerHandler("request.createcolumnfamily", new CreateColumnFamilyHandler());
- x.eventBus().registerHandler("request.listkeyspaces", new ListKeyspacesHandler());
- x.eventBus().registerHandler("request.listcolumnfamily", new ListColumnFamilyHandler());
- x.eventBus().registerHandler("request.set", new SetHandler());
- x.eventBus().registerHandler("request.setcolumnfamily", new SetColumnFamilyHandler());
- x.eventBus().registerHandler("request.assume", new AssumeHandler());
- x.eventBus().registerHandler("request.get", new GetHandler(x.eventBus()));
- x.eventBus().registerHandler("request.slice", new SliceHandler(x.eventBus()));
- x.eventBus().registerHandler("request.cqlquery", new CqlQueryHandler());
- x.eventBus().registerHandler("request.counter", new CounterHandler());
- x.eventBus().registerHandler("request.consistency", new ConsistencyHandler());
- x.eventBus().registerHandler("request.createfilter", new CreateFilterHandler(x.eventBus()));
- x.eventBus().registerHandler("request.createprocessor", new CreateProcessorHandler(x.eventBus()));
- x.eventBus().registerHandler("request.filtermode", new FilterModeHandler());
- x.eventBus().registerHandler("request.createmultiprocess", new CreateMultiProcessHandler(x.eventBus()));
- x.eventBus().registerHandler("request.createserviceprocess", new CreateServiceProcessHandler(x.eventBus()));
+ x.eventBus().registerHandler("operations.autotimestamp", new AutotimestampHandler() );
+ x.eventBus().registerHandler("operations.batchset", new BatchHandler() );
+ x.eventBus().registerHandler("operations.componentselect", new ComponentSelectHandler() );
+ x.eventBus().registerHandler("operations.createkeyspace", new CreateKeyspaceHandler());
+ x.eventBus().registerHandler("operations.setkeyspace", new SetKeyspaceHandler());
+ x.eventBus().registerHandler("operations.createcolumnfamily", new CreateColumnFamilyHandler());
+ x.eventBus().registerHandler("operations.listkeyspaces", new ListKeyspacesHandler());
+ x.eventBus().registerHandler("operations.listcolumnfamily", new ListColumnFamilyHandler());
+ x.eventBus().registerHandler("operations.set", new SetHandler());
+ x.eventBus().registerHandler("operations.setcolumnfamily", new SetColumnFamilyHandler());
+ x.eventBus().registerHandler("operations.assume", new AssumeHandler());
+ x.eventBus().registerHandler("operations.get", new GetHandler(x.eventBus()));
+ x.eventBus().registerHandler("operations.slice", new SliceHandler(x.eventBus()));
+ x.eventBus().registerHandler("operations.cqlquery", new CqlQueryHandler());
+ x.eventBus().registerHandler("operations.counter", new CounterHandler());
+ x.eventBus().registerHandler("operations.consistency", new ConsistencyHandler());
+ x.eventBus().registerHandler("operations.createfilter", new CreateFilterHandler(x.eventBus()));
+ x.eventBus().registerHandler("operations.createprocessor", new CreateProcessorHandler(x.eventBus()));
+ x.eventBus().registerHandler("operations.filtermode", new FilterModeHandler());
+ x.eventBus().registerHandler("operations.createmultiprocess", new CreateMultiProcessHandler(x.eventBus()));
+ x.eventBus().registerHandler("operations.createserviceprocess", new CreateServiceProcessHandler(x.eventBus()));
}
}
@@ -341,7 +341,7 @@ public void timeOutLongRunningOperation() throws Exception {
return;
}
- vertx.eventBus().registerHandler("request.noop", new Handler<Message<JsonObject>>() {
+ vertx.eventBus().registerHandler("operations.noop", new Handler<Message<JsonObject>>() {
@Override
public void handle(Message<JsonObject> event) {
try {
@@ -377,7 +377,7 @@ public void handle(Message<JsonObject> event) {
@Test
public void overrideDefaultTimeoutForLongRunningOperation() throws Exception {
- vertx.eventBus().registerHandler("request.noop", new Handler<Message<JsonObject>>() {
+ vertx.eventBus().registerHandler("operations.noop", new Handler<Message<JsonObject>>() {
@Override
public void handle(Message<JsonObject> event) {
try {
@@ -1,9 +1,8 @@
-package org.usergrid.vx.handler.rest;
+package org.usergrid.vx.handler.http.rest;
import org.apache.cassandra.db.ConsistencyLevel;
import org.junit.Before;
import org.junit.Test;
-import org.mockito.Mock;
import org.mockito.Mockito;
import org.vertx.java.core.http.HttpServerRequest;

0 comments on commit 9f982b7

Please sign in to comment.