[jboss-svn-commits] JBL Code SVN: r17221 - labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/services/jbossesb/src/main/java/org/jboss/internal/soa/esb/persistence/format/db.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Thu Dec 13 07:27:47 EST 2007


Author: mark.little at jboss.com
Date: 2007-12-13 07:27:47 -0500 (Thu, 13 Dec 2007)
New Revision: 17221

Modified:
   labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/services/jbossesb/src/main/java/org/jboss/internal/soa/esb/persistence/format/db/DBMessageStoreImpl.java
Log:
http://jira.jboss.com/jira/browse/JBESB-1405

Modified: labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/services/jbossesb/src/main/java/org/jboss/internal/soa/esb/persistence/format/db/DBMessageStoreImpl.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/services/jbossesb/src/main/java/org/jboss/internal/soa/esb/persistence/format/db/DBMessageStoreImpl.java	2007-12-13 12:17:21 UTC (rev 17220)
+++ labs/jbossesb/branches/JBESB_4_2_1_GA_CP/product/services/jbossesb/src/main/java/org/jboss/internal/soa/esb/persistence/format/db/DBMessageStoreImpl.java	2007-12-13 12:27:47 UTC (rev 17221)
@@ -52,6 +52,7 @@
 public class DBMessageStoreImpl implements RedeliverStore
 {
     public static final String DEFAULT_TABLE_NAME = "message";
+    public static final String UNCLASSIFIED_CLASSIFICATION = "UNCLASSIFIED";
     
 	private Logger logger = Logger.getLogger(this.getClass());
 
@@ -79,6 +80,7 @@
 	/**
 	 * add's a @Message to the database persistence store
 	 * will set the 'delivered' flag to TRUE by default - assuming that the @Message has been delivered
+	 * If classification is null or "", then UNCLASSIFIED will be used.
 	 */
 	public synchronized URI addMessage (Message message, String classification) throws MessageStoreException
 	{
@@ -87,6 +89,10 @@
 		try{
 			conn = mgr.getConnection();
 			uid = uriGenerator.generateMessageURI(message);
+			
+			if ((classification == null) || (classification.equals("")))
+				classification = UNCLASSIFIED_CLASSIFICATION;
+			
             insert(uid, message, classification, "TRUE", conn);
 		}
 		catch (Exception e)
@@ -144,6 +150,7 @@
     /**
      * remove a @Message based on the passed in key in the form of a JBoss ESB @URI
      * format for URI: "urn:jboss/esb/message/UID#" + UUID.randomUUID()" - see the method in this class @removeMessage
+     * If classification is null or "", then UNCLASSIFIED will be used.
      */
     public synchronized int removeMessage (URI uid, String classification)
             throws MessageStoreException
@@ -152,6 +159,10 @@
         Connection conn=null;
         try {
             conn = mgr.getConnection();
+            
+            if ((classification == null) || (classification.equals("")))
+            	classification = UNCLASSIFIED_CLASSIFICATION;
+            
             response =  delete(uid, classification, conn);
         } catch (Exception e) {
             throw new MessageStoreException(e);




More information about the jboss-svn-commits mailing list