james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From btell...@apache.org
Subject svn commit: r1685962 - /james/mailbox/trunk/cassandra/src/main/java/org/apache/james/mailbox/cassandra/mail/CassandraMessageMapper.java
Date Wed, 17 Jun 2015 09:09:25 GMT
Author: btellier
Date: Wed Jun 17 09:09:25 2015
New Revision: 1685962

URL: http://svn.apache.org/r1685962
Log:
MAILBOX-233 re indent instert query - Contributed by Antoine Duprat

Modified:
    james/mailbox/trunk/cassandra/src/main/java/org/apache/james/mailbox/cassandra/mail/CassandraMessageMapper.java

Modified: james/mailbox/trunk/cassandra/src/main/java/org/apache/james/mailbox/cassandra/mail/CassandraMessageMapper.java
URL: http://svn.apache.org/viewvc/james/mailbox/trunk/cassandra/src/main/java/org/apache/james/mailbox/cassandra/mail/CassandraMessageMapper.java?rev=1685962&r1=1685961&r2=1685962&view=diff
==============================================================================
--- james/mailbox/trunk/cassandra/src/main/java/org/apache/james/mailbox/cassandra/mail/CassandraMessageMapper.java
(original)
+++ james/mailbox/trunk/cassandra/src/main/java/org/apache/james/mailbox/cassandra/mail/CassandraMessageMapper.java
Wed Jun 17 09:09:25 2015
@@ -321,11 +321,30 @@ public class CassandraMessageMapper impl
 
     private MessageMetaData save(Mailbox<UUID> mailbox, Message<UUID> message)
throws MailboxException {
         try {
-            Insert query = insertInto(TABLE_NAME).value(MAILBOX_ID, mailbox.getMailboxId()).value(IMAP_UID,
message.getUid()).value(MOD_SEQ, message.getModSeq()).value(INTERNAL_DATE, message.getInternalDate()).value(MEDIA_TYPE,
message.getMediaType())
-                    .value(BODY_START_OCTET, message.getFullContentOctets() - message.getBodyOctets()).value(SUB_TYPE,
message.getSubType()).value(FULL_CONTENT_OCTETS, message.getFullContentOctets()).value(BODY_OCTECTS,
message.getBodyOctets()).value(ANSWERED, message.isAnswered())
-                    .value(DELETED, message.isDeleted()).value(DRAFT, message.isDraft()).value(FLAGGED,
message.isFlagged()).value(RECENT, message.isRecent()).value(SEEN, message.isSeen()).value(USER,
message.createFlags().contains(Flag.USER)).value(BODY_CONTENT, bindMarker())
-                    .value(HEADER_CONTENT, bindMarker()).value(TEXTUAL_LINE_COUNT, message.getTextualLineCount()).value(FLAG_VERSION,
0);
+            Insert query = insertInto(TABLE_NAME)
+                    .value(MAILBOX_ID, mailbox.getMailboxId())
+                    .value(IMAP_UID, message.getUid())
+                    .value(MOD_SEQ, message.getModSeq())
+                    .value(INTERNAL_DATE, message.getInternalDate())
+                    .value(MEDIA_TYPE, message.getMediaType())
+                    .value(BODY_START_OCTET, message.getFullContentOctets() - message.getBodyOctets())
+                    .value(SUB_TYPE, message.getSubType())
+                    .value(FULL_CONTENT_OCTETS, message.getFullContentOctets())
+                    .value(BODY_OCTECTS, message.getBodyOctets())
+                    .value(ANSWERED, message.isAnswered())
+                    .value(DELETED, message.isDeleted())
+                    .value(DRAFT, message.isDraft())
+                    .value(FLAGGED, message.isFlagged())
+                    .value(RECENT, message.isRecent())
+                    .value(SEEN, message.isSeen())
+                    .value(USER, message.createFlags().contains(Flag.USER))
+                    .value(BODY_CONTENT, bindMarker())
+                    .value(HEADER_CONTENT, bindMarker())
+                    .value(TEXTUAL_LINE_COUNT, message.getTextualLineCount())
+                    .value(FLAG_VERSION, 0);
             PreparedStatement preparedStatement = session.prepare(query.toString());
+            
+            
             BoundStatement boundStatement = preparedStatement.bind(toByteBuffer(message.getBodyContent()),
toByteBuffer(message.getHeaderContent()));
             session.execute(boundStatement);
             return new SimpleMessageMetaData(message);



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