Repository: incubator-ignite Updated Branches: refs/heads/ignite-1121 d5925e688 -> b9d650a7b
IGNITE-1121 Fix issues found on review. Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/b9d650a7 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/b9d650a7 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/b9d650a7 Branch: refs/heads/ignite-1121 Commit: b9d650a7bc26e27d66e9f176dcb3878540224d4a Parents: d5925e6 Author: sevdokimov <sevdoki...@gridgain.com> Authored: Tue Jul 28 14:31:43 2015 +0300 Committer: sevdokimov <sevdoki...@gridgain.com> Committed: Tue Jul 28 14:31:43 2015 +0300 ---------------------------------------------------------------------- modules/control-center-agent/README.txt | 20 ++++++++++++++++++++ .../java/org/apache/ignite/agent/Agent.java | 12 ++++++------ .../org/apache/ignite/agent/AgentLauncher.java | 2 +- .../src/main/resources/config.properties | 9 +++++++++ 4 files changed, 36 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b9d650a7/modules/control-center-agent/README.txt ---------------------------------------------------------------------- diff --git a/modules/control-center-agent/README.txt b/modules/control-center-agent/README.txt new file mode 100644 index 0000000..29abc2f --- /dev/null +++ b/modules/control-center-agent/README.txt @@ -0,0 +1,20 @@ +Apache Ignite Control Center Agent +--------------------------- +Apache Ignite Control Center Agent is a java standalone application that allow to connect grid to control center. +Control Center Agent communicates with grid nodes via REST interface and connects to Control Center via web-socket. + +--------------------------- +Usage example: +agent.sh -l ivan.iva...@gmail.com -p qwerty -s wss://control-center.gridgain.com + +Command line arguments: + -l User's login (email) on web-control-center + -p User's password + -s Link to Ignite Control Center web-socket server. + -n Ignite REST server + -c Configure agent using configuration file. Configuration file is a properties file, + see /control-center-agent/src/main/resources/config.properties as example. + +--------------------------- +Building module: +to build module run "mvn package" \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b9d650a7/modules/control-center-agent/src/main/java/org/apache/ignite/agent/Agent.java ---------------------------------------------------------------------- diff --git a/modules/control-center-agent/src/main/java/org/apache/ignite/agent/Agent.java b/modules/control-center-agent/src/main/java/org/apache/ignite/agent/Agent.java index ca2ff51..ba3a9fd 100644 --- a/modules/control-center-agent/src/main/java/org/apache/ignite/agent/Agent.java +++ b/modules/control-center-agent/src/main/java/org/apache/ignite/agent/Agent.java @@ -39,7 +39,7 @@ public class Agent { private final AgentConfiguration cfg; /** */ - private CloseableHttpClient httpclient; + private CloseableHttpClient httpClient; /** * @param cfg Config. @@ -52,15 +52,15 @@ public class Agent { * */ public void start() { - httpclient = HttpClientBuilder.create().build(); + httpClient = HttpClientBuilder.create().build(); } /** * */ public void stop() throws IOException { - if (httpclient != null) - httpclient.close(); + if (httpClient != null) + httpClient.close(); } /** @@ -100,7 +100,7 @@ public class Agent { post = new HttpPost(builder.build()); - if (nvps.size() > 0) + if (!nvps.isEmpty()) post.setEntity(new UrlEncodedFormEntity(nvps)); } else { @@ -114,7 +114,7 @@ public class Agent { else throw new IOException("Unknown HTTP-method: " + restReq.getMethod()); - try (CloseableHttpResponse resp = httpclient.execute(httpReq)) { + try (CloseableHttpResponse resp = httpClient.execute(httpReq)) { ByteArrayOutputStream out = new ByteArrayOutputStream(); resp.getEntity().writeTo(out); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b9d650a7/modules/control-center-agent/src/main/java/org/apache/ignite/agent/AgentLauncher.java ---------------------------------------------------------------------- diff --git a/modules/control-center-agent/src/main/java/org/apache/ignite/agent/AgentLauncher.java b/modules/control-center-agent/src/main/java/org/apache/ignite/agent/AgentLauncher.java index fabd603..1ed5448 100644 --- a/modules/control-center-agent/src/main/java/org/apache/ignite/agent/AgentLauncher.java +++ b/modules/control-center-agent/src/main/java/org/apache/ignite/agent/AgentLauncher.java @@ -57,7 +57,7 @@ public class AgentLauncher { AgentCommandLine cmdCfg = new AgentCommandLine(); - JCommander cmd = new JCommander(cmdCfg, args); + new JCommander(cmdCfg, args); if (cmdCfg.getConfigFile() != null) cfg.load(new File(cmdCfg.getConfigFile()).toURI().toURL()); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b9d650a7/modules/control-center-agent/src/main/resources/config.properties ---------------------------------------------------------------------- diff --git a/modules/control-center-agent/src/main/resources/config.properties b/modules/control-center-agent/src/main/resources/config.properties index f9b48b7..e7064b7 100644 --- a/modules/control-center-agent/src/main/resources/config.properties +++ b/modules/control-center-agent/src/main/resources/config.properties @@ -1,2 +1,11 @@ +# Ignite Control Center web-socket server URI. serverURI=wss://localhost:3001 + +# Default Ignite node server URI. nodeURI=http://localhost:8080 + +# User's login (email) on Ignite Control Center +# login=ivan.iva...@gmail.com + +# User's password +# password=qwert \ No newline at end of file