JAMES-1717 ZonedDateTime provider should be located in java8 utils project
Project: http://git-wip-us.apache.org/repos/asf/james-project/repo Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/9550a3be Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/9550a3be Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/9550a3be Branch: refs/heads/master Commit: 9550a3be71d427fa51a99cd3e9160b3d9a8abfc7 Parents: 7697abf Author: Benoit Tellier <btell...@linagora.com> Authored: Tue Apr 19 13:59:26 2016 +0700 Committer: Benoit Tellier <btell...@linagora.com> Committed: Fri May 27 18:02:46 2016 +0700 ---------------------------------------------------------------------- .../org/apache/james/jmap/JMAPCommonModule.java | 4 +-- server/container/util-java8/pom.xml | 4 +++ .../util/date/DefaultZonedDateTimeProvider.java | 31 ++++++++++++++++++++ .../james/util/date/ZonedDateTimeProvider.java | 28 ++++++++++++++++++ .../CassandraJmapAuthenticationTest.java | 2 +- .../jmap/FixedDateZonedDateTimeProvider.java | 2 +- .../memory/MemoryJmapAuthenticationTest.java | 2 +- .../crypto/SignedContinuationTokenManager.java | 2 +- .../james/jmap/mailet/VacationMailet.java | 2 +- .../utils/DefaultZonedDateTimeProvider.java | 31 -------------------- .../james/jmap/utils/ZonedDateTimeProvider.java | 28 ------------------ .../jmap/FixedDateZonedDateTimeProvider.java | 2 +- .../james/jmap/mailet/VacationMailetTest.java | 2 +- 13 files changed, 72 insertions(+), 68 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/james-project/blob/9550a3be/server/container/guice/guice-common/src/main/java/org/apache/james/jmap/JMAPCommonModule.java ---------------------------------------------------------------------- diff --git a/server/container/guice/guice-common/src/main/java/org/apache/james/jmap/JMAPCommonModule.java b/server/container/guice/guice-common/src/main/java/org/apache/james/jmap/JMAPCommonModule.java index 78958c4..cb8915e 100644 --- a/server/container/guice/guice-common/src/main/java/org/apache/james/jmap/JMAPCommonModule.java +++ b/server/container/guice/guice-common/src/main/java/org/apache/james/jmap/JMAPCommonModule.java @@ -30,8 +30,8 @@ import org.apache.james.jmap.crypto.SignatureHandler; import org.apache.james.jmap.crypto.SignedContinuationTokenManager; import org.apache.james.jmap.send.MailFactory; import org.apache.james.jmap.send.MailSpool; -import org.apache.james.jmap.utils.DefaultZonedDateTimeProvider; -import org.apache.james.jmap.utils.ZonedDateTimeProvider; +import org.apache.james.util.date.DefaultZonedDateTimeProvider; +import org.apache.james.util.date.ZonedDateTimeProvider; import org.apache.mailet.base.AutomaticallySentMailDetector; import org.apache.mailet.base.AutomaticallySentMailDetectorImpl; http://git-wip-us.apache.org/repos/asf/james-project/blob/9550a3be/server/container/util-java8/pom.xml ---------------------------------------------------------------------- diff --git a/server/container/util-java8/pom.xml b/server/container/util-java8/pom.xml index 572884e..fc851f4 100644 --- a/server/container/util-java8/pom.xml +++ b/server/container/util-java8/pom.xml @@ -134,6 +134,10 @@ <artifactId>guava</artifactId> </dependency> <dependency> + <groupId>javax.inject</groupId> + <artifactId>javax.inject</artifactId> + </dependency> + <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <scope>test</scope> http://git-wip-us.apache.org/repos/asf/james-project/blob/9550a3be/server/container/util-java8/src/main/java/org/apache/james/util/date/DefaultZonedDateTimeProvider.java ---------------------------------------------------------------------- diff --git a/server/container/util-java8/src/main/java/org/apache/james/util/date/DefaultZonedDateTimeProvider.java b/server/container/util-java8/src/main/java/org/apache/james/util/date/DefaultZonedDateTimeProvider.java new file mode 100644 index 0000000..47b776a --- /dev/null +++ b/server/container/util-java8/src/main/java/org/apache/james/util/date/DefaultZonedDateTimeProvider.java @@ -0,0 +1,31 @@ +/**************************************************************** + * 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.util.date; + +import java.time.ZoneOffset; +import java.time.ZonedDateTime; + +public class DefaultZonedDateTimeProvider implements ZonedDateTimeProvider { + + @Override + public ZonedDateTime get() { + return ZonedDateTime.now(ZoneOffset.UTC); + } +} http://git-wip-us.apache.org/repos/asf/james-project/blob/9550a3be/server/container/util-java8/src/main/java/org/apache/james/util/date/ZonedDateTimeProvider.java ---------------------------------------------------------------------- diff --git a/server/container/util-java8/src/main/java/org/apache/james/util/date/ZonedDateTimeProvider.java b/server/container/util-java8/src/main/java/org/apache/james/util/date/ZonedDateTimeProvider.java new file mode 100644 index 0000000..6f80e76 --- /dev/null +++ b/server/container/util-java8/src/main/java/org/apache/james/util/date/ZonedDateTimeProvider.java @@ -0,0 +1,28 @@ +/**************************************************************** + * 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.util.date; + +import java.time.ZonedDateTime; + +import javax.inject.Provider; + +public interface ZonedDateTimeProvider extends Provider<ZonedDateTime> { + +} http://git-wip-us.apache.org/repos/asf/james-project/blob/9550a3be/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraJmapAuthenticationTest.java ---------------------------------------------------------------------- diff --git a/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraJmapAuthenticationTest.java b/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraJmapAuthenticationTest.java index ebadae7..790fe30 100644 --- a/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraJmapAuthenticationTest.java +++ b/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraJmapAuthenticationTest.java @@ -23,9 +23,9 @@ import org.apache.james.GuiceJamesServer; import org.apache.james.backends.cassandra.EmbeddedCassandra; import org.apache.james.jmap.FixedDateZonedDateTimeProvider; import org.apache.james.jmap.JMAPAuthenticationTest; -import org.apache.james.jmap.utils.ZonedDateTimeProvider; import org.apache.james.mailbox.elasticsearch.EmbeddedElasticSearch; import org.apache.james.modules.CassandraJmapServerModule; +import org.apache.james.util.date.ZonedDateTimeProvider; import org.junit.Rule; import org.junit.rules.RuleChain; import org.junit.rules.TemporaryFolder; http://git-wip-us.apache.org/repos/asf/james-project/blob/9550a3be/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/FixedDateZonedDateTimeProvider.java ---------------------------------------------------------------------- diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/FixedDateZonedDateTimeProvider.java b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/FixedDateZonedDateTimeProvider.java index 3dddcec..fd0c24c 100644 --- a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/FixedDateZonedDateTimeProvider.java +++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/FixedDateZonedDateTimeProvider.java @@ -21,7 +21,7 @@ package org.apache.james.jmap; import java.time.ZonedDateTime; -import org.apache.james.jmap.utils.ZonedDateTimeProvider; +import org.apache.james.util.date.ZonedDateTimeProvider; public class FixedDateZonedDateTimeProvider implements ZonedDateTimeProvider { http://git-wip-us.apache.org/repos/asf/james-project/blob/9550a3be/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/MemoryJmapAuthenticationTest.java ---------------------------------------------------------------------- diff --git a/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/MemoryJmapAuthenticationTest.java b/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/MemoryJmapAuthenticationTest.java index 8634962..b66eb89 100644 --- a/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/MemoryJmapAuthenticationTest.java +++ b/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/src/test/java/org/apache/james/jmap/memory/MemoryJmapAuthenticationTest.java @@ -24,7 +24,7 @@ import org.apache.james.MemoryJamesServerMain; import org.apache.james.jmap.FixedDateZonedDateTimeProvider; import org.apache.james.jmap.JMAPAuthenticationTest; import org.apache.james.jmap.servers.MemoryJmapServerModule; -import org.apache.james.jmap.utils.ZonedDateTimeProvider; +import org.apache.james.util.date.ZonedDateTimeProvider; import org.junit.Rule; import org.junit.rules.TemporaryFolder; http://git-wip-us.apache.org/repos/asf/james-project/blob/9550a3be/server/protocols/jmap/src/main/java/org/apache/james/jmap/crypto/SignedContinuationTokenManager.java ---------------------------------------------------------------------- diff --git a/server/protocols/jmap/src/main/java/org/apache/james/jmap/crypto/SignedContinuationTokenManager.java b/server/protocols/jmap/src/main/java/org/apache/james/jmap/crypto/SignedContinuationTokenManager.java index 781c424..f9ff554 100644 --- a/server/protocols/jmap/src/main/java/org/apache/james/jmap/crypto/SignedContinuationTokenManager.java +++ b/server/protocols/jmap/src/main/java/org/apache/james/jmap/crypto/SignedContinuationTokenManager.java @@ -26,7 +26,7 @@ import javax.inject.Inject; import org.apache.james.jmap.api.ContinuationTokenManager; import org.apache.james.jmap.model.ContinuationToken; -import org.apache.james.jmap.utils.ZonedDateTimeProvider; +import org.apache.james.util.date.ZonedDateTimeProvider; import com.google.common.base.Preconditions; http://git-wip-us.apache.org/repos/asf/james-project/blob/9550a3be/server/protocols/jmap/src/main/java/org/apache/james/jmap/mailet/VacationMailet.java ---------------------------------------------------------------------- diff --git a/server/protocols/jmap/src/main/java/org/apache/james/jmap/mailet/VacationMailet.java b/server/protocols/jmap/src/main/java/org/apache/james/jmap/mailet/VacationMailet.java index 620d5ff..410e0ed 100644 --- a/server/protocols/jmap/src/main/java/org/apache/james/jmap/mailet/VacationMailet.java +++ b/server/protocols/jmap/src/main/java/org/apache/james/jmap/mailet/VacationMailet.java @@ -28,7 +28,7 @@ import javax.mail.MessagingException; import org.apache.james.jmap.api.vacation.AccountId; import org.apache.james.jmap.api.vacation.Vacation; import org.apache.james.jmap.api.vacation.VacationRepository; -import org.apache.james.jmap.utils.ZonedDateTimeProvider; +import org.apache.james.util.date.ZonedDateTimeProvider; import org.apache.mailet.Mail; import org.apache.mailet.MailAddress; import org.apache.mailet.base.AutomaticallySentMailDetector; http://git-wip-us.apache.org/repos/asf/james-project/blob/9550a3be/server/protocols/jmap/src/main/java/org/apache/james/jmap/utils/DefaultZonedDateTimeProvider.java ---------------------------------------------------------------------- diff --git a/server/protocols/jmap/src/main/java/org/apache/james/jmap/utils/DefaultZonedDateTimeProvider.java b/server/protocols/jmap/src/main/java/org/apache/james/jmap/utils/DefaultZonedDateTimeProvider.java deleted file mode 100644 index 5d86f12..0000000 --- a/server/protocols/jmap/src/main/java/org/apache/james/jmap/utils/DefaultZonedDateTimeProvider.java +++ /dev/null @@ -1,31 +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.jmap.utils; - -import java.time.ZoneOffset; -import java.time.ZonedDateTime; - -public class DefaultZonedDateTimeProvider implements ZonedDateTimeProvider { - - @Override - public ZonedDateTime get() { - return ZonedDateTime.now(ZoneOffset.UTC); - } -} http://git-wip-us.apache.org/repos/asf/james-project/blob/9550a3be/server/protocols/jmap/src/main/java/org/apache/james/jmap/utils/ZonedDateTimeProvider.java ---------------------------------------------------------------------- diff --git a/server/protocols/jmap/src/main/java/org/apache/james/jmap/utils/ZonedDateTimeProvider.java b/server/protocols/jmap/src/main/java/org/apache/james/jmap/utils/ZonedDateTimeProvider.java deleted file mode 100644 index c13ab0b..0000000 --- a/server/protocols/jmap/src/main/java/org/apache/james/jmap/utils/ZonedDateTimeProvider.java +++ /dev/null @@ -1,28 +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.jmap.utils; - -import java.time.ZonedDateTime; - -import javax.inject.Provider; - -public interface ZonedDateTimeProvider extends Provider<ZonedDateTime> { - -} http://git-wip-us.apache.org/repos/asf/james-project/blob/9550a3be/server/protocols/jmap/src/test/java/org/apache/james/jmap/FixedDateZonedDateTimeProvider.java ---------------------------------------------------------------------- diff --git a/server/protocols/jmap/src/test/java/org/apache/james/jmap/FixedDateZonedDateTimeProvider.java b/server/protocols/jmap/src/test/java/org/apache/james/jmap/FixedDateZonedDateTimeProvider.java index 3dddcec..fd0c24c 100644 --- a/server/protocols/jmap/src/test/java/org/apache/james/jmap/FixedDateZonedDateTimeProvider.java +++ b/server/protocols/jmap/src/test/java/org/apache/james/jmap/FixedDateZonedDateTimeProvider.java @@ -21,7 +21,7 @@ package org.apache.james.jmap; import java.time.ZonedDateTime; -import org.apache.james.jmap.utils.ZonedDateTimeProvider; +import org.apache.james.util.date.ZonedDateTimeProvider; public class FixedDateZonedDateTimeProvider implements ZonedDateTimeProvider { http://git-wip-us.apache.org/repos/asf/james-project/blob/9550a3be/server/protocols/jmap/src/test/java/org/apache/james/jmap/mailet/VacationMailetTest.java ---------------------------------------------------------------------- diff --git a/server/protocols/jmap/src/test/java/org/apache/james/jmap/mailet/VacationMailetTest.java b/server/protocols/jmap/src/test/java/org/apache/james/jmap/mailet/VacationMailetTest.java index ff73594..105c1c3 100644 --- a/server/protocols/jmap/src/test/java/org/apache/james/jmap/mailet/VacationMailetTest.java +++ b/server/protocols/jmap/src/test/java/org/apache/james/jmap/mailet/VacationMailetTest.java @@ -36,7 +36,7 @@ import javax.mail.MessagingException; import org.apache.james.jmap.api.vacation.AccountId; import org.apache.james.jmap.api.vacation.Vacation; import org.apache.james.jmap.api.vacation.VacationRepository; -import org.apache.james.jmap.utils.ZonedDateTimeProvider; +import org.apache.james.util.date.ZonedDateTimeProvider; import org.apache.mailet.MailAddress; import org.apache.mailet.MailetContext; import org.apache.mailet.base.AutomaticallySentMailDetector; --------------------------------------------------------------------- To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org