Permalink
Browse files

fixed default path name

  • Loading branch information...
1 parent b3a03a0 commit 2ad246a8b59c6f5efba2ff2cb4097a020072faaf @zznate committed Mar 7, 2013
@@ -43,7 +43,7 @@ public HelloClient(){
}
public void post(){
- HttpClientRequest req = httpClient.request("POST", "/:appid/hello", this);
+ HttpClientRequest req = httpClient.request("POST", "/intravert/hello", this);
String value ="";
req.putHeader("content-length", value.length());
req.write(value);
@@ -60,7 +60,7 @@ public IntraClient() {
}
public IntraRes sendBlocking(IntraReq i) throws Exception {
- HttpClientRequest req = httpClient.request("POST", "/:appid/intrareq-"+payload, this);
+ HttpClientRequest req = httpClient.request("POST", "/intravert/intrareq-"+payload, this);
if (payload.equalsIgnoreCase("xml")){
ByteArrayOutputStream bo = new ByteArrayOutputStream();
XMLEncoder e = new XMLEncoder(bo);
@@ -25,8 +25,8 @@
private ObjectMapper mapper ;
private SmileFactory sf = new SmileFactory();
private static String METHOD="POST";
- private static String ENDPOINT_JSON="/:appid/intrareq-json";
- private static String ENDPOINT_SMILE="/:appid/intrareq-smile";
+ private static String ENDPOINT_JSON="/intravert/intrareq-json";
+ private static String ENDPOINT_SMILE="/intravert/intrareq-smile";
private String endpoint;
private static final String CONTENT_LENGTH="content-length";
public enum Transport { JSON, SMILE, XML }
@@ -42,7 +42,7 @@ public NoMatchClient(){
}
public void post(){
- HttpClientRequest req = httpClient.request("POST", "/:appid/wrtwrtrwt", this);
+ HttpClientRequest req = httpClient.request("POST", "/intravert/wrtwrtrwt", this);
String value ="";
req.putHeader("content-length", value.length());
req.write(value);
@@ -30,7 +30,7 @@
public class ThriftClient implements Handler<HttpClientResponse> {
public static void main(String[] args) throws Exception {
- String servletUrl = "http://localhost:8080/:appid/thriftjson";
+ String servletUrl = "http://localhost:8080/intravert/thriftjson";
THttpClient thc = new THttpClient(servletUrl);
TProtocol loPFactory = new TJSONProtocol(thc);
@@ -72,11 +72,6 @@ public void start() {
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);
- //rm.get("/:appid/intrareq-rest/:" + IntraHandlerRest.KEYSPACE + "/:" + IntraHandlerRest.COLUMN_FAMILY + "/:" +
- // IntraHandlerRest.ROWKEY + "/:" + IntraHandlerRest.COLUMN, restHandler);
-
rm.noMatch(new NoMatchHandler());
registerOperationHandlers(vertx);
registerRequestHandler(vertx);
@@ -25,9 +25,11 @@
private static final Logger logger = LoggerFactory.getLogger(IntravertDeamon.class);
+ public static final String DEF_BASE_PATH = "/intravert";
+
private static final IntravertDeamon instance = new IntravertDeamon();
public Server intravertServer;
- private static String basePath;
+ private static String basePath = DEF_BASE_PATH;
public static void main(String[] args) {
System.setProperty("cassandra-foreground", "true");
@@ -122,7 +122,7 @@ public void executeColumnSliceQuery() throws Exception {
public void setColumnUsingGetRef() throws Exception {
String insertColumnsJSON = loadJSON("insert_columns_for_getref.json");
final CountDownLatch doneSignal = new CountDownLatch(1);
- final HttpClientRequest setReq = httpClient.request("POST", "/:appid/intrareq-json", new Handler<HttpClientResponse>() {
+ final HttpClientRequest setReq = httpClient.request("POST", "/intravert/intrareq-json", new Handler<HttpClientResponse>() {
@Override
public void handle(HttpClientResponse resp) {
resp.endHandler(new SimpleHandler() {
@@ -139,7 +139,7 @@ protected void handle() {
String getrefJSON = loadJSON("getref.json");
final Buffer data = new Buffer(0);
- final HttpClientRequest getReq = httpClient.request("POST", "/:appid/intrareq-json",
+ final HttpClientRequest getReq = httpClient.request("POST", "/intravert/intrareq-json",
new Handler<HttpClientResponse>() {
@Override
public void handle(HttpClientResponse resp) {
@@ -173,7 +173,7 @@ protected void handle() {
public void filterColumnSlice() throws Exception {
String insertBeersJSON = loadJSON("insert_beers.json");
final CountDownLatch doneSignal = new CountDownLatch(1);
- final HttpClientRequest setReq = httpClient.request("POST", "/:appid/intrareq-json", new Handler<HttpClientResponse>() {
+ final HttpClientRequest setReq = httpClient.request("POST", "/intravert/intrareq-json", new Handler<HttpClientResponse>() {
@Override
public void handle(HttpClientResponse resp) {
resp.endHandler(new SimpleHandler() {
@@ -190,7 +190,7 @@ protected void handle() {
final String getBeersJSON = loadJSON("filter_beers.json");
final Buffer data = new Buffer(0);
- final HttpClientRequest getReq = httpClient.request("POST", "/:appid/intrareq-json",
+ final HttpClientRequest getReq = httpClient.request("POST", "/intravert/intrareq-json",
new Handler<HttpClientResponse>() {
@Override
public void handle(HttpClientResponse resp) {
@@ -224,7 +224,7 @@ protected void handle() {
public void javascriptFilterColumnSlice() throws Exception {
String insertBeersJSON = loadJSON("insert_beers.json");
final CountDownLatch doneSignal = new CountDownLatch(1);
- final HttpClientRequest setReq = httpClient.request("POST", "/:appid/intrareq-json", new Handler<HttpClientResponse>() {
+ final HttpClientRequest setReq = httpClient.request("POST", "/intravert/intrareq-json", new Handler<HttpClientResponse>() {
@Override
public void handle(HttpClientResponse resp) {
resp.endHandler(new SimpleHandler() {
@@ -241,7 +241,7 @@ protected void handle() {
final String getBeersJSON = loadJSON("filter_beers_js.json");
final Buffer data = new Buffer(0);
- final HttpClientRequest getReq = httpClient.request("POST", "/:appid/intrareq-json",
+ final HttpClientRequest getReq = httpClient.request("POST", "/intravert/intrareq-json",
new Handler<HttpClientResponse>() {
@Override
public void handle(HttpClientResponse resp) {
@@ -454,7 +454,7 @@ private String loadJSON(String file) throws Exception {
private String submitRequest(String json) throws InterruptedException {
final Buffer data = new Buffer();
final CountDownLatch doneSignal = new CountDownLatch(1);
- final HttpClientRequest setReq = httpClient.request("POST", "/:appid/intrareq-json", new Handler<HttpClientResponse>() {
+ final HttpClientRequest setReq = httpClient.request("POST", "/intravert/intrareq-json", new Handler<HttpClientResponse>() {
@Override
public void handle(HttpClientResponse resp) {
resp.dataHandler(new Handler<Buffer>() {

0 comments on commit 2ad246a

Please sign in to comment.