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 2010/11/03 18:47:37 UTC
svn commit: r1030563 - in /james/server/trunk:
queue-api/src/main/java/org/apache/james/queue/api/MailPrioritySupport.java
queue-jms/src/main/java/org/apache/james/queue/jms/JMSMailQueue.java
Author: norman
Date: Wed Nov 3 17:47:37 2010
New Revision: 1030563
URL: http://svn.apache.org/viewvc?rev=1030563&view=rev
Log:
Move MailPriority stuff in an extra interface which sits in the queue-api module. If a queue supports Mail Priorities it should implement it
Added:
james/server/trunk/queue-api/src/main/java/org/apache/james/queue/api/MailPrioritySupport.java
Modified:
james/server/trunk/queue-jms/src/main/java/org/apache/james/queue/jms/JMSMailQueue.java
Added: james/server/trunk/queue-api/src/main/java/org/apache/james/queue/api/MailPrioritySupport.java
URL: http://svn.apache.org/viewvc/james/server/trunk/queue-api/src/main/java/org/apache/james/queue/api/MailPrioritySupport.java?rev=1030563&view=auto
==============================================================================
--- james/server/trunk/queue-api/src/main/java/org/apache/james/queue/api/MailPrioritySupport.java (added)
+++ james/server/trunk/queue-api/src/main/java/org/apache/james/queue/api/MailPrioritySupport.java Wed Nov 3 17:47:37 2010
@@ -0,0 +1,51 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one *
+ * or more contributor license agreements. See the NOTICE file *
+ * distributed with this work for additional information *
+ * regarding copyright ownership. The ASF licenses this file *
+ * to you under the Apache License, Version 2.0 (the *
+ * "License"); you may not use this file except in compliance *
+ * with the License. You may obtain a copy of the License at *
+ * *
+ * http://www.apache.org/licenses/LICENSE-2.0 *
+ * *
+ * Unless required by applicable law or agreed to in writing, *
+ * software distributed under the License is distributed on an *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY *
+ * KIND, either express or implied. See the License for the *
+ * specific language governing permissions and limitations *
+ * under the License. *
+ ****************************************************************/
+package org.apache.james.queue.api;
+
+/**
+ * Supports Mail Priority handling
+ *
+ */
+public interface MailPrioritySupport {
+
+
+ /**
+ * Handle mail with lowest priority
+ */
+ public final static int LOW_PRIORITY = 0;
+
+ /**
+ * Handle mail with normal priority (this is the default)
+ */
+ public final static int NORMAL_PRIORITY = 5;
+
+ /**
+ * Handle mail with highest priority
+ */
+ public final static int HIGH_PRIORITY = 9;
+
+ /**
+ * Attribute name for support if priority. If the attribute is set and
+ * priority handling is enabled it will take care of move the Mails with
+ * higher priority to the head of the queue (so the mails are faster
+ * handled).
+ *
+ */
+ public final static String MAIL_PRIORITY = "MAIL_PRIORITY";
+}
Modified: james/server/trunk/queue-jms/src/main/java/org/apache/james/queue/jms/JMSMailQueue.java
URL: http://svn.apache.org/viewvc/james/server/trunk/queue-jms/src/main/java/org/apache/james/queue/jms/JMSMailQueue.java?rev=1030563&r1=1030562&r2=1030563&view=diff
==============================================================================
--- james/server/trunk/queue-jms/src/main/java/org/apache/james/queue/jms/JMSMailQueue.java (original)
+++ james/server/trunk/queue-jms/src/main/java/org/apache/james/queue/jms/JMSMailQueue.java Wed Nov 3 17:47:37 2010
@@ -46,6 +46,7 @@ import org.apache.commons.logging.Log;
import org.apache.james.core.MailImpl;
import org.apache.james.core.MimeMessageCopyOnWriteProxy;
import org.apache.james.core.MimeMessageInputStreamSource;
+import org.apache.james.queue.api.MailPrioritySupport;
import org.apache.james.queue.api.MailQueue;
import org.apache.mailet.Mail;
import org.apache.mailet.MailAddress;
@@ -57,35 +58,12 @@ import org.apache.mailet.MailAddress;
*
*
*/
-public class JMSMailQueue implements MailQueue, JMSSupport {
+public class JMSMailQueue implements MailQueue, JMSSupport, MailPrioritySupport {
protected final String queuename;
protected final ConnectionFactory connectionFactory;
protected final Log logger;
- /**
- * Handle mail with lowest priority
- */
- public final static int LOW_PRIORITY = 0;
-
- /**
- * Handle mail with normal priority (this is the default)
- */
- public final static int NORMAL_PRIORITY = Message.DEFAULT_DELIVERY_MODE;
-
- /**
- * Handle mail with highest priority
- */
- public final static int HIGH_PRIORITY = 9;
-
- /**
- * Attribute name for support if priority. If the attribute is set and
- * priority handling is enabled it will take care of move the Mails with
- * higher priority to the head of the queue (so the mails are faster
- * handled).
- *
- */
- public final static String MAIL_PRIORITY = "MAIL_PRIORITY";
public JMSMailQueue(final ConnectionFactory connectionFactory, final String queuename, final Log logger) {
this.connectionFactory = connectionFactory;
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org