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 bt...@apache.org on 2018/08/03 00:58:19 UTC
[4/8] james-project git commit: JAMES-2468 Remove message pack
EventSerializer implementation
JAMES-2468 Remove message pack EventSerializer implementation
Project: http://git-wip-us.apache.org/repos/asf/james-project/repo
Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/3a1a896d
Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/3a1a896d
Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/3a1a896d
Branch: refs/heads/master
Commit: 3a1a896d8c81fa78cfa400d8efe232dd6a65a0b6
Parents: f6af9e0
Author: Antoine Duprat <ad...@linagora.com>
Authored: Mon Jul 16 12:42:44 2018 +0200
Committer: Benoit Tellier <bt...@linagora.com>
Committed: Fri Aug 3 07:56:28 2018 +0700
----------------------------------------------------------------------
...istributedMailboxDelegatingListenerTest.java | 20 ++++-------
mailbox/store/pom.xml | 5 ---
.../james/mailbox/store/MessageBatcher.java | 3 +-
.../store/json/MessagePackEventSerializer.java | 35 ------------------
...elegatingMailboxListenerIntegrationTest.java | 20 ++++-------
.../json/MessagePackEventSerializerTest.java | 37 --------------------
6 files changed, 16 insertions(+), 104 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/james-project/blob/3a1a896d/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/event/distributed/CassandraBasedRegisteredDistributedMailboxDelegatingListenerTest.java
----------------------------------------------------------------------
diff --git a/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/event/distributed/CassandraBasedRegisteredDistributedMailboxDelegatingListenerTest.java b/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/event/distributed/CassandraBasedRegisteredDistributedMailboxDelegatingListenerTest.java
index ca6dc84..b1563d1 100644
--- a/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/event/distributed/CassandraBasedRegisteredDistributedMailboxDelegatingListenerTest.java
+++ b/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/event/distributed/CassandraBasedRegisteredDistributedMailboxDelegatingListenerTest.java
@@ -40,7 +40,7 @@ import org.apache.james.mailbox.store.event.EventFactory;
import org.apache.james.mailbox.store.event.distributed.DistantMailboxPathRegister;
import org.apache.james.mailbox.store.event.distributed.PublisherReceiver;
import org.apache.james.mailbox.store.event.distributed.RegisteredDelegatingMailboxListener;
-import org.apache.james.mailbox.store.json.MessagePackEventSerializer;
+import org.apache.james.mailbox.store.json.JsonEventSerializer;
import org.apache.james.mailbox.store.json.event.EventConverter;
import org.apache.james.mailbox.store.json.event.MailboxConverter;
import org.apache.james.mailbox.store.mail.model.MailboxMessage;
@@ -98,11 +98,11 @@ public class CassandraBasedRegisteredDistributedMailboxDelegatingListenerTest {
CassandraUtils.WITH_DEFAULT_CONFIGURATION,
CASSANDRA_TIME_OUT_IN_S),
SCHEDULER_PERIOD_IN_S);
+ JsonEventSerializer eventSerializer = new JsonEventSerializer(
+ new EventConverter(new MailboxConverter(new TestIdDeserializer())),
+ new TestMessageId.Factory());
registeredDelegatingMailboxListener1 = new RegisteredDelegatingMailboxListener(
- new MessagePackEventSerializer(
- new EventConverter(new MailboxConverter(new TestIdDeserializer())),
- new TestMessageId.Factory()
- ),
+ eventSerializer,
publisherReceiver,
publisherReceiver,
mailboxPathRegister1);
@@ -114,10 +114,7 @@ public class CassandraBasedRegisteredDistributedMailboxDelegatingListenerTest {
CASSANDRA_TIME_OUT_IN_S),
SCHEDULER_PERIOD_IN_S);
registeredDelegatingMailboxListener2 = new RegisteredDelegatingMailboxListener(
- new MessagePackEventSerializer(
- new EventConverter(new MailboxConverter(new TestIdDeserializer())),
- new TestMessageId.Factory()
- ),
+ eventSerializer,
publisherReceiver,
publisherReceiver,
mailboxPathRegister2);
@@ -129,10 +126,7 @@ public class CassandraBasedRegisteredDistributedMailboxDelegatingListenerTest {
CASSANDRA_TIME_OUT_IN_S),
SCHEDULER_PERIOD_IN_S);
registeredDelegatingMailboxListener3 = new RegisteredDelegatingMailboxListener(
- new MessagePackEventSerializer(
- new EventConverter(new MailboxConverter(new TestIdDeserializer())),
- new TestMessageId.Factory()
- ),
+ eventSerializer,
publisherReceiver,
publisherReceiver,
mailboxPathRegister3);
http://git-wip-us.apache.org/repos/asf/james-project/blob/3a1a896d/mailbox/store/pom.xml
----------------------------------------------------------------------
diff --git a/mailbox/store/pom.xml b/mailbox/store/pom.xml
index 8033192..1913e89 100644
--- a/mailbox/store/pom.xml
+++ b/mailbox/store/pom.xml
@@ -135,11 +135,6 @@
<scope>test</scope>
</dependency>
<dependency>
- <groupId>org.msgpack</groupId>
- <artifactId>jackson-dataformat-msgpack</artifactId>
- <version>0.7.0-p9</version>
- </dependency>
- <dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
http://git-wip-us.apache.org/repos/asf/james-project/blob/3a1a896d/mailbox/store/src/main/java/org/apache/james/mailbox/store/MessageBatcher.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/main/java/org/apache/james/mailbox/store/MessageBatcher.java b/mailbox/store/src/main/java/org/apache/james/mailbox/store/MessageBatcher.java
index c51154b..a1119e0 100644
--- a/mailbox/store/src/main/java/org/apache/james/mailbox/store/MessageBatcher.java
+++ b/mailbox/store/src/main/java/org/apache/james/mailbox/store/MessageBatcher.java
@@ -24,7 +24,8 @@ import java.util.List;
import org.apache.james.mailbox.exception.MailboxException;
import org.apache.james.mailbox.model.MessageRange;
-import org.msgpack.core.Preconditions;
+
+import com.google.common.base.Preconditions;
public class MessageBatcher {
http://git-wip-us.apache.org/repos/asf/james-project/blob/3a1a896d/mailbox/store/src/main/java/org/apache/james/mailbox/store/json/MessagePackEventSerializer.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/main/java/org/apache/james/mailbox/store/json/MessagePackEventSerializer.java b/mailbox/store/src/main/java/org/apache/james/mailbox/store/json/MessagePackEventSerializer.java
deleted file mode 100644
index 6f09e47..0000000
--- a/mailbox/store/src/main/java/org/apache/james/mailbox/store/json/MessagePackEventSerializer.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/****************************************************************
- * 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.mailbox.store.json;
-
-import org.apache.james.mailbox.model.MessageId;
-import org.apache.james.mailbox.store.json.event.EventConverter;
-import org.msgpack.jackson.dataformat.MessagePackFactory;
-
-import com.fasterxml.jackson.databind.ObjectMapper;
-
-/**
- * MailboxMessage Pack ( http://msgpack.org/ ) Event Serializer
- */
-public class MessagePackEventSerializer extends JacksonEventSerializer {
- public MessagePackEventSerializer(EventConverter eventConverter, MessageId.Factory messageIdFactory) {
- super(eventConverter, configureObjectMapper(new ObjectMapper(new MessagePackFactory()), messageIdFactory));
- }
-}
http://git-wip-us.apache.org/repos/asf/james-project/blob/3a1a896d/mailbox/store/src/test/java/org/apache/james/mailbox/store/event/distributed/BroadcastDelegatingMailboxListenerIntegrationTest.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/test/java/org/apache/james/mailbox/store/event/distributed/BroadcastDelegatingMailboxListenerIntegrationTest.java b/mailbox/store/src/test/java/org/apache/james/mailbox/store/event/distributed/BroadcastDelegatingMailboxListenerIntegrationTest.java
index 9eaca45..9403bfc 100644
--- a/mailbox/store/src/test/java/org/apache/james/mailbox/store/event/distributed/BroadcastDelegatingMailboxListenerIntegrationTest.java
+++ b/mailbox/store/src/test/java/org/apache/james/mailbox/store/event/distributed/BroadcastDelegatingMailboxListenerIntegrationTest.java
@@ -32,7 +32,7 @@ import org.apache.james.mailbox.model.TestId;
import org.apache.james.mailbox.model.TestMessageId;
import org.apache.james.mailbox.store.TestIdDeserializer;
import org.apache.james.mailbox.store.event.EventFactory;
-import org.apache.james.mailbox.store.json.MessagePackEventSerializer;
+import org.apache.james.mailbox.store.json.JsonEventSerializer;
import org.apache.james.mailbox.store.json.event.EventConverter;
import org.apache.james.mailbox.store.json.event.MailboxConverter;
import org.apache.james.mailbox.store.mail.model.MailboxMessage;
@@ -71,26 +71,20 @@ public class BroadcastDelegatingMailboxListenerIntegrationTest {
@Before
public void setUp() throws Exception {
PublisherReceiver publisherReceiver = new PublisherReceiver();
+ JsonEventSerializer eventSerializer = new JsonEventSerializer(
+ new EventConverter(new MailboxConverter(new TestIdDeserializer())),
+ new TestMessageId.Factory());
broadcastDelegatingMailboxListener1 = new BroadcastDelegatingMailboxListener(publisherReceiver,
publisherReceiver,
- new MessagePackEventSerializer(
- new EventConverter(new MailboxConverter(new TestIdDeserializer())),
- new TestMessageId.Factory()
- ),
+ eventSerializer,
TOPIC);
broadcastDelegatingMailboxListener2 = new BroadcastDelegatingMailboxListener(publisherReceiver,
publisherReceiver,
- new MessagePackEventSerializer(
- new EventConverter(new MailboxConverter(new TestIdDeserializer())),
- new TestMessageId.Factory()
- ),
+ eventSerializer,
TOPIC);
broadcastDelegatingMailboxListener3 = new BroadcastDelegatingMailboxListener(publisherReceiver,
publisherReceiver,
- new MessagePackEventSerializer(
- new EventConverter(new MailboxConverter(new TestIdDeserializer())),
- new TestMessageId.Factory()
- ),
+ eventSerializer,
TOPIC);
eventCollectorMailbox1 = new EventCollector(MailboxListener.ListenerType.MAILBOX);
eventCollectorMailbox2 = new EventCollector(MailboxListener.ListenerType.MAILBOX);
http://git-wip-us.apache.org/repos/asf/james-project/blob/3a1a896d/mailbox/store/src/test/java/org/apache/james/mailbox/store/json/MessagePackEventSerializerTest.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/test/java/org/apache/james/mailbox/store/json/MessagePackEventSerializerTest.java b/mailbox/store/src/test/java/org/apache/james/mailbox/store/json/MessagePackEventSerializerTest.java
deleted file mode 100644
index 5273005..0000000
--- a/mailbox/store/src/test/java/org/apache/james/mailbox/store/json/MessagePackEventSerializerTest.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/****************************************************************
- * 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.mailbox.store.json;
-
-import org.apache.james.mailbox.model.TestMessageId;
-import org.apache.james.mailbox.store.TestIdDeserializer;
-import org.apache.james.mailbox.store.event.EventSerializer;
-import org.apache.james.mailbox.store.json.event.EventConverter;
-import org.apache.james.mailbox.store.json.event.MailboxConverter;
-
-public class MessagePackEventSerializerTest extends EventSerializerTest {
-
- @Override
- EventSerializer createSerializer() {
- return new MessagePackEventSerializer(
- new EventConverter(
- new MailboxConverter(new TestIdDeserializer())),
- new TestMessageId.Factory());
- }
-}
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org