You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by cl...@apache.org on 2015/05/06 17:21:04 UTC

[1/5] activemq-artemis git commit: small CLI CREATE fix

Repository: activemq-artemis
Updated Branches:
  refs/heads/master 179903fe7 -> ebccde954


small CLI CREATE fix


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/6fea6ca6
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/6fea6ca6
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/6fea6ca6

Branch: refs/heads/master
Commit: 6fea6ca66e617546dc1743295f1efb35dba45175
Parents: 8446bce
Author: Andy Taylor <an...@gmail.com>
Authored: Wed May 6 11:04:02 2015 +0100
Committer: Andy Taylor <an...@gmail.com>
Committed: Wed May 6 15:12:32 2015 +0100

----------------------------------------------------------------------
 .../main/java/org/apache/activemq/artemis/cli/commands/Create.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6fea6ca6/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Create.java
----------------------------------------------------------------------
diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Create.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Create.java
index 9eaf4da..074ced0 100644
--- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Create.java
+++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Create.java
@@ -121,7 +121,7 @@ public class Create implements Action
       this.context = context;
       scanner = new Scanner(System.in);
       IS_WINDOWS = System.getProperty("os.name").toLowerCase().trim().startsWith("win");
-      IS_CYGWIN = IS_WINDOWS && System.getenv("OSTYPE") == "cygwin";
+      IS_CYGWIN = IS_WINDOWS && "cygwin".equals(System.getenv("OSTYPE"));
 
       context.out.println(String.format("Creating ActiveMQ Artemis instance at: %s", directory.getCanonicalPath()));
       if (host == null)


[5/5] activemq-artemis git commit: This closes #229 on CLI changes

Posted by cl...@apache.org.
This closes #229 on CLI changes


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/ebccde95
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/ebccde95
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/ebccde95

Branch: refs/heads/master
Commit: ebccde9543b5f7f525bd54ce6bafed66b290fc90
Parents: 179903f 6fea6ca
Author: Clebert Suconic <cl...@apache.org>
Authored: Wed May 6 11:20:39 2015 -0400
Committer: Clebert Suconic <cl...@apache.org>
Committed: Wed May 6 11:20:39 2015 -0400

----------------------------------------------------------------------
 .../activemq/artemis/cli/commands/Create.java   | 71 +++++++++++++++++---
 .../artemis/cli/commands/etc/broker.xml         | 12 ++--
 .../commands/etc/cluster-security-settings.txt  |  3 +
 3 files changed, 71 insertions(+), 15 deletions(-)
----------------------------------------------------------------------



[3/5] activemq-artemis git commit: add the ability to off set the defaul ports for the CLI create command

Posted by cl...@apache.org.
add the ability to off set the defaul ports for the CLI create command


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/0bbe8c87
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/0bbe8c87
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/0bbe8c87

Branch: refs/heads/master
Commit: 0bbe8c87f0d381ad883721f870875d610a314e62
Parents: 179903f
Author: Andy Taylor <an...@gmail.com>
Authored: Wed May 6 08:46:34 2015 +0100
Committer: Andy Taylor <an...@gmail.com>
Committed: Wed May 6 15:12:32 2015 +0100

----------------------------------------------------------------------
 .../apache/activemq/artemis/cli/commands/Create.java | 15 +++++++++++++++
 .../activemq/artemis/cli/commands/etc/broker.xml     | 10 +++++-----
 2 files changed, 20 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/0bbe8c87/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Create.java
