james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e...@apache.org
Subject svn commit: r1350127 - in /james/server/trunk/cli/src/main/java/org/apache/james/cli: ServerCmd.java probe/ServerProbe.java probe/impl/JmxServerProbe.java type/CmdType.java
Date Thu, 14 Jun 2012 08:47:04 GMT
Author: eric
Date: Thu Jun 14 08:47:04 2012
New Revision: 1350127

URL: http://svn.apache.org/viewvc?rev=1350127&view=rev
Log:
Add containsdomain in cli (JAMES-1421)

Modified:
    james/server/trunk/cli/src/main/java/org/apache/james/cli/ServerCmd.java
    james/server/trunk/cli/src/main/java/org/apache/james/cli/probe/ServerProbe.java
    james/server/trunk/cli/src/main/java/org/apache/james/cli/probe/impl/JmxServerProbe.java
    james/server/trunk/cli/src/main/java/org/apache/james/cli/type/CmdType.java

Modified: james/server/trunk/cli/src/main/java/org/apache/james/cli/ServerCmd.java
URL: http://svn.apache.org/viewvc/james/server/trunk/cli/src/main/java/org/apache/james/cli/ServerCmd.java?rev=1350127&r1=1350126&r2=1350127&view=diff
==============================================================================
--- james/server/trunk/cli/src/main/java/org/apache/james/cli/ServerCmd.java (original)
+++ james/server/trunk/cli/src/main/java/org/apache/james/cli/ServerCmd.java Thu Jun 14 08:47:04
2012
@@ -153,6 +153,13 @@ public class ServerCmd {
                     printUsage();
                     System.exit(1);
                 }
+            } else if (CmdType.CONTAINSDOMAIN.equals(cmdType)) {
+                if (cmdType.hasCorrectArguments(arguments.length)) {
+                    probe.containsDomain(arguments[1]);
+                } else {
+                    printUsage();
+                    System.exit(1);
+                }
             } else if (CmdType.LISTDOMAINS.equals(cmdType)) {
                 if (cmdType.hasCorrectArguments(arguments.length)) {
                     sCmd.print(probe.listDomains(), System.out);
@@ -270,6 +277,7 @@ public class ServerCmd {
                 + "removeuser <username>%n" 
                 + "listusers%n" 
                 + "adddomain <domainname>%n"
+                + "containsdomain <domainname>%n" 
                 + "removedomain <domainname>%n" 
                 + "listdomains%n"
                 + "addAddressMapping <user> <domain> <fromaddress>%n"

Modified: james/server/trunk/cli/src/main/java/org/apache/james/cli/probe/ServerProbe.java
URL: http://svn.apache.org/viewvc/james/server/trunk/cli/src/main/java/org/apache/james/cli/probe/ServerProbe.java?rev=1350127&r1=1350126&r2=1350127&view=diff
==============================================================================
--- james/server/trunk/cli/src/main/java/org/apache/james/cli/probe/ServerProbe.java (original)
+++ james/server/trunk/cli/src/main/java/org/apache/james/cli/probe/ServerProbe.java Thu Jun
14 08:47:04 2012
@@ -71,6 +71,15 @@ public interface ServerProbe {
     public void addDomain(String domain) throws Exception;
 
     /**
+     * Return true if the domain exists in the service
+     * 
+     * @param domain
+     *            The domain to remove.
+     * @throws Exception
+     */
+    public boolean containsDomain(String domain) throws Exception;
+
+    /**
      * Remove domain from the service
      * 
      * @param domain

Modified: james/server/trunk/cli/src/main/java/org/apache/james/cli/probe/impl/JmxServerProbe.java
URL: http://svn.apache.org/viewvc/james/server/trunk/cli/src/main/java/org/apache/james/cli/probe/impl/JmxServerProbe.java?rev=1350127&r1=1350126&r2=1350127&view=diff
==============================================================================
--- james/server/trunk/cli/src/main/java/org/apache/james/cli/probe/impl/JmxServerProbe.java
(original)
+++ james/server/trunk/cli/src/main/java/org/apache/james/cli/probe/impl/JmxServerProbe.java
Thu Jun 14 08:47:04 2012
@@ -134,6 +134,13 @@ public class JmxServerProbe implements S
     }
 
     /**
+     * @see org.apache.james.cli.probe.ServerProbe#containsDomain(java.lang.String)
+     */
+    public boolean containsDomain(String domain) throws Exception {
+        return domainListProcxy.containsDomain(domain);
+    }
+
+    /**
      * @see org.apache.james.cli.probe.ServerProbe#addDomain(java.lang.String)
      */
     public void addDomain(String domain) throws Exception {

Modified: james/server/trunk/cli/src/main/java/org/apache/james/cli/type/CmdType.java
URL: http://svn.apache.org/viewvc/james/server/trunk/cli/src/main/java/org/apache/james/cli/type/CmdType.java?rev=1350127&r1=1350126&r2=1350127&view=diff
==============================================================================
--- james/server/trunk/cli/src/main/java/org/apache/james/cli/type/CmdType.java (original)
+++ james/server/trunk/cli/src/main/java/org/apache/james/cli/type/CmdType.java Thu Jun 14
08:47:04 2012
@@ -27,6 +27,7 @@ public enum CmdType {
     LISTUSERS("listusers", 1), 
     ADDDOMAIN("adddomain", 2), 
     REMOVEDOMAIN("removedomain", 2), 
+    CONTAINSDOMAIN("containsdomain", 2), 
     LISTDOMAINS("listdomains", 1),
     LISTMAPPINGS("listmappings", 1),
     LISTUSERDOMAINMAPPINGS("listuserdomainmappings", 3),



---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message