diff options
author | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2009-05-16 08:44:44 +0000 |
---|---|---|
committer | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2009-05-16 08:44:44 +0000 |
commit | 3d3b8834b93b98cc7d7534e693e937179067eb58 (patch) | |
tree | 1c31b939872ea8455118a16009a2abb96179ecf1 /branches/sca-java-1.5/samples/store-android/src/services/CatalogProxy.java | |
parent | 86101a456fb21b25abc09533769805911efd1c7f (diff) |
Delete previous 1.5 branch thats now old and unused and will be replaced with the current 1.x trunk
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@775435 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'branches/sca-java-1.5/samples/store-android/src/services/CatalogProxy.java')
-rw-r--r-- | branches/sca-java-1.5/samples/store-android/src/services/CatalogProxy.java | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/branches/sca-java-1.5/samples/store-android/src/services/CatalogProxy.java b/branches/sca-java-1.5/samples/store-android/src/services/CatalogProxy.java deleted file mode 100644 index 3ce9459844..0000000000 --- a/branches/sca-java-1.5/samples/store-android/src/services/CatalogProxy.java +++ /dev/null @@ -1,52 +0,0 @@ -package services; - -import java.util.ArrayList; -import java.util.List; - -import org.json.JSONArray; -import org.json.JSONException; -import org.json.JSONObject; - -import services.json.rpc.JSONRpc; - -public class CatalogProxy implements Catalog { - private static final String jsonRPCServiceURI = "http://192.168.1.104:8080/Catalog"; - private static final String jsonRPCRequest = "{\"id\": 3, \"method\": \"Service.get\", \"params\": []}"; - - private List<Item> catalog = new ArrayList<Item>(); - - public CatalogProxy() { - initialize(); - } - - public void initialize() { - JSONObject json = null; - - try { - json = JSONRpc.invoke(jsonRPCServiceURI, jsonRPCRequest); - - if(json == null) { - return; - } - - JSONArray result = json.getJSONArray("result"); - for(int i = 0; i < result.length(); i++) { - Item item = new Item(); - item.setName(result.getJSONObject(i).getString("name")); - item.setPrice(result.getJSONObject(i).getString("price")); - - catalog.add(item); - } - - } catch (JSONException e) { - e.printStackTrace(); - } - } - - public Item[] get() { - Item[] catalogArray = new Item[catalog.size()]; - catalog.toArray(catalogArray); - return catalogArray; - } - -} |