james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nor...@apache.org
Subject svn commit: r1050610 - in /james/server/trunk: container-spring/src/main/config/examples/ container-spring/src/main/config/james/ container-spring/src/main/java/org/apache/james/container/spring/ mail-api/src/main/java/org/apache/james/mailrepository/a...
Date Sat, 18 Dec 2010 10:39:01 GMT
Author: norman
Date: Sat Dec 18 10:39:01 2010
New Revision: 1050610

URL: http://svn.apache.org/viewvc?rev=1050610&view=rev
Log:
add javadocs and some config changes for MailRepositoryStore to make it more in line with
the others

Modified:
    james/server/trunk/container-spring/src/main/config/examples/mailrepositorystore.xml
    james/server/trunk/container-spring/src/main/config/james/mailrepositorystore.xml
    james/server/trunk/container-spring/src/main/java/org/apache/james/container/spring/BeanFactoryMailRepositoryStore.java
    james/server/trunk/mail-api/src/main/java/org/apache/james/mailrepository/api/MailRepositoryStore.java
    james/server/trunk/mail-library/src/test/java/org/apache/james/mailrepository/mock/MockMailRepositoryStore.java

Modified: james/server/trunk/container-spring/src/main/config/examples/mailrepositorystore.xml
URL: http://svn.apache.org/viewvc/james/server/trunk/container-spring/src/main/config/examples/mailrepositorystore.xml?rev=1050610&r1=1050609&r2=1050610&view=diff
==============================================================================
--- james/server/trunk/container-spring/src/main/config/examples/mailrepositorystore.xml (original)
+++ james/server/trunk/container-spring/src/main/config/examples/mailrepositorystore.xml Sat
Dec 18 10:39:01 2010
@@ -19,20 +19,20 @@
  -->
 <!-- The Mailstore block -->
 <<mailrepositorystore>
-    <repositories>
+    <mailrepositories>
         <!-- File based repositories.  These repositories store all message data -->
         <!-- in the file system. -->
-        <repository class="org.apache.james.mailrepository.file.FileMailRepository">
+        <mailrepository class="org.apache.james.mailrepository.file.FileMailRepository">
             <protocols>
                 <protocol>file</protocol>
             </protocols>
             <!-- Set if the messages should be listed sorted. False by default -->
           <config FIFO="false" CACHEKEYS="true"/> 
-        </repository>
+        </mailrepository>
 
         <!-- JDBC based repositories.  These repositories store all message data -->
         <!-- in the database. -->
-        <repository class="org.apache.james.mailrepository.jdbc.JDBCMailRepository">
+        <mailrepository class="org.apache.james.mailrepository.jdbc.JDBCMailRepository">
             <protocols>
                 <protocol>db</protocol>
             </protocols>
@@ -46,10 +46,10 @@
                 <inMemorySizeLimit>4096</inMemorySizeLimit>
                 -->
             </config>
-        </repository>
+        </mailrepository>
 
         <!-- These repositories store message delivery and headers in the DB, and the
body to the filesystem -->
-        <repository class="org.apache.james.mailrepository.jdbc.JDBCMailRepository">
+        <mailrepository class="org.apache.james.mailrepository.jdbc.JDBCMailRepository">
             <protocols>
                 <protocol>dbfile</protocol>
             </protocols>
@@ -57,21 +57,21 @@
                 <sqlFile>file://conf/sqlResources.xml</sqlFile>
                 <filestore>file://var/dbmail</filestore>
             </config>
-        </repository>
+        </mailrepository>
  
         <!-- The mbox repository is designed for MAIL only; SPOOL performance would be
less than ideal-->
-        <repository class="org.apache.james.mailrepository.file.MBoxMailRepository">
+        <mailrepository class="org.apache.james.mailrepository.file.MBoxMailRepository">
             <protocols>
                 <protocol>mbox</protocol>
             </protocols>
             <!-- Set if the messages should be listed sorted. False by default -->
             <config FIFO="false"/> 
