You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by no...@apache.org on 2006/10/19 19:46:19 UTC

svn commit: r465693 - in /james/server/trunk/src/java/org/apache/james: James.java vut/JDBCVirtualUserTable.java

Author: norman
Date: Thu Oct 19 10:46:18 2006
New Revision: 465693

URL: http://svn.apache.org/viewvc?view=rev&rev=465693
Log:
Use containsDomain method of DomainList to allow some implementations to "reload" it. See JAMES-426

Modified:
    james/server/trunk/src/java/org/apache/james/James.java
    james/server/trunk/src/java/org/apache/james/vut/JDBCVirtualUserTable.java

Modified: james/server/trunk/src/java/org/apache/james/James.java
URL: http://svn.apache.org/viewvc/james/server/trunk/src/java/org/apache/james/James.java?view=diff&rev=465693&r1=465692&r2=465693
==============================================================================
--- james/server/trunk/src/java/org/apache/james/James.java (original)
+++ james/server/trunk/src/java/org/apache/james/James.java Thu Oct 19 10:46:18 2006
@@ -726,7 +726,14 @@
      */
     public boolean isLocalServer( final String serverName ) {
         String lowercase = serverName.toLowerCase(Locale.US);
-        return "localhost".equals(serverName) || serverNames.contains(lowercase);
+       
+        // Check if the serverName is localhost or the DomainList implementation contains the serverName. This
+        // allow some implementations to act more dynamic
+        if ("localhost".equals(serverName) || domains.containsDomain(lowercase)){
+            return  true;
+        } else {
+            return false;
+        }
     }
 
     /**

Modified: james/server/trunk/src/java/org/apache/james/vut/JDBCVirtualUserTable.java
URL: http://svn.apache.org/viewvc/james/server/trunk/src/java/org/apache/james/vut/JDBCVirtualUserTable.java?view=diff&rev=465693&r1=465692&r2=465693
==============================================================================
--- james/server/trunk/src/java/org/apache/james/vut/JDBCVirtualUserTable.java (original)
+++ james/server/trunk/src/java/org/apache/james/vut/JDBCVirtualUserTable.java Thu Oct 19 10:46:18 2006
@@ -199,23 +199,10 @@
             // Try UPPER, lower, and MixedCase, to see if the table is there.
            
             if (!(theJDBCUtil.tableExists(dbMetaData, tableName))) {
-           
-                // Users table doesn't exist - create it.
-                createStatement =
-                    conn.prepareStatement(sqlQueries.getSqlString("createTable", true));
-                createStatement.execute();
-
-                if (getLogger().isInfoEnabled()) {
-                    logBuffer =
-                        new StringBuffer(64)
-                                .append("JdbcVirtalUserTable: Created table '")
-                                .append(tableName)
-                                .append("'.");
-                    getLogger().info(logBuffer.toString());
-                }
+            // Costum table not exists. Throw exception
+            throw new Exception("Table " + tableName + " not exists");
             }
-
-          
+   
         } finally {
             theJDBCUtil.closeJDBCStatement(createStatement);
             theJDBCUtil.closeJDBCConnection(conn);



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