james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nor...@apache.org
Subject svn commit: r952113 - in /james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/mail: JCRMailboxMapper.java JCRMessageMapper.java model/JCRMailbox.java model/JCRMessage.java
Date Mon, 07 Jun 2010 06:28:58 GMT
Author: norman
Date: Mon Jun  7 06:28:58 2010
New Revision: 952113

URL: http://svn.apache.org/viewvc?rev=952113&view=rev
Log:
Remove all deprecated stuff except of XPATH. Part of IMAP-119

Modified:
    james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/mail/JCRMailboxMapper.java
    james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/mail/JCRMessageMapper.java
    james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/mail/model/JCRMailbox.java
    james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/mail/model/JCRMessage.java

Modified: james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/mail/JCRMailboxMapper.java
URL: http://svn.apache.org/viewvc/james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/mail/JCRMailboxMapper.java?rev=952113&r1=952112&r2=952113&view=diff
==============================================================================
--- james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/mail/JCRMailboxMapper.java
(original)
+++ james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/mail/JCRMailboxMapper.java
Mon Jun  7 06:28:58 2010
@@ -98,7 +98,7 @@ public class JCRMailboxMapper extends Ab
      */
     public void delete(Mailbox<String> mailbox) throws StorageException {
         try {
-            Node node = getSession().getNodeByUUID(((JCRMailbox) mailbox).getMailboxId());
+            Node node = getSession().getNodeByIdentifier(((JCRMailbox) mailbox).getMailboxId());
                    
             node.remove();
             
@@ -156,7 +156,7 @@ public class JCRMailboxMapper extends Ab
      */
     public Mailbox<String> findMailboxById(String mailboxId) throws StorageException,
MailboxNotFoundException {
         try {
-            return new JCRMailbox(getSession().getNodeByUUID(mailboxId), getLogger());
+            return new JCRMailbox(getSession().getNodeByIdentifier(mailboxId), getLogger());
         } catch (PathNotFoundException e) {
             throw new MailboxNotFoundException(mailboxId);
         } catch (RepositoryException e) {
@@ -227,7 +227,7 @@ public class JCRMailboxMapper extends Ab
             Node node = null;
 
             if (jcrMailbox.isPersistent()) {
-                node = getSession().getNodeByUUID(jcrMailbox.getMailboxId());
+                node = getSession().getNodeByIdentifier(jcrMailbox.getMailboxId());
             }
             if (node == null) {
                 Node rootNode = getSession().getRootNode();

Modified: james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/mail/JCRMessageMapper.java
URL: http://svn.apache.org/viewvc/james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/mail/JCRMessageMapper.java?rev=952113&r1=952112&r2=952113&view=diff
==============================================================================
--- james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/mail/JCRMessageMapper.java
(original)
+++ james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/mail/JCRMessageMapper.java
Mon Jun  7 06:28:58 2010
@@ -130,7 +130,7 @@ public class JCRMessageMapper extends Ab
         if (membership.isPersistent()) {
             try {
 
-                getSession().getNodeByUUID(membership.getId()).remove();
+                getSession().getNodeByIdentifier(membership.getId()).remove();
             } catch (RepositoryException e) {
                 e.printStackTrace();
                 throw new StorageException(HumanReadableText.DELETED_FAILED, e);
@@ -389,7 +389,7 @@ public class JCRMessageMapper extends Ab
             Node messageNode = null;
             
             if (membership.isPersistent()) {
-                messageNode = getSession().getNodeByUUID(membership.getId());
+                messageNode = getSession().getNodeByIdentifier(membership.getId());
             }
 
             if (messageNode == null) {
@@ -406,7 +406,7 @@ public class JCRMessageMapper extends Ab
                 final String day = String.valueOf(cal.get(Calendar.DAY_OF_MONTH));
                
                 Node dayNode = null;
-                Node mailboxNode = getSession().getNodeByUUID(uuid);
+                Node mailboxNode = getSession().getNodeByIdentifier(uuid);
                 String dayNodePath = year + NODE_DELIMITER + month + NODE_DELIMITER + day;
                 boolean found = mailboxNode.hasNode(dayNodePath);
                 

Modified: james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/mail/model/JCRMailbox.java
URL: http://svn.apache.org/viewvc/james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/mail/model/JCRMailbox.java?rev=952113&r1=952112&r2=952113&view=diff
==============================================================================
--- james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/mail/model/JCRMailbox.java
(original)
+++ james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/mail/model/JCRMailbox.java
Mon Jun  7 06:28:58 2010
@@ -223,7 +223,7 @@ public class JCRMailbox implements Mailb
     public String getMailboxId() {
         if (isPersistent()) {
             try {
-                return node.getUUID();
+                return node.getIdentifier();
             } catch (RepositoryException e) {
                 logger.error("Unable to access property " + JcrConstants.JCR_UUID, e);
             }

Modified: james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/mail/model/JCRMessage.java
URL: http://svn.apache.org/viewvc/james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/mail/model/JCRMessage.java?rev=952113&r1=952112&r2=952113&view=diff
==============================================================================
--- james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/mail/model/JCRMessage.java
(original)
+++ james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/mail/model/JCRMessage.java
Mon Jun  7 06:28:58 2010
@@ -26,6 +26,7 @@ import java.util.Calendar;
 import java.util.Date;
 import java.util.List;
 
+import javax.jcr.Binary;
 import javax.jcr.Node;
 import javax.jcr.NodeIterator;
 import javax.jcr.RepositoryException;
@@ -299,13 +300,14 @@ public class JCRMessage extends Abstract
     public String getUUID() {
         if (isPersistent()) {
             try {
-                return node.getUUID();
+                return node.getIdentifier();
             } catch (RepositoryException e) {
                 logger.error("Unable to access UUID", e);
             }
         }
         return null;
     }
+    
     /*
      * (non-Javadoc)
      * @see org.apache.james.imap.jcr.Persistent#merge(javax.jcr.Node)
@@ -333,8 +335,8 @@ public class JCRMessage extends Abstract
 
               
         Node contentNode = JcrUtils.getOrAddNode(node, JcrConstants.JCR_CONTENT, JcrConstants.NT_RESOURCE);
-       
-        contentNode.setProperty(JcrConstants.JCR_DATA, getFullContent());
+        Binary binaryContent = contentNode.getSession().getValueFactory().createBinary(getFullContent());
+        contentNode.setProperty(JcrConstants.JCR_DATA, binaryContent);
         contentNode.setProperty(JcrConstants.JCR_MIMETYPE, getMediaType());
 
         if (getTextualLineCount() != null) {
@@ -438,7 +440,7 @@ public class JCRMessage extends Abstract
         if (isPersistent()) {
             try {
                 //TODO: Maybe we should cache this somehow...
-                InputStream contentStream = node.getNode(JcrConstants.JCR_CONTENT).getProperty(JcrConstants.JCR_DATA).getStream();
+                InputStream contentStream = node.getNode(JcrConstants.JCR_CONTENT).getProperty(JcrConstants.JCR_DATA).getBinary().getStream();
                 return contentStream;
             } catch (RepositoryException e) {
                 logger.error("Unable to retrieve property " + JcrConstants.JCR_CONTENT, e);
@@ -751,7 +753,7 @@ public class JCRMessage extends Abstract
     public String getId() {
         if (isPersistent()) {
             try {
-                return node.getUUID();
+                return node.getIdentifier();
             } catch (RepositoryException e) {
                 logger.error("Unable to access property " + JcrConstants.JCR_UUID, e);
             }



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