-        </repository>
+        </mailrepository>
         
         
         <!-- If you enable this you need to make sure that embedded Jackrabbit instance
is started as well. Check the container configuration -->  
         <!--
-        <repository class="org.apache.james.mailrepository.jcr.JCRMailRepository">
+        <mailrepository class="org.apache.james.mailrepository.jcr.JCRMailRepository">
             <protocols>
                 <protocol>jcr</protocol>
             </protocols>
@@ -81,7 +81,7 @@
                 <password>admin</password>
                 <workspace>default</workspace>
             </config>
-        </repository>
+        </mailrepository>
         -->
-    </repositories>
+    </mailrepositories>
 </mailrepositorystore>
\ No newline at end of file

Modified: james/server/trunk/container-spring/src/main/config/james/mailrepositorystore.xml
URL: http://svn.apache.org/viewvc/james/server/trunk/container-spring/src/main/config/james/mailrepositorystore.xml?rev=1050610&r1=1050609&r2=1050610&view=diff
==============================================================================
--- james/server/trunk/container-spring/src/main/config/james/mailrepositorystore.xml (original)
+++ james/server/trunk/container-spring/src/main/config/james/mailrepositorystore.xml Sat
Dec 18 10:39:01 2010
@@ -21,23 +21,23 @@
 <!-- See http://james.apache.org/server/3/config.html for usage -->
 
 <mailrepositorystore>
-  <repositories>
-      <repository class="org.apache.james.mailrepository.file.FileMailRepository">
+  <mailrepositories>
+      <mailrepository class="org.apache.james.mailrepository.file.FileMailRepository">
           <config FIFO="false" CACHEKEYS="true"/> 
           <protocols>
               <protocol>file</protocol>
           </protocols>
-      </repository>
+      </mailrepository>
       
-      <repository class="org.apache.james.mailrepository.jdbc.JDBCMailRepository">
+      <mailrepository class="org.apache.james.mailrepository.jdbc.JDBCMailRepository">
           <protocols>
               <protocol>db</protocol>
           </protocols>
           <config>
               <sqlFile>file://conf/sqlResources.xml</sqlFile>
           </config>
-      </repository>
-      <repository class="org.apache.james.mailrepository.jdbc.JDBCMailRepository">
+      </mailrepository>
+      <mailrepository class="org.apache.james.mailrepository.jdbc.JDBCMailRepository">
           <protocols>
               <protocol>dbfile</protocol>
           </protocols>
@@ -45,12 +45,12 @@
               <sqlFile>file://conf/sqlResources.xml</sqlFile>
               <filestore>file://var/dbmail</filestore>
           </config>
-      </repository>
-      <repository class="org.apache.james.mailrepository.file.MBoxMailRepository">
+      </mailrepository>
+      <mailrepository class="org.apache.james.mailrepository.file.MBoxMailRepository">
           <protocols>
               <protocol>mbox</protocol>
           </protocols>
           <config FIFO="false"/> 
-      </repository>
-  </repositories>
+      </mailrepository>
+  </mailrepositories>
 </mailrepositorystore>

Modified: james/server/trunk/container-spring/src/main/java/org/apache/james/container/spring/BeanFactoryMailRepositoryStore.java
URL: http://svn.apache.org/viewvc/james/server/trunk/container-spring/src/main/java/org/apache/james/container/spring/BeanFactoryMailRepositoryStore.java?rev=1050610&r1=1050609&r2=1050610&view=diff
==============================================================================
--- james/server/trunk/container-spring/src/main/java/org/apache/james/container/spring/BeanFactoryMailRepositoryStore.java
(original)
+++ james/server/trunk/container-spring/src/main/java/org/apache/james/container/spring/BeanFactoryMailRepositoryStore.java
Sat Dec 18 10:39:01 2010
@@ -93,7 +93,7 @@ public class BeanFactoryMailRepositorySt
         classes = new HashMap<String,String>();
         defaultConfigs = new HashMap<String, HierarchicalConfiguration>();
         List<HierarchicalConfiguration> registeredClasses
