Repository: james-project Updated Branches: refs/heads/master 3aff7a9f6 -> 0e5872cdf
JAMES-2145 Nameing for getRelatedMessagedIds instead of getOwnerMessageIds Project: http://git-wip-us.apache.org/repos/asf/james-project/repo Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/c9ac405c Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/c9ac405c Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/c9ac405c Branch: refs/heads/master Commit: c9ac405c593e0fb610b9a0b288efed8e43ead08c Parents: 3aff7a9 Author: benwa <[email protected]> Authored: Wed Sep 20 15:45:11 2017 +0700 Committer: Antoine Duprat <[email protected]> Committed: Wed Sep 20 16:15:56 2017 +0200 ---------------------------------------------------------------------- .../org/apache/james/mailbox/AttachmentManager.java | 2 +- .../cassandra/mail/CassandraAttachmentMapper.java | 2 +- .../inmemory/mail/InMemoryAttachmentMapper.java | 2 +- .../james/mailbox/store/StoreAttachmentManager.java | 4 ++-- .../james/mailbox/store/mail/AttachmentMapper.java | 2 +- .../store/mail/model/AttachmentMapperTest.java | 16 ++++++++-------- .../org/apache/james/modules/MailboxProbeImpl.java | 4 +++- 7 files changed, 17 insertions(+), 15 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/james-project/blob/c9ac405c/mailbox/api/src/main/java/org/apache/james/mailbox/AttachmentManager.java ---------------------------------------------------------------------- diff --git a/mailbox/api/src/main/java/org/apache/james/mailbox/AttachmentManager.java b/mailbox/api/src/main/java/org/apache/james/mailbox/AttachmentManager.java index a03bb53..fd21b54 100644 --- a/mailbox/api/src/main/java/org/apache/james/mailbox/AttachmentManager.java +++ b/mailbox/api/src/main/java/org/apache/james/mailbox/AttachmentManager.java @@ -38,5 +38,5 @@ public interface AttachmentManager { void storeAttachmentsForMessage(Collection<Attachment> attachments, MessageId ownerMessageId, MailboxSession mailboxSession) throws MailboxException; - Collection<MessageId> getOwnerMessageIds(AttachmentId attachmentId, MailboxSession mailboxSession) throws MailboxException; + Collection<MessageId> getRelatedMessageIds(AttachmentId attachmentId, MailboxSession mailboxSession) throws MailboxException; } http://git-wip-us.apache.org/repos/asf/james-project/blob/c9ac405c/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/mail/CassandraAttachmentMapper.java ---------------------------------------------------------------------- diff --git a/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/mail/CassandraAttachmentMapper.java b/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/mail/CassandraAttachmentMapper.java index 37edb52..1269135 100644 --- a/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/mail/CassandraAttachmentMapper.java +++ b/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/mail/CassandraAttachmentMapper.java @@ -136,7 +136,7 @@ public class CassandraAttachmentMapper implements AttachmentMapper { } @Override - public Collection<MessageId> getOwnerMessageIds(AttachmentId attachmentId) throws MailboxException { + public Collection<MessageId> getRelatedMessageIds(AttachmentId attachmentId) throws MailboxException { return attachmentMessageIdDAO.getOwnerMessageIds(attachmentId) .join(); } http://git-wip-us.apache.org/repos/asf/james-project/blob/c9ac405c/mailbox/memory/src/main/java/org/apache/james/mailbox/inmemory/mail/InMemoryAttachmentMapper.java ---------------------------------------------------------------------- diff --git a/mailbox/memory/src/main/java/org/apache/james/mailbox/inmemory/mail/InMemoryAttachmentMapper.java b/mailbox/memory/src/main/java/org/apache/james/mailbox/inmemory/mail/InMemoryAttachmentMapper.java index 314226b..cca1167 100644 --- a/mailbox/memory/src/main/java/org/apache/james/mailbox/inmemory/mail/InMemoryAttachmentMapper.java +++ b/mailbox/memory/src/main/java/org/apache/james/mailbox/inmemory/mail/InMemoryAttachmentMapper.java @@ -93,7 +93,7 @@ public class InMemoryAttachmentMapper implements AttachmentMapper { } @Override - public Collection<MessageId> getOwnerMessageIds(AttachmentId attachmentId) throws MailboxException { + public Collection<MessageId> getRelatedMessageIds(AttachmentId attachmentId) throws MailboxException { return messageIdsByAttachmentId.get(attachmentId); } } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/james-project/blob/c9ac405c/mailbox/store/src/main/java/org/apache/james/mailbox/store/StoreAttachmentManager.java ---------------------------------------------------------------------- diff --git a/mailbox/store/src/main/java/org/apache/james/mailbox/store/StoreAttachmentManager.java b/mailbox/store/src/main/java/org/apache/james/mailbox/store/StoreAttachmentManager.java index 0d2b8a6..1ee0c90 100644 --- a/mailbox/store/src/main/java/org/apache/james/mailbox/store/StoreAttachmentManager.java +++ b/mailbox/store/src/main/java/org/apache/james/mailbox/store/StoreAttachmentManager.java @@ -72,7 +72,7 @@ public class StoreAttachmentManager implements AttachmentManager { } @Override - public Collection<MessageId> getOwnerMessageIds(AttachmentId attachmentId, MailboxSession mailboxSession) throws MailboxException { - return getAttachmentMapper(mailboxSession).getOwnerMessageIds(attachmentId); + public Collection<MessageId> getRelatedMessageIds(AttachmentId attachmentId, MailboxSession mailboxSession) throws MailboxException { + return getAttachmentMapper(mailboxSession).getRelatedMessageIds(attachmentId); } } http://git-wip-us.apache.org/repos/asf/james-project/blob/c9ac405c/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/AttachmentMapper.java ---------------------------------------------------------------------- diff --git a/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/AttachmentMapper.java b/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/AttachmentMapper.java index c9c12bb..3bcb496 100644 --- a/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/AttachmentMapper.java +++ b/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/AttachmentMapper.java @@ -38,5 +38,5 @@ public interface AttachmentMapper extends Mapper { void storeAttachmentsForMessage(Collection<Attachment> attachments, MessageId ownerMessageId) throws MailboxException; - Collection<MessageId> getOwnerMessageIds(AttachmentId attachmentId) throws MailboxException; + Collection<MessageId> getRelatedMessageIds(AttachmentId attachmentId) throws MailboxException; } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/james-project/blob/c9ac405c/mailbox/store/src/test/java/org/apache/james/mailbox/store/mail/model/AttachmentMapperTest.java ---------------------------------------------------------------------- diff --git a/mailbox/store/src/test/java/org/apache/james/mailbox/store/mail/model/AttachmentMapperTest.java b/mailbox/store/src/test/java/org/apache/james/mailbox/store/mail/model/AttachmentMapperTest.java index d3903fe..9459ed9 100644 --- a/mailbox/store/src/test/java/org/apache/james/mailbox/store/mail/model/AttachmentMapperTest.java +++ b/mailbox/store/src/test/java/org/apache/james/mailbox/store/mail/model/AttachmentMapperTest.java @@ -144,7 +144,7 @@ public abstract class AttachmentMapperTest { @Test public void getOwnerMessageIdsShouldReturnEmptyWhenNone() throws Exception { - Collection<MessageId> messageIds = attachmentMapper.getOwnerMessageIds(UNKNOWN_ATTACHMENT_ID); + Collection<MessageId> messageIds = attachmentMapper.getRelatedMessageIds(UNKNOWN_ATTACHMENT_ID); assertThat(messageIds).isEmpty(); } @@ -160,7 +160,7 @@ public abstract class AttachmentMapperTest { attachmentMapper.storeAttachment(attachment); //When - Collection<MessageId> messageIds = attachmentMapper.getOwnerMessageIds(attachmentId); + Collection<MessageId> messageIds = attachmentMapper.getRelatedMessageIds(attachmentId); //Then assertThat(messageIds).isEmpty(); } @@ -177,7 +177,7 @@ public abstract class AttachmentMapperTest { attachmentMapper.storeAttachmentsForMessage(ImmutableList.of(attachment), messageId); //When - Collection<MessageId> messageIds = attachmentMapper.getOwnerMessageIds(attachmentId); + Collection<MessageId> messageIds = attachmentMapper.getRelatedMessageIds(attachmentId); //Then assertThat(messageIds).containsOnly(messageId); } @@ -196,7 +196,7 @@ public abstract class AttachmentMapperTest { attachmentMapper.storeAttachmentsForMessage(ImmutableList.of(attachment), messageId2); //When - Collection<MessageId> messageIds = attachmentMapper.getOwnerMessageIds(attachmentId); + Collection<MessageId> messageIds = attachmentMapper.getRelatedMessageIds(attachmentId); //Then assertThat(messageIds).containsOnly(messageId1, messageId2); } @@ -219,7 +219,7 @@ public abstract class AttachmentMapperTest { attachmentMapper.storeAttachmentsForMessage(ImmutableList.of(otherAttachment), messageId2); //When - Collection<MessageId> messageIds = attachmentMapper.getOwnerMessageIds(attachmentId); + Collection<MessageId> messageIds = attachmentMapper.getRelatedMessageIds(attachmentId); //Then assertThat(messageIds).containsOnly(messageId1); } @@ -237,7 +237,7 @@ public abstract class AttachmentMapperTest { attachmentMapper.storeAttachmentsForMessage(ImmutableList.of(attachment), messageId); //When - Collection<MessageId> messageIds = attachmentMapper.getOwnerMessageIds(attachmentId); + Collection<MessageId> messageIds = attachmentMapper.getRelatedMessageIds(attachmentId); //Then assertThat(messageIds).containsOnly(messageId); } @@ -259,8 +259,8 @@ public abstract class AttachmentMapperTest { attachmentMapper.storeAttachmentsForMessage(ImmutableList.of(attachment, attachment2), messageId); //When - Collection<MessageId> messageIds = attachmentMapper.getOwnerMessageIds(attachmentId); - Collection<MessageId> messageIds2 = attachmentMapper.getOwnerMessageIds(attachmentId2); + Collection<MessageId> messageIds = attachmentMapper.getRelatedMessageIds(attachmentId); + Collection<MessageId> messageIds2 = attachmentMapper.getRelatedMessageIds(attachmentId2); //Then assertThat(messageIds).isEqualTo(messageIds2); } http://git-wip-us.apache.org/repos/asf/james-project/blob/c9ac405c/server/container/guice/mailbox/src/main/java/org/apache/james/modules/MailboxProbeImpl.java ---------------------------------------------------------------------- diff --git a/server/container/guice/mailbox/src/main/java/org/apache/james/modules/MailboxProbeImpl.java b/server/container/guice/mailbox/src/main/java/org/apache/james/modules/MailboxProbeImpl.java index 6dbfb05..6a9588f 100644 --- a/server/container/guice/mailbox/src/main/java/org/apache/james/modules/MailboxProbeImpl.java +++ b/server/container/guice/mailbox/src/main/java/org/apache/james/modules/MailboxProbeImpl.java @@ -56,7 +56,8 @@ public class MailboxProbeImpl implements GuiceProbe, MailboxProbe { public static final boolean RECENT = true; @Inject - private MailboxProbeImpl(MailboxManager mailboxManager, MailboxMapperFactory mailboxMapperFactory, SubscriptionManager subscriptionManager) { + private MailboxProbeImpl(MailboxManager mailboxManager, MailboxMapperFactory mailboxMapperFactory, + SubscriptionManager subscriptionManager) { this.mailboxManager = mailboxManager; this.mailboxMapperFactory = mailboxMapperFactory; this.subscriptionManager = subscriptionManager; @@ -190,4 +191,5 @@ public class MailboxProbeImpl implements GuiceProbe, MailboxProbe { MailboxSession mailboxSession = mailboxManager.createSystemSession(user); return subscriptionManager.subscriptions(mailboxSession); } + } \ No newline at end of file --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
