james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From b...@apache.org
Subject svn commit: r382486 - in /james/server/trunk/src/java/org/apache/james: Constants.java James.java transport/mailets/RemoteDelivery.java userrepository/UsersLDAPRepository.java
Date Thu, 02 Mar 2006 19:49:29 GMT
Author: bago
Date: Thu Mar  2 11:49:27 2006
New Revision: 382486

URL: http://svn.apache.org/viewcvs?rev=382486&view=rev
Log:
Removed the only 2 references to the servernames map introducing a DEFAULT_DOMAIN that take
the first servername as its value (road to JAMES-426)

Modified:
    james/server/trunk/src/java/org/apache/james/Constants.java
    james/server/trunk/src/java/org/apache/james/James.java
    james/server/trunk/src/java/org/apache/james/transport/mailets/RemoteDelivery.java
    james/server/trunk/src/java/org/apache/james/userrepository/UsersLDAPRepository.java

Modified: james/server/trunk/src/java/org/apache/james/Constants.java
URL: http://svn.apache.org/viewcvs/james/server/trunk/src/java/org/apache/james/Constants.java?rev=382486&r1=382485&r2=382486&view=diff
==============================================================================
--- james/server/trunk/src/java/org/apache/james/Constants.java (original)
+++ james/server/trunk/src/java/org/apache/james/Constants.java Thu Mar  2 11:49:27 2006
@@ -38,10 +38,10 @@
     public static final String SOFTWARE_NAME = "@@NAME@@";
 
     /**
-     * Context key used to store the list of mail domains being
+     * Context key used to store the default domain name
      * serviced by this James instance in the context.
      */
-    public static final String SERVER_NAMES = "SERVER_NAMES";
+    public static final String DEFAULT_DOMAIN = "DEFAULT_DOMAIN";
 
     /**
      * Context key used to store the Mailet/SMTP "hello name" for this

Modified: james/server/trunk/src/java/org/apache/james/James.java
URL: http://svn.apache.org/viewcvs/james/server/trunk/src/java/org/apache/james/James.java?rev=382486&r1=382485&r2=382486&view=diff
==============================================================================
--- james/server/trunk/src/java/org/apache/james/James.java (original)
+++ james/server/trunk/src/java/org/apache/james/James.java Thu Mar  2 11:49:27 2006
@@ -299,9 +299,10 @@
                 getLogger().info("Handling mail for: " + i.next());
             }
         }
-        context.put(Constants.SERVER_NAMES, this.serverNames);
-        attributes.put(Constants.SERVER_NAMES, this.serverNames);
-
+        
+        String defaultDomain = (String) serverNames.iterator().next();
+        context.put(Constants.DEFAULT_DOMAIN, defaultDomain);
+        attributes.put(Constants.DEFAULT_DOMAIN, defaultDomain);
 
         // Get postmaster
         String postMasterAddress = conf.getChild("postmaster").getValue("postmaster").toLowerCase(Locale.US);

Modified: james/server/trunk/src/java/org/apache/james/transport/mailets/RemoteDelivery.java
URL: http://svn.apache.org/viewcvs/james/server/trunk/src/java/org/apache/james/transport/mailets/RemoteDelivery.java?rev=382486&r1=382485&r2=382486&view=diff
==============================================================================
--- james/server/trunk/src/java/org/apache/james/transport/mailets/RemoteDelivery.java (original)
+++ james/server/trunk/src/java/org/apache/james/transport/mailets/RemoteDelivery.java Thu
Mar  2 11:49:27 2006
@@ -1061,9 +1061,9 @@
             props.put("mail.smtp.localhost", getMailetContext().getAttribute(Constants.HELLO_NAME));
         }
         else {
-            Collection servernames = (Collection) getMailetContext().getAttribute(Constants.SERVER_NAMES);
-            if ((servernames != null) && (servernames.size() > 0)) {
-                props.put("mail.smtp.localhost", servernames.iterator().next());
+            String defaultDomain = (String) getMailetContext().getAttribute(Constants.DEFAULT_DOMAIN);
+            if (defaultDomain != null) {
+                props.put("mail.smtp.localhost", defaultDomain);
             }
         }
 

Modified: james/server/trunk/src/java/org/apache/james/userrepository/UsersLDAPRepository.java
URL: http://svn.apache.org/viewcvs/james/server/trunk/src/java/org/apache/james/userrepository/UsersLDAPRepository.java?rev=382486&r1=382485&r2=382486&view=diff
==============================================================================
--- james/server/trunk/src/java/org/apache/james/userrepository/UsersLDAPRepository.java (original)
+++ james/server/trunk/src/java/org/apache/james/userrepository/UsersLDAPRepository.java Thu
Mar  2 11:49:27 2006
@@ -45,7 +45,6 @@
 import javax.naming.directory.SearchResult;
 
 import java.util.ArrayList;
-import java.util.Collection;
 import java.util.Hashtable;
 import java.util.Iterator;
 import java.util.List;
@@ -86,9 +85,7 @@
      */
     public void contextualize(Context context)
         throws ContextException {
-        Collection serverNames
-            = (Collection)context.get(Constants.SERVER_NAMES);
-        usersDomain = (String)serverNames.iterator().next();
+        usersDomain = (String)context.get(Constants.DEFAULT_DOMAIN);
     }
 
     /**



---------------------------------------------------------------------
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