-            = configuration.configurationsAt("repositories.repository");
+            = configuration.configurationsAt("mailrepositories.mailrepository");
         for ( int i = 0; i < registeredClasses.size(); i++ )
         {
             registerRepository(registeredClasses.get(i));
@@ -173,13 +173,13 @@ public class BeanFactoryMailRepositorySt
      *                            Configuration or retrieving the 
      *                            MailRepository
      */
-    public synchronized MailRepository select(String destination) throws StoreException {
+    public synchronized MailRepository select(String destination) throws MailRepostoryStoreException
{
  
         String protocol = null;
 
         int idx = destination.indexOf(':');
         if ( idx == -1 )
-            throw new StoreException("Destination is malformed. Must be a valid URL: "
+            throw new MailRepostoryStoreException("Destination is malformed. Must be a valid
URL: "
                 + destination);
         protocol = destination.substring(0,idx);
         
@@ -258,7 +258,7 @@ public class BeanFactoryMailRepositorySt
                     getLogger().warn( "Exception while creating repository:" +
                                       e.getMessage(), e );
                 }
-                throw new StoreException("Cannot find or init repository", e);
+                throw new MailRepostoryStoreException("Cannot find or init repository", e);
             }
         }
         

Modified: james/server/trunk/mail-api/src/main/java/org/apache/james/mailrepository/api/MailRepositoryStore.java
URL: http://svn.apache.org/viewvc/james/server/trunk/mail-api/src/main/java/org/apache/james/mailrepository/api/MailRepositoryStore.java?rev=1050610&r1=1050609&r2=1050610&view=diff
==============================================================================
--- james/server/trunk/mail-api/src/main/java/org/apache/james/mailrepository/api/MailRepositoryStore.java
(original)
+++ james/server/trunk/mail-api/src/main/java/org/apache/james/mailrepository/api/MailRepositoryStore.java
Sat Dec 18 10:39:01 2010
@@ -24,17 +24,29 @@ import java.util.List;
 
 public interface MailRepositoryStore {
 
-    public MailRepository select(String url) throws StoreException;
+    /**
+     * Select the {@link MailRepository} for the given url
+     * 
+     * @param url
+     * @return repository
+     * @throws MailRepostoryStoreException
+     */
+    public MailRepository select(String url) throws MailRepostoryStoreException;
     
+    /**
+     * Return a {@link List} which contains all urls of the selected {@link MailRepository}'s
+     * 
+     * @return urls
+     */
     public List<String> getUrls();
     
     @SuppressWarnings("serial")
-    public class StoreException extends Exception {
-        public StoreException(String msg, Throwable t) {
+    public class MailRepostoryStoreException extends Exception {
+        public MailRepostoryStoreException(String msg, Throwable t) {
             super(msg, t);
         }
         
-        public StoreException(String msg) {
+        public MailRepostoryStoreException(String msg) {
             super(msg);
         }
     }

Modified: james/server/trunk/mail-library/src/test/java/org/apache/james/mailrepository/mock/MockMailRepositoryStore.java
URL: http://svn.apache.org/viewvc/james/server/trunk/mail-library/src/test/java/org/apache/james/mailrepository/mock/MockMailRepositoryStore.java?rev=1050610&r1=1050609&r2=1050610&view=diff
==============================================================================
--- james/server/trunk/mail-library/src/test/java/org/apache/james/mailrepository/mock/MockMailRepositoryStore.java
(original)
+++ james/server/trunk/mail-library/src/test/java/org/apache/james/mailrepository/mock/MockMailRepositoryStore.java
Sat Dec 18 10:39:01 2010
@@ -37,7 +37,7 @@ public class MockMailRepositoryStore imp
         m_storedObjectMap.put(url, obj);
     }
     
-    public MailRepository select(String url) throws StoreException {
+    public MailRepository select(String url) throws MailRepostoryStoreException {
         MailRepository result = get(url);
         return result;
     }



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