Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

initial adjustment to configurable pathing

  • Loading branch information...
commit b3a03a0b3ad589621480f75ecd94ec06ec63cb30 1 parent cd224e9
@zznate authored
View
2  examples/json/create_schema.sh
@@ -1,3 +1,3 @@
echo "Creating keyspace 'myks' and column family 'mycf'"
-curl -vX POST http://localhost:8080/myapp/intrareq-json -d "{\"e\":[ {\"type\":\"CREATEKEYSPACE\",\"op\":{\"name\":\"myks\",\"replication\":1}}, {\"type\":\"CREATECOLUMNFAMILY\",\"op\":{\"name\":\"mycf\"}} ]}"
+curl -vX POST http://localhost:8080/intravert/intrareq-json -d "{\"e\":[ {\"type\":\"CREATEKEYSPACE\",\"op\":{\"name\":\"myks\",\"replication\":1}}, {\"type\":\"CREATECOLUMNFAMILY\",\"op\":{\"name\":\"mycf\"}} ]}"
echo
View
4 examples/rest/create_keyspace.sh
@@ -1,6 +1,6 @@
echo "Creating a new keyspace [mynewks]:"
-curl -X POST http://localhost:8080/myapp/intrareq-rest/mynewks/
+curl -X POST http://localhost:8080/intravert/intrareq-rest/mynewks/
echo
echo "Listing keyspaces to see if it is there:"
-curl -X GET http://localhost:8080/myapp/intrareq-rest/
+curl -X GET http://localhost:8080/intravert/intrareq-rest/
echo
View
4 examples/rest/drop_keyspace.sh
@@ -1,6 +1,6 @@
echo "Dropping a keyspace [mynewks]:"
-curl -X DELETE http://localhost:8080/myapp/intrareq-rest/mynewks2/
+curl -X DELETE http://localhost:8080/intravert/intrareq-rest/mynewks2/
echo
echo "Listing keyspaces to see if it is there:"
-curl -X GET http://localhost:8080/myapp/intrareq-rest/
+curl -X GET http://localhost:8080/intravert/intrareq-rest/
echo
View
2  examples/rest/list_column_families.sh
@@ -1,3 +1,3 @@
echo "Listing column families."
-curl -X GET http://localhost:8080/myapp/intrareq-rest/myks/
+curl -X GET http://localhost:8080/intravert/intrareq-rest/myks/
echo
View
2  examples/rest/list_keyspaces.sh
@@ -1,3 +1,3 @@
echo "Listing keyspaces."
-curl -X GET http://localhost:8080/myapp/intrareq-rest/
+curl -X GET http://localhost:8080/intravert/intrareq-rest/
echo
View
2  examples/rest/upsert_column.sh
@@ -1,3 +1,3 @@
echo "Creating keyspace 'myks' and column family 'mycf'"
-curl -vX POST http://localhost:8080/myapp/intrareq-rest/myks/mycf/myrow/mycol
+curl -vX POST http://localhost:8080/intravert/intrareq-rest/myks/mycf/myrow/mycol
echo
View
2  examples/say_hello.sh
@@ -1,3 +1,3 @@
echo "Saying hello to Intravert, should return ok"
-curl http://localhost:8080/myapp/hello
+curl http://localhost:8080/intravert/hello
echo
View
26 src/main/java/org/usergrid/vx/server/IntravertCassandraServer.java
@@ -45,26 +45,32 @@
private static RouteMatcher rm;
private static IntravertClusterNotifier intravertClusterNotifier;
private static final AtomicBoolean running = new AtomicBoolean(false);
+ private final String basePath;
+
+ public IntravertCassandraServer(String basePath) {
+ this.basePath = basePath;
+ }
+
@Override
public void start() {
- logger.debug("Starting IntravertCassandraServer...");
+ logger.info("Starting IntravertCassandraServer with base path {}", basePath);
vertx = Vertx.newVertx();
rm = new RouteMatcher();
// TODO Should we use a single instance of HelloHandler here?
- rm.put("/:appid/hello", new HelloHandler());
- rm.get("/:appid/hello", new HelloHandler());
- rm.post("/:appid/hello", new HelloHandler());
- rm.post("/:appid/intrareq-json", new IntraHandlerJson(vertx));
- rm.post("/:appid/intrareq-jsonsmile", new IntraHandlerJsonSmile(vertx));
+ rm.put(String.format("%s/hello", basePath), new HelloHandler());
+ rm.get(String.format("%s/hello", basePath), new HelloHandler());
+ rm.post(String.format("%s/hello", basePath), new HelloHandler());
+ rm.post(String.format("%s/intrareq-json", basePath), new IntraHandlerJson(vertx));
+ rm.post(String.format("%s/intrareq-jsonsmile", basePath), new IntraHandlerJsonSmile(vertx));
SystemMetaHandler systemMetaHandler = new SystemMetaHandler(vertx);
KeyspaceMetaHandler keyspaceMetaHandler = new KeyspaceMetaHandler(vertx);
- rm.get("/:appid/intrareq-rest/", systemMetaHandler);
- rm.get("/:appid/intrareq-rest/:ks/", keyspaceMetaHandler);
- rm.post("/:appid/intrareq-rest/:ks/", keyspaceMetaHandler);
- rm.delete("/:appid/intrareq-rest/:ks/", keyspaceMetaHandler);
+ rm.get(String.format("%s/intrareq-rest/", basePath),systemMetaHandler);
+ rm.get(String.format("%s/intrareq-rest/:ks/", basePath), keyspaceMetaHandler);
+ rm.post(String.format("%s/intrareq-rest/:ks/",basePath), keyspaceMetaHandler);
+ rm.delete(String.format("%s/intrareq-rest/:ks/", basePath),keyspaceMetaHandler);
//rm.post("/:appid/intrareq-rest/:" + IntraHandlerRest.KEYSPACE + "/:" + IntraHandlerRest.COLUMN_FAMILY + "/:" +
// IntraHandlerRest.ROWKEY + "/:" + IntraHandlerRest.COLUMN, restHandler);
View
10 src/main/java/org/usergrid/vx/server/IntravertDeamon.java
@@ -27,32 +27,30 @@
private static final IntravertDeamon instance = new IntravertDeamon();
public Server intravertServer;
+ private static String basePath;
public static void main(String[] args) {
System.setProperty("cassandra-foreground", "true");
System.setProperty("log4j.defaultInitOverride", "true");
System.setProperty("log4j.configuration", "log4j.properties");
- //CassandraDaemon.initLog4j();
+ basePath = System.getProperty("basePath","/intravert");
instance.activate();
- //IntravertDeamon is = new IntravertDeamon();
-
}
@Override
protected void setup() {
super.setup();
- intravertServer = new IntravertCassandraServer();
+ intravertServer = new IntravertCassandraServer(basePath);
}
@Override
public void init(String[] arguments) throws IOException {
- super.init(arguments); //To change body of overridden methods use File | Settings | File Templates.
+ super.init(arguments);
}
@Override
public void start() {
- //super.start();
intravertServer.start();
}
Please sign in to comment.
Something went wrong with that request. Please try again.