Permalink
Browse files

some test with json-rpc and named params final

  • Loading branch information...
1 parent 6798143 commit b4c31dc3f08b9a261e1bb30cc7b4f6d5bb4715c3 tomek committed Jul 21, 2012
@@ -5,10 +5,6 @@
package com.kuprowski.helenos.service;
import com.googlecode.jsonrpc4j.JsonRpcParam;
-import com.kuprowski.helenos.types.JsonColumnFamilyDefinition;
-import com.kuprowski.helenos.types.JsonKeyspaceDefinition;
-import com.kuprowski.helenos.types.qx.QxJsonColumnFamilyDefinition;
-import java.util.List;
import java.util.UUID;
/**
@@ -17,8 +13,6 @@
*/
public interface QueryProvider {
- String get(String columnFamily, UUID uuidKey, String column);
- String get(String columnFamily, String stringKey, String column);
-
- String getUK(@JsonRpcParam("cf") String columnFamily, @JsonRpcParam("key") UUID key, @JsonRpcParam("column") String column);
+ String get(@JsonRpcParam("cf") String columnFamily,@JsonRpcParam("uuidKey") UUID key,@JsonRpcParam("column") String column);
+ String get(@JsonRpcParam("cf") String columnFamily,@JsonRpcParam("stringKey") String key,@JsonRpcParam("column") String column);
}
@@ -4,32 +4,36 @@
*/
package com.kuprowski.helenos.service.impl;
-import com.googlecode.jsonrpc4j.JsonRpcParam;
import com.kuprowski.helenos.service.QueryProvider;
import java.util.UUID;
import org.springframework.stereotype.Component;
/**
- *
+ * query example:
+ {
+ "id": 1,
+ "jsonrpc": "2.0",
+ "method": "get",
+ "params": {
+ "cf": "none",
+ "uuidKey": "550e8400-e29b-41d4-a716-446655440000",
+ "column": "none"
+ }
+ }
* @author tomek
*/
@Component("queryProvider")
public class QueryProviderImpl extends AbstractProvider implements QueryProvider {
@Override
- public String get(String columnFamily, UUID uuidKey, String column) {
+ public String get(String columnFamily, UUID key, String column) {
return "UUID xxx";
}
@Override
- public String get(String columnFamily, String stringKey, String column) {
+ public String get(String columnFamily, String key, String column) {
return "String xxx";
- }
-
+ }
- @Override
- public String getUK(@JsonRpcParam("cf") String columnFamily, UUID key, String column) {
- return "UUID yyy";
- }
}

0 comments on commit b4c31dc

Please sign in to comment.