----------------------------------------------------------------------
diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Create.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Create.java
index 4c09202..099e737 100644
--- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Create.java
+++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Create.java
@@ -52,12 +52,23 @@ import static java.nio.file.attribute.PosixFilePermission.OWNER_WRITE;
 @Command(name = "create", description = "creates a new broker instance")
 public class Create implements Action
 {
+   private static final Integer DEFAULT_PORT = 61616;
+
+   private static final Integer AMQP_PORT = 5672;
+
+   private static final Integer STOMP_PORT = 61613;
+
+   private static final Integer HQ_PORT = 5445;
+
    @Arguments(description = "The instance directory to hold the broker's configuration and data", required = true)
    File directory;
 
    @Option(name = "--host", description = "The host name of the broker")
    String host;
 
+   @Option(name = "--port-offset", description = "Off sets the default ports")
+   int portOffset;
+
    @Option(name = "--force", description = "Overwrite configuration at destination directory")
    boolean force;
 
@@ -141,6 +152,10 @@ public class Create implements Action
 
       filters.put("${user}", System.getProperty("user.name", ""));
       filters.put("${host}", host);
+      filters.put("${default.port}", String.valueOf(DEFAULT_PORT + portOffset));
+      filters.put("${amqp.port}", String.valueOf(AMQP_PORT + portOffset));
+      filters.put("${stomp.port}", String.valueOf(STOMP_PORT + portOffset));
+      filters.put("${hq.port}", String.valueOf(HQ_PORT + portOffset));
       if (home != null)
       {
          filters.put("${home}", path(home, false));

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/0bbe8c87/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/broker.xml
----------------------------------------------------------------------
diff --git a/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/broker.xml b/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/broker.xml
index 7b92851..ed7ac67 100644
--- a/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/broker.xml
+++ b/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/broker.xml
@@ -38,21 +38,21 @@ under the License.
 
       <connectors>
          <!-- Default Connector.  Returned to clients during broadcast and distributed around cluster.  See broadcast and discovery-groups -->
-         <connector name="activemq">tcp://${activemq.remoting.default.host:${host}}:${activemq.remoting.default.port:61616}</connector>
+         <connector name="activemq">tcp://${activemq.remoting.default.host:${host}}:${activemq.remoting.default.port:${default.port}}</connector>
       </connectors>
 
       <acceptors>
          <!-- Default ActiveMQ Acceptor.  Multi-protocol adapter.  Currently supports Core, OpenWire, Stomp and AMQP. -->
-         <acceptor name="activemq">tcp://${activemq.remoting.default.host:${host}}:${activemq.remoting.default.port:61616}</acceptor>
+         <acceptor name="activemq">tcp://${activemq.remoting.default.host:${host}}:${activemq.remoting.default.port:${default.port}}</acceptor>
 
          <!-- AMQP Acceptor.  Listens on default AMQP port for AMQP traffic.-->
-         <acceptor name="amqp">tcp://${activemq.remoting.amqp.host:${host}}:${activemq.remoting.amqp.port:5672}?protocols=AMQP</acceptor>
+         <acceptor name="amqp">tcp://${activemq.remoting.amqp.host:${host}}:${activemq.remoting.amqp.port:${amqp.port}}?protocols=AMQP</acceptor>
 
          <!-- STOMP Acceptor. -->
-         <acceptor name="stomp">tcp://${activemq.remoting.stomp.host:${host}}:${activemq.remoting.stomp.port:61613}?protocols=STOMP</acceptor>
+         <acceptor name="stomp">tcp://${activemq.remoting.stomp.host:${host}}:${activemq.remoting.stomp.port:${stomp.port}}?protocols=STOMP</acceptor>
 
          <!-- HornetQ Compatibility Acceptor.  Enables ActiveMQ Core and STOMP for legacy HornetQ clients. -->
-         <acceptor name="hornetq">tcp://${activemq.remoting.hornetq.host:${host}}:${activemq.remoting.hornetq.port:5445}?protocols=CORE,STOMP</acceptor>
+         <acceptor name="hornetq">tcp://${activemq.remoting.hornetq.host:${host}}:${activemq.remoting.hornetq.port:${hq.port}}?protocols=CORE,STOMP</acceptor>
       </acceptors>
 
       ${cluster.settings}${replicated.settings}${shared-store.settings}


[4/5] activemq-artemis git commit: remove wilth-ssl option from CLI create command

Posted by cl...@apache.org.
remove wilth-ssl option from CLI create command


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/0099c361
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/0099c361
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/0099c361

Branch: refs/heads/master
Commit: 0099c361254f5fe9ab8c69c611d4ae8948763191
Parents: 0bbe8c8
Author: Andy Taylor <an...@gmail.com>
Authored: Wed May 6 09:00:41 2015 +0100
Committer: Andy Taylor <an...@gmail.com>
Committed: Wed May 6 15:12:32 2015 +0100

----------------------------------------------------------------------
 .../java/org/apache/activemq/artemis/cli/commands/Create.java     | 3 ---
 1 file changed, 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/0099c361/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Create.java
----------------------------------------------------------------------
diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Create.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Create.java
index 099e737..8209204 100644
--- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Create.java
+++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Create.java
@@ -75,9 +75,6 @@ public class Create implements Action
    @Option(name = "--home", description = "Directory where ActiveMQ Artemis is installed")
    File home;
 
-   @Option(name = "--with-ssl", description = "Generate an SSL enabled configuration")
-   boolean with_ssl = true;
-
    @Option(name = "--clustered", description = "Enable clustering")
    boolean clustered = false;
 


[2/5] activemq-artemis git commit: added cluster security settings to CLI create command

Posted by cl...@apache.org.
added cluster security settings to CLI create command


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/8446bce8
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/8446bce8
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/8446bce8

Branch: refs/heads/master
Commit: 8446bce8e9dbb8db78d6ec79f0d9dc910fb648c6
Parents: 0099c36
Author: Andy Taylor <an...@gmail.com>
Authored: Wed May 6 10:59:45 2015 +0100
Committer: Andy Taylor <an...@gmail.com>
Committed: Wed May 6 15:12:32 2015 +0100

----------------------------------------------------------------------
 .../activemq/artemis/cli/commands/Create.java   | 51 ++++++++++++++++++--
 .../artemis/cli/commands/etc/broker.xml         |  2 +-
 .../commands/etc/cluster-security-settings.txt  |  3 ++
 3 files changed, 50 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/8446bce8/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Create.java
----------------------------------------------------------------------
diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Create.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Create.java
index 8209204..9eaf4da 100644
--- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Create.java
+++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Create.java
@@ -30,6 +30,7 @@ import java.util.Arrays;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Map;
+import java.util.Scanner;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
@@ -84,11 +85,21 @@ public class Create implements Action
    @Option(name = "--shared-store", description = "Enable broker shared store")
    boolean sharedStore = false;
 
+   @Option(name = "--cluster-user", description = "The cluster user to use for clustering")
+   String clusterUser = null;
+
+   @Option(name = "--cluster-password", description = "The cluster password to use for clustering")
+   String clusterPassword = null;
+
    @Option(name = "--encoding", description = "The encoding that text files should use")
    String encoding = "UTF-8";
 
    ActionContext context;
+
+   private Scanner scanner;
+
    boolean IS_WINDOWS;
+
    boolean IS_CYGWIN;
 
    @Override
@@ -108,14 +119,10 @@ public class Create implements Action
    public Object run(ActionContext context) throws Exception
    {
       this.context = context;
+      scanner = new Scanner(System.in);
       IS_WINDOWS = System.getProperty("os.name").toLowerCase().trim().startsWith("win");
       IS_CYGWIN = IS_WINDOWS && System.getenv("OSTYPE") == "cygwin";
 
-      if (clustered & sharedStore)
-      {
-
-      }
-
       context.out.println(String.format("Creating ActiveMQ Artemis instance at: %s", directory.getCanonicalPath()));
       if (host == null)
       {
@@ -140,11 +147,39 @@ public class Create implements Action
       filters.put("${shared-store.settings}", sharedStoreSettings);
 
       String clusterSettings = "";
+      String clusterSecuritySettings = "";
+      String clusterUserSettings = "";
+      String clusterPasswordSettings = "";
       if (clustered)
       {
          clusterSettings = readTextFile("etc/cluster-settings.txt");
+
+         if (clusterUser == null)
+         {
+            clusterUser = input("Please provide a user name for clustering (leave empty for default)");
+         }
+
+         if (clusterUser != null && clusterUser.length() > 0)
+         {
+            clusterUserSettings = clusterUser;
+            clusterSecuritySettings = readTextFile("etc/cluster-security-settings.txt");
+         }
+
+         if (clusterPassword == null)
+         {
+            clusterPassword = input("Please provide a password for clustering (leave empty for default)");
+
+         }
+
+         if (clusterPassword != null && clusterPassword.length() > 0)
+         {
+            clusterPasswordSettings = clusterPassword;
+         }
       }
+      filters.put("${cluster-security.settings}", clusterSecuritySettings);
       filters.put("${cluster.settings}", clusterSettings);
+      filters.put("${cluster-user}", clusterUserSettings);
+      filters.put("${cluster-password}", clusterPasswordSettings);
 
 
       filters.put("${user}", System.getProperty("user.name", ""));
@@ -237,6 +272,12 @@ public class Create implements Action
       return null;
    }
 
+   private String input(String prompt)
+   {
+      context.out.println(prompt);
+      return scanner.nextLine();
+   }
+
    private void makeExec(String path) throws IOException
    {
       try

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/8446bce8/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/broker.xml
----------------------------------------------------------------------
diff --git a/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/broker.xml b/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/broker.xml
index ed7ac67..e32e966 100644
--- a/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/broker.xml
+++ b/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/broker.xml
@@ -55,7 +55,7 @@ under the License.
          <acceptor name="hornetq">tcp://${activemq.remoting.hornetq.host:${host}}:${activemq.remoting.hornetq.port:${hq.port}}?protocols=CORE,STOMP</acceptor>
       </acceptors>
 
-      ${cluster.settings}${replicated.settings}${shared-store.settings}
+      ${cluster-security.settings}${cluster.settings}${replicated.settings}${shared-store.settings}
 
       <security-settings>
          <security-setting match="#">

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/8446bce8/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/cluster-security-settings.txt
----------------------------------------------------------------------
diff --git a/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/cluster-security-settings.txt b/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/cluster-security-settings.txt
new file mode 100644
index 0000000..bb81780
--- /dev/null
+++ b/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/cluster-security-settings.txt
@@ -0,0 +1,3 @@
+
+      <cluster-user>${cluster-user}</cluster-user>
+      <cluster-password>${cluster-password}</cluster-password>
\ No newline at end of file