diff options
author | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2009-11-11 18:04:06 +0000 |
---|---|---|
committer | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2009-11-11 18:04:06 +0000 |
commit | 9d6f2d2fd74f310f2c9a87a69f44ac7091f450d3 (patch) | |
tree | 29b27699e391612ea164cc8f99da3a6d7fa5ea30 /java/sca/modules/endpoint-zookeeper/src/main/java/org/apache/tuscany/sca/endpoint/zookeeper/ZooKeeperHelper.java | |
parent | 1e1bcd41fba653ea4adb5dc9a04d7ce79ea30081 (diff) |
Start to implement the EndpointRegistry interface
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@834990 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-rw-r--r-- | java/sca/modules/endpoint-zookeeper/src/main/java/org/apache/tuscany/sca/endpoint/zookeeper/ZooKeeperHelper.java | 36 |
1 files changed, 1 insertions, 35 deletions
diff --git a/java/sca/modules/endpoint-zookeeper/src/main/java/org/apache/tuscany/sca/endpoint/zookeeper/ZooKeeperHelper.java b/java/sca/modules/endpoint-zookeeper/src/main/java/org/apache/tuscany/sca/endpoint/zookeeper/ZooKeeperHelper.java index 3f7a5c63be..e92df3d91d 100644 --- a/java/sca/modules/endpoint-zookeeper/src/main/java/org/apache/tuscany/sca/endpoint/zookeeper/ZooKeeperHelper.java +++ b/java/sca/modules/endpoint-zookeeper/src/main/java/org/apache/tuscany/sca/endpoint/zookeeper/ZooKeeperHelper.java @@ -22,13 +22,9 @@ package org.apache.tuscany.sca.endpoint.zookeeper; import java.io.File; import java.io.IOException; import java.io.UnsupportedEncodingException; -import java.net.URI; -import java.net.URLDecoder; import java.util.ArrayList; import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import org.apache.zookeeper.CreateMode; import org.apache.zookeeper.KeeperException; @@ -170,37 +166,7 @@ public class ZooKeeperHelper implements Watcher { return null; } - private Map<String, String> parseURI(Map<String, String> attributes, String domainRegistryURI) { - Map<String, String> map = new HashMap<String, String>(); - if (attributes != null) { - map.putAll(attributes); - } - URI uri = URI.create(domainRegistryURI); - if (uri.getHost() != null) { - map.put("host", uri.getHost()); - } - if (uri.getPort() != -1) { - map.put("port", String.valueOf(uri.getPort())); - } - int index = domainRegistryURI.indexOf('?'); - if (index == -1) { - return map; - } - String query = domainRegistryURI.substring(index + 1); - try { - query = URLDecoder.decode(query, "UTF-8"); - } catch (UnsupportedEncodingException e) { - throw new IllegalArgumentException(e); - } - String[] params = query.split("&"); - for (String param : params) { - index = param.indexOf('='); - if (index != -1) { - map.put(param.substring(0, index), param.substring(index + 1)); - } - } - return map; - } + public static void main(final String[] args) throws Exception { final String options[] = |