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 2019/11/08 03:11:47 UTC

[james-project] branch master updated (f48dc2d -> ebea6a8)

This is an automated email from the ASF dual-hosted git repository.

btellier pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git.


    from f48dc2d  JAMES-2949 Rename Username.fromUsername to Username.of
     new cbe0805  JAMES-2933 Update the dev-build documentation page
     new 581fba72 JAMES-2933 Change intellij CVS image to Git
     new c34ae1b  JAMES-2933 Move intellij section first
     new 21379b0  JAMES-2933 Maven 3.6.0+ is required by the build
     new 084636c  JAMES-2933 Update intelliJ version used
     new 0f8349b  JAMES-2933 Improve IntelliJ build section based on Jerry Malcolm feedback
     new 03ac1aa  JAMES-2904 Cassandra session user password and ssl configuration options
     new ca3d8b7  JAMES-2904 Move ResilientClusterProvider to backend
     new 9d36604  JAMES-2904 ClusterWithKeyspaceCreatedFactory should rely on ClusterConfiguration
     new 6a4ad33  JAMES-2904 Remove ClusterBuilder complicated host/port options
     new b48dc97  JAMES-2904 ClusterBuild should be turned into ClusterFactory
     new 1b54740  JAMES-2904 CassandraExtension should have only one constructor
     new 0f97a25  JAMES-2904 Clear some unecessary cassandra components in tests
     new d054a8b  JAMES-2904 Enhance cassandra authentification integration test
     new a82f331  JAMES-2904 Introduce a KeyspaceFactory
     new afb905b  PROTOCOLS-37 [Refactoring] Remove unused class FutureStreamResponseImpl
     new db236b2  PROTOCOLS-37 [Refactoring] Remove unused class FutureStartTlsResponse
     new b3ee4b9  PROTOCOLS-37 [Refactoring] Remove unnecessary handling of FutureResponse
     new eea2836  PROTOCOLS-37 [Refactoring] Remove AbstractProtocolTransportTest tests for FutureResponse support
     new 88d9ee8  PROTOCOLS-37 [Refactoring] Get rid of FutureResponse class
     new 2cf0c2f  PROTOCOLS-37 [Refactoring] AbstractProtocolTransport::writeQueuedResponses is no longer used
     new 5062a28  PROTOCOLS-37 [Refactoring] ReIndent AbstractProtocolTransport
     new f3ae6ea  PROTOCOLS-36 [Refactoring] AbstractProtocolTransport response queue is no longer needed
     new 69e25a0  PROTOCOLS-37 [Refactoring] unwrap writeResponseToClient
     new bad4289  [REFACTORING] Clean protocols-api javadoc
     new b3605f8  [REFACTORING] Clean protocols-netty javadoc
     new d46ec94  [REFACTORING] Clean protocols-imap javadoc
     new bf902d9  [REFACTORING] Clean protocols-pop3 javadoc
     new 9289963  [REFACTORING] Clean protocols-smtp javadoc
     new 4a28ba5  [REFACTORING] Clean protocols-managesieve javadoc
     new 1047f87  [REFACTORING] IMAPMDCContext Should rely on ImapSession, not IMAPSession
     new 6eac63c  [REFACTORING] Remove unused class IMAPRequestLineReader
     new 83b1c51  [REFACTORING] Remove unused class IMAPCommandDispatcher
     new ef3a89f  [REFACTORING] Remove unused class IMAPRequest
     new bb5bc98  [REFACTORING] Remove unused class IMAPSession
     new ebea6a8  [REFACTORING] Move used class of package protocols.imap in their right imap counterpart

The 36 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../backends/cassandra/init/ClusterBuilder.java    | 190 ---------------------
 .../backends/cassandra/init/ClusterFactory.java    |  71 ++++++++
 .../init/ClusterWithKeyspaceCreatedFactory.java    |  71 --------
 .../backends/cassandra/init/KeyspaceFactory.java}  |  29 ++--
 .../cassandra/init}/ResilientClusterProvider.java  |  18 +-
 .../init/configuration/ClusterConfiguration.java   | 105 ++++++++++--
 .../james/backends/cassandra/CassandraCluster.java |  27 +--
 .../backends/cassandra/CassandraWaitStrategy.java  |   2 +-
 .../james/backends/cassandra/DockerCassandra.java  |  18 +-
 ...terBuilderTest.java => ClusterFactoryTest.java} |  11 +-
 .../SessionWithInitializedTablesFactoryTest.java   |  29 ++--
 .../destination/conf/cassandra.properties          |   3 +
 .../destination/conf/cassandra.properties          |   3 +
 .../destination/conf/cassandra.properties          |   3 +
 .../destination/conf/cassandra.properties          |   3 +
 pom.xml                                            |   2 +-
 .../protocols/api/AbstractProtocolTransport.java   | 109 +-----------
 .../james/protocols/api/AbstractResponse.java      |   4 -
 .../apache/james/protocols/api/BaseRequest.java    |   1 -
 .../james/protocols/api/CombinedInputStream.java   |   2 -
 .../org/apache/james/protocols/api/Encryption.java |   9 +-
 .../org/apache/james/protocols/api/Protocol.java   |   9 +-
 .../james/protocols/api/ProtocolConfiguration.java |   4 -
 .../protocols/api/ProtocolConfigurationImpl.java   |   2 -
 .../apache/james/protocols/api/ProtocolImpl.java   |   3 +-
 .../apache/james/protocols/api/ProtocolServer.java |   8 +-
 .../james/protocols/api/ProtocolSession.java       |  17 +-
 .../james/protocols/api/ProtocolSessionImpl.java   |   2 -
 .../james/protocols/api/ProtocolTransport.java     |  24 +--
 .../org/apache/james/protocols/api/Request.java    |   6 -
 .../org/apache/james/protocols/api/Response.java   |   2 -
 .../james/protocols/api/StartTlsResponse.java      |   1 -
 .../apache/james/protocols/api/StreamResponse.java |   4 -
 .../james/protocols/api/future/FutureResponse.java |  68 --------
 .../protocols/api/future/FutureResponseImpl.java   | 149 ----------------
 .../api/future/FutureStartTlsResponse.java         |  46 -----
 .../api/future/FutureStreamResponseImpl.java       |  53 ------
 .../api/handler/AbstractProtocolHandlerChain.java  |   2 -
 .../protocols/api/handler/CommandDispatcher.java   |  31 +---
 .../api/handler/CommandHandlerResultLogger.java    |   2 -
 .../protocols/api/handler/ConnectHandler.java      |   3 -
 .../protocols/api/handler/DisconnectHandler.java   |   2 -
 .../protocols/api/handler/ExtensibleHandler.java   |   3 +-
 .../james/protocols/api/handler/LineHandler.java   |   2 +-
 .../protocols/api/handler/MultiLineHandler.java    |   8 +-
 .../protocols/api/handler/ProtocolHandler.java     |   4 -
 .../api/handler/ProtocolHandlerChain.java          |   2 -
 .../api/handler/ProtocolHandlerChainImpl.java      |   2 -
 .../api/handler/ProtocolHandlerResultHandler.java  |   8 +-
 .../api/handler/UnknownCommandHandler.java         |   3 -
 .../protocols/api/handler/WiringException.java     |  13 --
 .../api/AbstractProtocolTransportTest.java         |  74 --------
 .../apache/james/imap/api/display/CharsetUtil.java |  10 +-
 .../org/apache/james/imap/api/message/IdRange.java |  11 +-
 .../apache/james/imap/api/process/ImapSession.java |   7 -
 .../james/imap/api/process/SearchResUtil.java      |   9 -
 .../james/imap/api/process/SelectedMailbox.java    |  11 --
 .../imap/utils => imap/decode}/DecoderUtils.java   |   8 +-
 .../imap => imap/decode}/DecodingException.java    |   2 +-
 .../james/imap/decode/FetchPartPathDecoder.java    |   1 -
 .../james/imap/decode/ImapRequestLineReader.java   |  20 +--
 .../imap/decode/ImapRequestStreamLineReader.java   |   5 +-
 .../decode/base/AbstractImapCommandParser.java     |   2 +-
 .../james/imap/decode/main/DefaultImapDecoder.java |   2 +-
 .../imap/decode/main/ImapRequestStreamHandler.java |   2 +-
 .../parser/AbstractMessageRangeCommandParser.java  |   2 +-
 .../parser/AbstractSelectionCommandParser.java     |  12 +-
 .../decode/parser/AbstractUidCommandParser.java    |   2 +-
 .../imap/decode/parser/AppendCommandParser.java    |   2 +-
 .../decode/parser/AuthenticateCommandParser.java   |   2 +-
 .../decode/parser/CapabilityCommandParser.java     |   2 +-
 .../imap/decode/parser/CheckCommandParser.java     |   2 +-
 .../imap/decode/parser/CloseCommandParser.java     |   2 +-
 .../imap/decode/parser/CompressCommandParser.java  |   2 +-
 .../imap/decode/parser/CreateCommandParser.java    |   2 +-
 .../imap/decode/parser/DeleteACLCommandParser.java |   2 +-
 .../imap/decode/parser/DeleteCommandParser.java    |   2 +-
 .../imap/decode/parser/EnableCommandParser.java    |   2 +-
 .../imap/decode/parser/ExpungeCommandParser.java   |   2 +-
 .../imap/decode/parser/FetchCommandParser.java     |   6 +-
 .../imap/decode/parser/GetACLCommandParser.java    |   3 +-
 .../decode/parser/GetAnnotationCommandParser.java  |   2 +-
 .../imap/decode/parser/GetQuotaCommandParser.java  |   2 +-
 .../decode/parser/GetQuotaRootCommandParser.java   |   2 +-
 .../imap/decode/parser/IdleCommandParser.java      |   2 +-
 .../imap/decode/parser/ListCommandParser.java      |   2 +-
 .../decode/parser/ListRightsCommandParser.java     |   2 +-
 .../imap/decode/parser/LoginCommandParser.java     |   2 +-
 .../imap/decode/parser/LogoutCommandParser.java    |   2 +-
 .../imap/decode/parser/MyRightsCommandParser.java  |   2 +-
 .../imap/decode/parser/NamespaceCommandParser.java |   2 +-
 .../imap/decode/parser/NoopCommandParser.java      |   2 +-
 .../imap/decode/parser/RenameCommandParser.java    |   2 +-
 .../imap/decode/parser/SearchCommandParser.java    |   2 +-
 .../imap/decode/parser/SetACLCommandParser.java    |   2 +-
 .../decode/parser/SetAnnotationCommandParser.java  |   2 +-
 .../imap/decode/parser/SetQuotaCommandParser.java  |   2 +-
 .../imap/decode/parser/StartTLSCommandParser.java  |   2 +-
 .../imap/decode/parser/StatusCommandParser.java    |   2 +-
 .../imap/decode/parser/StoreCommandParser.java     |   2 +-
 .../imap/decode/parser/SubscribeCommandParser.java |   2 +-
 .../james/imap/decode/parser/UidCommandParser.java |   2 +-
 .../imap/decode/parser/UnselectCommandParser.java  |   2 +-
 .../decode/parser/UnsubscribeCommandParser.java    |   2 +-
 .../james/imap/encode/ImapResponseComposer.java    |  14 +-
 .../james/imap/encode/ImapResponseWriter.java      |   2 -
 .../encode/base/AbstractChainedImapEncoder.java    |   5 -
 .../imap/encode/base/ImapResponseComposerImpl.java |   2 +-
 .../james/imap/message/response/Literal.java       |   2 -
 .../imap/processor/AbstractMailboxProcessor.java   |   4 -
 .../imap/processor/AuthenticateProcessor.java      |   8 -
 .../processor/CapabilityImplementingProcessor.java |   3 +-
 .../james/imap/processor/EnableProcessor.java      |   5 -
 .../james/imap/processor/GetACLProcessor.java      |   1 -
 .../apache/james/imap/processor/ListProcessor.java |   7 -
 .../processor/PermitEnableCapabilityProcessor.java |  14 --
 .../james/imap/processor/SetACLProcessor.java      |   1 -
 .../{protocols => }/imap/utils/EolInputStream.java |   2 +-
 .../imap/utils/FastByteArrayOutputStream.java      |   2 +-
 .../imap/utils/FixedLengthInputStream.java         |   2 +-
 .../apache/james/protocols/imap/IMAPRequest.java   | 144 ----------------
 .../protocols/imap/IMAPRequestLineReader.java      |  84 ---------
 .../apache/james/protocols/imap/IMAPSession.java   | 118 -------------
 .../protocols/imap/core/IMAPCommandDispatcher.java |  78 ---------
 .../decode}/DecoderUtilsLocaleDateTest.java        |   2 +-
 .../utils => imap/decode}/DecoderUtilsTest.java    |   3 +-
 .../imap/decode/FetchPartPathDecoderTest.java      |   1 -
 .../imap/decode/ImapRequestLineReaderTest.java     |   1 -
 .../james/imap/decode/main/IdRangeParseTest.java   |   2 +-
 .../james/imap/decode/parser/CopyParserTest.java   |   2 +-
 .../decode/parser/CreateCommandParserTest.java     |   2 +-
 .../parser/FetchCommandParserPartialFetchTest.java |   2 +-
 .../parser/GetAnnotationCommandParserTest.java     |   2 +-
 .../imap/decode/parser/GetQuotaParserTest.java     |   2 +-
 .../imap/decode/parser/GetQuotaRootParserTest.java |   2 +-
 .../james/imap/decode/parser/MoveParserTest.java   |   2 +-
 .../SearchCommandParserAndParenthesesTest.java     |   2 +-
 .../SearchCommandParserQuotedCharsetTest.java      |   2 +-
 .../parser/SearchCommandParserSearchKeyTest.java   |   2 +-
 .../parser/SearchCommandParserTopLevelAndTest.java |   2 +-
 .../parser/SetAnnotationCommandParserTest.java     |   2 +-
 .../decode/parser/SetQuotaCommandParserTest.java   |   2 +-
 .../james/protocols/lmtp/LMTPConfiguration.java    |   3 -
 .../james/protocols/lmtp/LMTPMultiResponse.java    |   5 +-
 .../protocols/lmtp/LMTPProtocolHandlerChain.java   |   2 -
 .../lmtp/core/DataLineMessageHookHandler.java      |   2 -
 .../lmtp/core/ReceivedDataLineFilter.java          |   2 -
 .../protocols/lmtp/core/WelcomeMessageHandler.java |   2 -
 .../lmtp/hook/DeliverToRecipientHook.java          |   5 +-
 .../managesieve/api/AuthenticationProcessor.java   |   4 +-
 .../managesieve/api/ManageSieveException.java      |   8 -
 .../james/protocols/netty/AbstractAsyncServer.java |  17 --
 .../netty/AbstractChannelPipelineFactory.java      |   6 +-
 .../AbstractSSLAwareChannelPipelineFactory.java    |   8 +-
 .../netty/BasicChannelUpstreamHandler.java         |  13 --
 .../james/protocols/netty/ChannelGroupHandler.java |   1 -
 .../james/protocols/netty/HandlerConstants.java    |   2 -
 .../james/protocols/netty/TimeoutHandler.java      |   1 -
 .../james/protocols/pop3/POP3Configuration.java    |   1 -
 .../apache/james/protocols/pop3/POP3Protocol.java  |   1 -
 .../protocols/pop3/POP3ProtocolHandlerChain.java   |   3 -
 .../apache/james/protocols/pop3/POP3Response.java  |   2 -
 .../james/protocols/pop3/POP3StartTlsResponse.java |   2 -
 .../james/protocols/pop3/POP3StreamResponse.java   |   1 -
 .../pop3/core/AbstractApopCmdHandler.java          |   7 +-
 .../pop3/core/AbstractPassCmdHandler.java          |  14 +-
 .../james/protocols/pop3/core/CapaCapability.java  |   4 -
 .../protocols/pop3/core/MessageMetaDataUtils.java  |   7 -
 .../protocols/pop3/mailbox/AbstractMailbox.java    |   5 +-
 .../james/protocols/pop3/mailbox/ImapMailbox.java  |  16 --
 .../james/protocols/pop3/mailbox/Mailbox.java      |  24 ---
 .../protocols/pop3/mailbox/MessageMetaData.java    |   8 -
 .../apache/james/protocols/smtp/MailEnvelope.java  |  17 +-
 .../james/protocols/smtp/MailEnvelopeImpl.java     |   6 -
 .../protocols/smtp/SMTPConfigurationImpl.java      |   2 -
 .../apache/james/protocols/smtp/SMTPProtocol.java  |   2 -
 .../protocols/smtp/SMTPProtocolHandlerChain.java   |   4 -
 .../apache/james/protocols/smtp/SMTPResponse.java  |   8 +-
 .../james/protocols/smtp/SMTPServerMBean.java      |   7 +-
 .../apache/james/protocols/smtp/SMTPSession.java   |   2 -
 .../james/protocols/smtp/SMTPStartTlsResponse.java |   2 -
 .../smtp/core/AbstractAddHeadersFilter.java        |  11 +-
 .../core/AbstractAuthRequiredToRelayRcptHook.java  |   3 +-
 .../smtp/core/AbstractHookableCmdHandler.java      |   1 -
 ...ractSenderAuthIdentifyVerificationRcptHook.java |   3 +-
 .../james/protocols/smtp/core/DataCmdHandler.java  |   1 -
 .../james/protocols/smtp/core/DataLineFilter.java  |   4 -
 .../smtp/core/DataLineMessageHookHandler.java      |   6 +-
 .../james/protocols/smtp/core/ExpnCmdHandler.java  |   1 -
 .../james/protocols/smtp/core/HelpCmdHandler.java  |   1 -
 .../james/protocols/smtp/core/NoopCmdHandler.java  |   1 -
 .../smtp/core/ReceivedDataLineFilter.java          |   4 -
 .../james/protocols/smtp/core/RsetCmdHandler.java  |   1 -
 .../james/protocols/smtp/core/VrfyCmdHandler.java  |   1 -
 .../protocols/smtp/core/esmtp/AuthCmdHandler.java  |  13 +-
 .../core/fastfail/AbstractGreylistHandler.java     |   9 +-
 .../smtp/core/fastfail/DNSRBLHandler.java          |   6 +-
 .../core/fastfail/ValidSenderDomainHandler.java    |   3 +-
 .../protocols/smtp/core/log/HookResultLogger.java  |   2 -
 .../apache/james/protocols/smtp/hook/HeloHook.java |   4 -
 .../org/apache/james/protocols/smtp/hook/Hook.java |   2 -
 .../james/protocols/smtp/hook/SimpleHook.java      |   2 -
 .../james/protocols/smtp/hook/UnknownHook.java     |   4 -
 .../modules/mailbox/CassandraSessionModule.java    |   1 +
 .../AuthenticatedCassandraJamesServerTest.java     | 107 ++++++++++++
 ....java => CassandraAuthenticationExtension.java} |  83 ++++-----
 .../java/org/apache/james/CassandraExtension.java  |  11 +-
 .../org/apache/james/FixingGhostMailboxTest.java   |  10 +-
 .../james/JamesServerWithRetryConnectionTest.java  |   8 +-
 .../netty/AbstractNettyImapRequestLineReader.java  |   2 +-
 .../james/imapserver/netty/IMAPMDCContext.java     |  24 ++-
 .../netty/NettyImapRequestLineReader.java          |   4 +-
 .../netty/NettyStreamImapRequestLineReader.java    |   6 +-
 .../images/intellij-idea/intellij-git-repo.png     | Bin 0 -> 20247 bytes
 .../intellij-idea/intellij-james-project.png       | Bin 181143 -> 80415 bytes
 .../intellij-idea/intellij-svn-repo-add-repo.png   | Bin 29020 -> 0 bytes
 .../intellij-svn-repo-checkout-choose-folder.png   | Bin 40299 -> 0 bytes
 .../images/intellij-idea/intellij-svn-repo.png     | Bin 60958 -> 0 bytes
 src/site/xdoc/server/config-cassandra.xml          |  13 ++
 src/site/xdoc/server/dev-build.xml                 |  82 +++++----
 220 files changed, 593 insertions(+), 2050 deletions(-)
 delete mode 100644 backends-common/cassandra/src/main/java/org/apache/james/backends/cassandra/init/ClusterBuilder.java
 create mode 100644 backends-common/cassandra/src/main/java/org/apache/james/backends/cassandra/init/ClusterFactory.java
 delete mode 100644 backends-common/cassandra/src/main/java/org/apache/james/backends/cassandra/init/ClusterWithKeyspaceCreatedFactory.java
 copy backends-common/cassandra/src/{test/java/org/apache/james/backends/cassandra/init/ClusterBuilderTest.java => main/java/org/apache/james/backends/cassandra/init/KeyspaceFactory.java} (66%)
 rename {server/container/guice/cassandra-guice/src/main/java/org/apache/james/modules/mailbox => backends-common/cassandra/src/main/java/org/apache/james/backends/cassandra/init}/ResilientClusterProvider.java (77%)
 rename backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/init/{ClusterBuilderTest.java => ClusterFactoryTest.java} (83%)
 delete mode 100644 protocols/api/src/main/java/org/apache/james/protocols/api/future/FutureResponse.java
 delete mode 100644 protocols/api/src/main/java/org/apache/james/protocols/api/future/FutureResponseImpl.java
 delete mode 100644 protocols/api/src/main/java/org/apache/james/protocols/api/future/FutureStartTlsResponse.java
 delete mode 100644 protocols/api/src/main/java/org/apache/james/protocols/api/future/FutureStreamResponseImpl.java
 rename protocols/imap/src/main/java/org/apache/james/{protocols/imap/utils => imap/decode}/DecoderUtils.java (98%)
 rename protocols/imap/src/main/java/org/apache/james/{protocols/imap => imap/decode}/DecodingException.java (98%)
 rename protocols/imap/src/main/java/org/apache/james/{protocols => }/imap/utils/EolInputStream.java (98%)
 rename protocols/imap/src/main/java/org/apache/james/{protocols => }/imap/utils/FastByteArrayOutputStream.java (99%)
 rename protocols/imap/src/main/java/org/apache/james/{protocols => }/imap/utils/FixedLengthInputStream.java (98%)
 delete mode 100644 protocols/imap/src/main/java/org/apache/james/protocols/imap/IMAPRequest.java
 delete mode 100644 protocols/imap/src/main/java/org/apache/james/protocols/imap/IMAPRequestLineReader.java
 delete mode 100644 protocols/imap/src/main/java/org/apache/james/protocols/imap/IMAPSession.java
 delete mode 100644 protocols/imap/src/main/java/org/apache/james/protocols/imap/core/IMAPCommandDispatcher.java
 rename protocols/imap/src/test/java/org/apache/james/{protocols/imap/utils => imap/decode}/DecoderUtilsLocaleDateTest.java (99%)
 rename protocols/imap/src/test/java/org/apache/james/{protocols/imap/utils => imap/decode}/DecoderUtilsTest.java (99%)
 create mode 100644 server/container/guice/cassandra-guice/src/test/java/org/apache/james/AuthenticatedCassandraJamesServerTest.java
 copy server/container/guice/cassandra-guice/src/test/java/org/apache/james/{DockerCassandraRule.java => CassandraAuthenticationExtension.java} (53%)
 create mode 100644 src/site/resources/server/images/intellij-idea/intellij-git-repo.png
 delete mode 100644 src/site/resources/server/images/intellij-idea/intellij-svn-repo-add-repo.png
 delete mode 100644 src/site/resources/server/images/intellij-idea/intellij-svn-repo-checkout-choose-folder.png
 delete mode 100644 src/site/resources/server/images/intellij-idea/intellij-svn-repo.png


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[james-project] 19/36: PROTOCOLS-37 [Refactoring] Remove AbstractProtocolTransportTest tests for FutureResponse support

Posted by bt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit eea2836c82ebb70a3962ab8a6a05b30c16fa6f69
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Thu Nov 7 09:01:02 2019 +0700

    PROTOCOLS-37 [Refactoring] Remove AbstractProtocolTransportTest tests for FutureResponse support
---
 .../api/AbstractProtocolTransportTest.java         | 74 ----------------------
 1 file changed, 74 deletions(-)

diff --git a/protocols/api/src/test/java/org/apache/james/protocols/api/AbstractProtocolTransportTest.java b/protocols/api/src/test/java/org/apache/james/protocols/api/AbstractProtocolTransportTest.java
index 41d6763..904175d 100644
--- a/protocols/api/src/test/java/org/apache/james/protocols/api/AbstractProtocolTransportTest.java
+++ b/protocols/api/src/test/java/org/apache/james/protocols/api/AbstractProtocolTransportTest.java
@@ -26,13 +26,11 @@ import java.io.UnsupportedEncodingException;
 import java.net.InetSocketAddress;
 import java.util.ArrayList;
 import java.util.Arrays;
-import java.util.Collections;
 import java.util.List;
 import java.util.UUID;
 import java.util.concurrent.CountDownLatch;
 import java.util.stream.IntStream;
 
-import org.apache.james.protocols.api.future.FutureResponseImpl;
 import org.apache.james.protocols.api.handler.LineHandler;
 import org.junit.Test;
 
@@ -55,78 +53,6 @@ public class AbstractProtocolTransportTest {
         checkWrittenResponses(messages);
     }
     
-    @Test
-    public void testWriteOrderFutureResponseAllReady() throws InterruptedException, UnsupportedEncodingException {
-        final List<Response> messages = new ArrayList<>();
-        for (int i = 0; i < 2000; i++) {
-                FutureResponseImpl r = new FutureResponseImpl();
-                r.setResponse(new TestResponse());
-                messages.add(r);
-        }
-        checkWrittenResponses(messages);
-    }
-        
-       
-    @Test
-    public void testWriteOrderFutureResponse() throws InterruptedException, UnsupportedEncodingException {
-        final List<Response> messages = IntStream.range(0, 2000)
-            .mapToObj(i -> new FutureResponseImpl())
-            .collect(Guavate.toImmutableList());
-
-        notifyFutureResponses(messages, false);
-        
-        checkWrittenResponses(messages);
-    }
-
-    @Test
-    public void testWriteOrderFutureResponseReverseNotify() throws InterruptedException, UnsupportedEncodingException {
-        final List<Response> messages = IntStream.range(0, 2000)
-            .mapToObj(i -> new FutureResponseImpl())
-            .collect(Guavate.toImmutableList());
-
-        notifyFutureResponses(messages, true);
-
-        checkWrittenResponses(messages);
-    }
-    
-    @Test
-    public void testWriteOrderMixedResponse() throws InterruptedException, UnsupportedEncodingException {
-        final List<Response> messages = new ArrayList<>();
-        for (int i = 0; i < 2000; i++) {
-            if (i % 2 == 0) {
-                messages.add(new TestResponse());
-            } else {
-                messages.add(new FutureResponseImpl());
-            }
-
-        }
-        notifyFutureResponses(messages, false);
-        
-        checkWrittenResponses(messages);
-    }
-    
-    private void notifyFutureResponses(final List<Response> messages, final boolean reverse) {
-        new Thread(() -> {
-            try {
-                Thread.sleep(200);
-                List<Response> responses = new ArrayList<>(messages);
-                if (reverse) {
-                    Collections.reverse(responses);
-                }
-
-                for (Response r : responses) {
-                    if (r instanceof FutureResponseImpl) {
-                        ((FutureResponseImpl) r).setResponse(new TestResponse());
-                    }
-                }
-
-            } catch (InterruptedException e) {
-                throw new RuntimeException();
-            }
-
-        }).start();
-    }
-    
     private void checkWrittenResponses(List<Response> messages) throws InterruptedException, UnsupportedEncodingException {
         final List<byte[]> writtenMessages = new ArrayList<>();
 


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[james-project] 26/36: [REFACTORING] Clean protocols-netty javadoc

Posted by bt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit b3605f83f60cdc06aa47ccd66e6505fb4f172f18
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Thu Nov 7 11:17:33 2019 +0700

    [REFACTORING] Clean protocols-netty javadoc
    
     - Solve IntellijJ warnings related to javaDoc
     - Remove verbose, meaningless entries
---
 .../james/protocols/netty/AbstractAsyncServer.java      | 17 -----------------
 .../protocols/netty/AbstractChannelPipelineFactory.java |  6 ++----
 .../netty/AbstractSSLAwareChannelPipelineFactory.java   |  8 +-------
 .../protocols/netty/BasicChannelUpstreamHandler.java    |  2 --
 .../james/protocols/netty/ChannelGroupHandler.java      |  1 -
 .../apache/james/protocols/netty/HandlerConstants.java  |  2 --
 .../apache/james/protocols/netty/TimeoutHandler.java    |  1 -
 7 files changed, 3 insertions(+), 34 deletions(-)

diff --git a/protocols/netty/src/main/java/org/apache/james/protocols/netty/AbstractAsyncServer.java b/protocols/netty/src/main/java/org/apache/james/protocols/netty/AbstractAsyncServer.java
index ef8554d..a7aef3c 100644
--- a/protocols/netty/src/main/java/org/apache/james/protocols/netty/AbstractAsyncServer.java
+++ b/protocols/netty/src/main/java/org/apache/james/protocols/netty/AbstractAsyncServer.java
@@ -40,7 +40,6 @@ import com.google.common.collect.ImmutableList;
 
 /**
  * Abstract base class for Servers which want to use async io
- *
  */
 public abstract class AbstractAsyncServer implements ProtocolServer {
 
@@ -68,8 +67,6 @@ public abstract class AbstractAsyncServer implements ProtocolServer {
     
     /**
      * Set the IO-worker thread count to use. Default is nCores * 2
-     * 
-     * @param ioWorker
      */
     public void setIoWorkerCount(int ioWorker) {
         if (started) {
@@ -80,8 +77,6 @@ public abstract class AbstractAsyncServer implements ProtocolServer {
     
     /**
      * Return the IO worker thread count to use
-     * 
-     * @return ioWorker
      */
     public int getIoWorkerCount() {
         return ioWorker;
@@ -114,8 +109,6 @@ public abstract class AbstractAsyncServer implements ProtocolServer {
 
     /**
      * Configure the bootstrap before it get bound
-     * 
-     * @param bootstrap
      */
     protected void configureBootstrap(ServerBootstrap bootstrap) {
         // Bind and start to accept incoming connections.
@@ -155,16 +148,12 @@ public abstract class AbstractAsyncServer implements ProtocolServer {
     
     /**
      * Create ChannelPipelineFactory to use by this Server implementation
-     * 
-     * @return factory
      */
     protected abstract ChannelPipelineFactory createPipelineFactory(ChannelGroup group);
 
     /**
      * Set the read/write timeout for the server. This will throw a {@link IllegalStateException} if the
      * server is running.
-     * 
-     * @param timeout
      */
     public void setTimeout(int timeout) {
         if (started) {
@@ -176,8 +165,6 @@ public abstract class AbstractAsyncServer implements ProtocolServer {
     
     /**
      * Set the Backlog for the socket. This will throw a {@link IllegalStateException} if the server is running.
-     * 
-     * @param backlog
      */
     public void setBacklog(int backlog) {
         if (started) {
@@ -201,8 +188,6 @@ public abstract class AbstractAsyncServer implements ProtocolServer {
     /**
      * Create a new {@link Executor} used for dispatch messages to the workers. One Thread will be used per port which is bound.
      * This can get overridden if needed, by default it use a {@link Executors#newCachedThreadPool()}
-     * 
-     * @return bossExecutor
      */
     protected Executor createBossExecutor() {
         ThreadFactory threadFactory = NamedThreadFactory.withClassName(getClass());
@@ -211,8 +196,6 @@ public abstract class AbstractAsyncServer implements ProtocolServer {
 
     /**
      * Create a new {@link Executor} used for workers. This can get overridden if needed, by default it use a {@link Executors#newCachedThreadPool()}
-     * 
-     * @return workerExecutor
      */
     protected Executor createWorkerExecutor() {
         ThreadFactory threadFactory = NamedThreadFactory.withClassName(getClass());
diff --git a/protocols/netty/src/main/java/org/apache/james/protocols/netty/AbstractChannelPipelineFactory.java b/protocols/netty/src/main/java/org/apache/james/protocols/netty/AbstractChannelPipelineFactory.java
index 67377d8..5f242e7 100644
--- a/protocols/netty/src/main/java/org/apache/james/protocols/netty/AbstractChannelPipelineFactory.java
+++ b/protocols/netty/src/main/java/org/apache/james/protocols/netty/AbstractChannelPipelineFactory.java
@@ -30,8 +30,6 @@ import org.jboss.netty.util.HashedWheelTimer;
 
 /**
  * Abstract base class for {@link ChannelPipelineFactory} implementations
- * 
- *
  */
 public abstract class AbstractChannelPipelineFactory implements ChannelPipelineFactory {
     public static final int MAX_LINE_LENGTH = 8192;
@@ -94,8 +92,8 @@ public abstract class AbstractChannelPipelineFactory implements ChannelPipelineF
     
     /**
      * Create the core {@link ChannelUpstreamHandler} to use
-     * 
-     * @return coreHandeler
+     *
+     * @return coreHandler
      */
     protected abstract ChannelUpstreamHandler createHandler();
 
diff --git a/protocols/netty/src/main/java/org/apache/james/protocols/netty/AbstractSSLAwareChannelPipelineFactory.java b/protocols/netty/src/main/java/org/apache/james/protocols/netty/AbstractSSLAwareChannelPipelineFactory.java
index 8039dc7..5dee691 100644
--- a/protocols/netty/src/main/java/org/apache/james/protocols/netty/AbstractSSLAwareChannelPipelineFactory.java
+++ b/protocols/netty/src/main/java/org/apache/james/protocols/netty/AbstractSSLAwareChannelPipelineFactory.java
@@ -28,9 +28,7 @@ import org.jboss.netty.handler.ssl.SslHandler;
 import org.jboss.netty.util.HashedWheelTimer;
 
 /**
- * Abstract base class for {@link ChannelPipeline} implementations which use TLS 
- * 
- *
+ * Abstract base class for {@link ChannelPipeline} implementations which use TLS
  */
 public abstract class AbstractSSLAwareChannelPipelineFactory extends AbstractChannelPipelineFactory {
 
@@ -78,15 +76,11 @@ public abstract class AbstractSSLAwareChannelPipelineFactory extends AbstractCha
 
     /**
      * Return if the socket is using SSL/TLS
-     * 
-     * @return isSSL
      */
     protected abstract boolean isSSLSocket();
     
     /**
      * Return the SSL context
-     * 
-     * @return context
      */
     protected abstract SSLContext getSSLContext();
 }
diff --git a/protocols/netty/src/main/java/org/apache/james/protocols/netty/BasicChannelUpstreamHandler.java b/protocols/netty/src/main/java/org/apache/james/protocols/netty/BasicChannelUpstreamHandler.java
index 59b5239..b3246ab 100644
--- a/protocols/netty/src/main/java/org/apache/james/protocols/netty/BasicChannelUpstreamHandler.java
+++ b/protocols/netty/src/main/java/org/apache/james/protocols/netty/BasicChannelUpstreamHandler.java
@@ -177,8 +177,6 @@ public class BasicChannelUpstreamHandler extends SimpleChannelUpstreamHandler {
 
     /**
      * Cleanup the channel
-     * 
-     * @param ctx
      */
     protected void cleanup(ChannelHandlerContext ctx) {
         ProtocolSession session = (ProtocolSession) ctx.getAttachment();
diff --git a/protocols/netty/src/main/java/org/apache/james/protocols/netty/ChannelGroupHandler.java b/protocols/netty/src/main/java/org/apache/james/protocols/netty/ChannelGroupHandler.java
index 7c79c55..74d1431 100644
--- a/protocols/netty/src/main/java/org/apache/james/protocols/netty/ChannelGroupHandler.java
+++ b/protocols/netty/src/main/java/org/apache/james/protocols/netty/ChannelGroupHandler.java
@@ -28,7 +28,6 @@ import org.jboss.netty.channel.group.ChannelGroup;
  * Add channels to the channel group after the channel was opened.
  * 
  * This handler is thread-safe and thus can be shared across pipelines
- *
  */
 public final class ChannelGroupHandler extends SimpleChannelUpstreamHandler {
     private final ChannelGroup channels;
diff --git a/protocols/netty/src/main/java/org/apache/james/protocols/netty/HandlerConstants.java b/protocols/netty/src/main/java/org/apache/james/protocols/netty/HandlerConstants.java
index 04e8974..f9c7b4f 100644
--- a/protocols/netty/src/main/java/org/apache/james/protocols/netty/HandlerConstants.java
+++ b/protocols/netty/src/main/java/org/apache/james/protocols/netty/HandlerConstants.java
@@ -24,8 +24,6 @@ import org.jboss.netty.channel.ChannelPipeline;
 /**
  * Provide the keys under which the {@link ChannelHandler}'s are stored in the
  * {@link ChannelPipeline}
- * 
- * 
  */
 public interface HandlerConstants {
 
diff --git a/protocols/netty/src/main/java/org/apache/james/protocols/netty/TimeoutHandler.java b/protocols/netty/src/main/java/org/apache/james/protocols/netty/TimeoutHandler.java
index 99c456b..46c1568 100644
--- a/protocols/netty/src/main/java/org/apache/james/protocols/netty/TimeoutHandler.java
+++ b/protocols/netty/src/main/java/org/apache/james/protocols/netty/TimeoutHandler.java
@@ -27,7 +27,6 @@ import org.jboss.netty.util.Timer;
 /**
  * {@link IdleStateHandler} implementation which disconnect the {@link Channel} after a configured
  * idle timeout. Be aware that this handle is not thread safe so it can't be shared across pipelines
- *
  */
 public class TimeoutHandler extends IdleStateHandler {
 


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[james-project] 29/36: [REFACTORING] Clean protocols-smtp javadoc

Posted by bt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit 9289963f3c8b856586d57dcc1062dbeced1c7082
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Thu Nov 7 12:01:15 2019 +0700

    [REFACTORING] Clean protocols-smtp javadoc
    
     - Solve IntellijJ warnings related to javaDoc
     - Remove verbose, meaningless entries
---
 .../org/apache/james/protocols/smtp/MailEnvelope.java   | 17 +----------------
 .../apache/james/protocols/smtp/MailEnvelopeImpl.java   |  6 ------
 .../james/protocols/smtp/SMTPConfigurationImpl.java     |  2 --
 .../org/apache/james/protocols/smtp/SMTPProtocol.java   |  2 --
 .../james/protocols/smtp/SMTPProtocolHandlerChain.java  |  4 ----
 .../org/apache/james/protocols/smtp/SMTPResponse.java   |  8 +-------
 .../apache/james/protocols/smtp/SMTPServerMBean.java    |  7 ++-----
 .../org/apache/james/protocols/smtp/SMTPSession.java    |  2 --
 .../james/protocols/smtp/SMTPStartTlsResponse.java      |  2 --
 .../protocols/smtp/core/AbstractAddHeadersFilter.java   | 11 ++---------
 .../smtp/core/AbstractAuthRequiredToRelayRcptHook.java  |  3 +--
 .../protocols/smtp/core/AbstractHookableCmdHandler.java |  1 -
 .../AbstractSenderAuthIdentifyVerificationRcptHook.java |  3 +--
 .../james/protocols/smtp/core/DataCmdHandler.java       |  1 -
 .../james/protocols/smtp/core/DataLineFilter.java       |  4 ----
 .../protocols/smtp/core/DataLineMessageHookHandler.java |  6 +-----
 .../james/protocols/smtp/core/ExpnCmdHandler.java       |  1 -
 .../james/protocols/smtp/core/HelpCmdHandler.java       |  1 -
 .../james/protocols/smtp/core/NoopCmdHandler.java       |  1 -
 .../protocols/smtp/core/ReceivedDataLineFilter.java     |  4 ----
 .../james/protocols/smtp/core/RsetCmdHandler.java       |  1 -
 .../james/protocols/smtp/core/VrfyCmdHandler.java       |  1 -
 .../james/protocols/smtp/core/esmtp/AuthCmdHandler.java | 13 ++-----------
 .../smtp/core/fastfail/AbstractGreylistHandler.java     |  9 +--------
 .../protocols/smtp/core/fastfail/DNSRBLHandler.java     |  6 ++----
 .../smtp/core/fastfail/ValidSenderDomainHandler.java    |  3 +--
 .../james/protocols/smtp/core/log/HookResultLogger.java |  2 --
 .../org/apache/james/protocols/smtp/hook/HeloHook.java  |  4 ----
 .../java/org/apache/james/protocols/smtp/hook/Hook.java |  2 --
 .../apache/james/protocols/smtp/hook/SimpleHook.java    |  2 --
 .../apache/james/protocols/smtp/hook/UnknownHook.java   |  4 ----
 31 files changed, 15 insertions(+), 118 deletions(-)

diff --git a/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/MailEnvelope.java b/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/MailEnvelope.java
index 915dd2f..1c38e75 100644
--- a/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/MailEnvelope.java
+++ b/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/MailEnvelope.java
@@ -29,23 +29,16 @@ import org.apache.james.core.MaybeSender;
 
 /**
  * The MailEnvelope of a SMTP-Transaction
- * 
- * 
  */
 public interface MailEnvelope {
 
     /**
-     * Return the size of the message. If the message is "empty" it will return
-     * -1
-     * 
-     * @return size
+     * Return the size of the message. If the message is "empty" it will return -1
      */
     long getSize();
 
     /**
      * Return the recipients which where supplied in the RCPT TO: command
-     * 
-     * @return recipients
      */
     List<MailAddress> getRecipients();
 
@@ -57,8 +50,6 @@ public interface MailEnvelope {
      *
      * Note that SMTP null sender ( "&lt;&gt;" ) needs to be implicitly handled by the caller under the form of 'null' or
      * {@link MailAddress#nullSender()}. Replacement method adds type safety on this operation.
-     *
-     * @return sender
      */
     @Deprecated
     default MailAddress getSender() {
@@ -82,17 +73,11 @@ public interface MailEnvelope {
      * Return the OutputStream of the message
      * 
      * TODO: Think about how to remove this!
-     * 
-     * @return out
-     * @throws IOException
      */
     OutputStream getMessageOutputStream() throws IOException;
 
     /**
      * Return the InputStream of the message
-     * 
-     * @return in
-     * @throws IOException
      */
     InputStream getMessageInputStream() throws IOException;
 }
diff --git a/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/MailEnvelopeImpl.java b/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/MailEnvelopeImpl.java
index 2f51d58..a7c3850 100644
--- a/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/MailEnvelopeImpl.java
+++ b/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/MailEnvelopeImpl.java
@@ -31,8 +31,6 @@ import org.apache.james.core.MaybeSender;
 
 /**
  * MailEnvelope implementation which stores everything in memory
- * 
- *
  */
 public class MailEnvelopeImpl implements MailEnvelope {
 
@@ -62,8 +60,6 @@ public class MailEnvelopeImpl implements MailEnvelope {
 
     /**
      * Set the recipients of the mail
-     * 
-     * @param recipientCollection
      */
     public void setRecipients(List<MailAddress> recipientCollection) {
         this.recipients = recipientCollection;
@@ -71,8 +67,6 @@ public class MailEnvelopeImpl implements MailEnvelope {
 
     /**
      * Set the sender of the mail
-     * 
-     * @param sender
      */
     public void setSender(MaybeSender sender) {
         this.sender = sender;
diff --git a/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/SMTPConfigurationImpl.java b/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/SMTPConfigurationImpl.java
index 1e278a6..f16aa29 100644
--- a/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/SMTPConfigurationImpl.java
+++ b/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/SMTPConfigurationImpl.java
@@ -22,11 +22,9 @@ package org.apache.james.protocols.smtp;
 
 import org.apache.james.protocols.api.ProtocolConfigurationImpl;
 
-
 /**
  * {@link SMTPConfiguration} implementation which allows to set and get various configuration params. The set and get methods
  * are not thread-safe
- *
  */
 public class SMTPConfigurationImpl extends ProtocolConfigurationImpl implements SMTPConfiguration {
 
diff --git a/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/SMTPProtocol.java b/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/SMTPProtocol.java
index cef7e4a..784db50 100644
--- a/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/SMTPProtocol.java
+++ b/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/SMTPProtocol.java
@@ -26,8 +26,6 @@ import org.apache.james.protocols.api.handler.ProtocolHandlerChain;
 
 /**
  * {@link ProtocolImpl} which creates {@link SMTPSessionImpl} instances
- * 
- *
  */
 public class SMTPProtocol extends ProtocolImpl {
 
diff --git a/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/SMTPProtocolHandlerChain.java b/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/SMTPProtocolHandlerChain.java
index 6c869c2..098d1a9 100644
--- a/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/SMTPProtocolHandlerChain.java
+++ b/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/SMTPProtocolHandlerChain.java
@@ -56,7 +56,6 @@ import org.apache.james.protocols.smtp.hook.Hook;
  * This {@link ProtocolHandlerChain} implementation add all needed handlers to
  * the chain to act as full blown SMTPServer. By default messages will just get
  * rejected after the DATA command.
- * 
  */
 public class SMTPProtocolHandlerChain extends ProtocolHandlerChainImpl {
 
@@ -76,9 +75,6 @@ public class SMTPProtocolHandlerChain extends ProtocolHandlerChainImpl {
 
     /**
      * Add all default handlers to the chain and the given {@link Hook}'s. After that {@link #wireExtensibleHandlers()} is called
-     * 
-     * @param hooks
-     * @throws WiringException
      */
     public SMTPProtocolHandlerChain(MetricFactory metricFactory, Hook... hooks) throws WiringException {
         this(metricFactory, true);
diff --git a/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/SMTPResponse.java b/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/SMTPResponse.java
index a9b3f08..8c5f2b2 100644
--- a/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/SMTPResponse.java
+++ b/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/SMTPResponse.java
@@ -43,13 +43,7 @@ public class SMTPResponse extends AbstractResponse {
     public SMTPResponse(String code, CharSequence description) {
         super(code, description);
     }
-    
-    /**
-     * Construct a new SMTPResponse. The given rawLine need to be in format [SMTPResponseReturnCode SMTResponseDescription].
-     * If this is not the case an IllegalArgumentException get thrown.
-     * 
-     * @param rawLine the raw SMTPResponse
-     */
+
     /**
      * Construct a new SMTPResponse. The given rawLine need to be in format [SMTPResponseReturnCode SMTResponseDescription].
      * If this is not the case an IllegalArgumentException get thrown.
diff --git a/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/SMTPServerMBean.java b/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/SMTPServerMBean.java
index ab60d0c..f6687ac 100644
--- a/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/SMTPServerMBean.java
+++ b/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/SMTPServerMBean.java
@@ -17,13 +17,10 @@
  * under the License.                                           *
  ****************************************************************/
 
-
-
 package org.apache.james.protocols.smtp;
 
 /**
  * An interface to expose James management functionality through JMX.
- * 
  */
 public interface SMTPServerMBean {
     /**
@@ -36,7 +33,7 @@ public interface SMTPServerMBean {
     /**
     * Returns the server socket type, plain or SSL 
     * 
-    * @return String The scoekt type, plain or SSL     
+    * @return String The socket type, plain or SSL
     */  
-    String  getSocketType();
+    String getSocketType();
 }
diff --git a/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/SMTPSession.java b/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/SMTPSession.java
index 21bda43..02c84c2 100644
--- a/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/SMTPSession.java
+++ b/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/SMTPSession.java
@@ -61,8 +61,6 @@ public interface SMTPSession extends ProtocolSession {
     
     /**
      * Set if reallying is allowed
-     * 
-     * @param relayingAllowed
      */
     void setRelayingAllowed(boolean relayingAllowed);
 
diff --git a/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/SMTPStartTlsResponse.java b/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/SMTPStartTlsResponse.java
index 5c0da2a..e42e787 100644
--- a/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/SMTPStartTlsResponse.java
+++ b/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/SMTPStartTlsResponse.java
@@ -27,8 +27,6 @@ import org.apache.james.protocols.api.StartTlsResponse;
 
 /**
  * This {@link SMTPResponse} should only be used once you want to start tls after the {@link SMTPResponse} was written to the client
- * 
- *
  */
 public class SMTPStartTlsResponse extends SMTPResponse implements StartTlsResponse {
 
diff --git a/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/AbstractAddHeadersFilter.java b/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/AbstractAddHeadersFilter.java
index 5fb1a7e..9c29ffd 100644
--- a/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/AbstractAddHeadersFilter.java
+++ b/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/AbstractAddHeadersFilter.java
@@ -75,10 +75,7 @@ public abstract class AbstractAddHeadersFilter extends SeparatingDataLineFilter
    
     /**
      * Add headers to the message
-     * 
-     * @param session
-     * @param line
-     * @param next
+     *
      * @return response
      */
     private Response addHeaders(SMTPSession session, ByteBuffer line, LineHandler<SMTPSession> next) {
@@ -112,8 +109,6 @@ public abstract class AbstractAddHeadersFilter extends SeparatingDataLineFilter
         
         /**
          * Add the value to the header
-         * @param value
-         * @return
          */
         public Header add(String value) {
             values.add(value);
@@ -126,9 +121,7 @@ public abstract class AbstractAddHeadersFilter extends SeparatingDataLineFilter
          * 
          * This is done for each line of the {@link Header} until the end is reached or the {@link LineHandler#onLine(org.apache.james.protocols.api.ProtocolSession, ByteBuffer)}
          * return <code>non-null</code>
-         * 
-         * @param session
-         * @param handler
+         *
          * @return response
          */
         public Response transferTo(SMTPSession session, LineHandler<SMTPSession> handler) {
diff --git a/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/AbstractAuthRequiredToRelayRcptHook.java b/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/AbstractAuthRequiredToRelayRcptHook.java
index 43fc8c8..2911e6a 100644
--- a/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/AbstractAuthRequiredToRelayRcptHook.java
+++ b/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/AbstractAuthRequiredToRelayRcptHook.java
@@ -67,8 +67,7 @@ public abstract class AbstractAuthRequiredToRelayRcptHook implements RcptHook {
     
     /**
      * Return true if the given domain is a local domain for this server
-     * 
-     * @param domain
+     *
      * @return isLocal
      */
     protected abstract boolean isLocalDomain(Domain domain);
diff --git a/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/AbstractHookableCmdHandler.java b/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/AbstractHookableCmdHandler.java
index 0d392e2..f938018 100644
--- a/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/AbstractHookableCmdHandler.java
+++ b/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/AbstractHookableCmdHandler.java
@@ -47,7 +47,6 @@ import org.slf4j.LoggerFactory;
 
 /**
  * Abstract class which Handle hook-aware CommanHandler.
- * 
  */
 public abstract class AbstractHookableCmdHandler<HookT extends org.apache.james.protocols.smtp.hook.Hook> implements CommandHandler<SMTPSession>, ExtensibleHandler {
     private static final Logger LOGGER = LoggerFactory.getLogger(AbstractHookableCmdHandler.class);
diff --git a/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/AbstractSenderAuthIdentifyVerificationRcptHook.java b/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/AbstractSenderAuthIdentifyVerificationRcptHook.java
index 4a60cfc..8351806 100644
--- a/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/AbstractSenderAuthIdentifyVerificationRcptHook.java
+++ b/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/AbstractSenderAuthIdentifyVerificationRcptHook.java
@@ -79,8 +79,7 @@ public abstract class AbstractSenderAuthIdentifyVerificationRcptHook implements
 
     /**
      * Return true if the given domain is a local domain for this server
-     * 
-     * @param domain
+     *
      * @return isLocal
      */
     protected abstract boolean isLocalDomain(Domain domain);
diff --git a/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/DataCmdHandler.java b/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/DataCmdHandler.java
index 2aa7f05..8bebea0 100644
--- a/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/DataCmdHandler.java
+++ b/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/DataCmdHandler.java
@@ -125,7 +125,6 @@ public class DataCmdHandler implements CommandHandler<SMTPSession>, ExtensibleHa
 
     /**
      * process DATA command
-     *
      */
     @Override
     public Response onCommand(SMTPSession session, Request request) {
diff --git a/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/DataLineFilter.java b/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/DataLineFilter.java
index d1804db..acec85e 100644
--- a/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/DataLineFilter.java
+++ b/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/DataLineFilter.java
@@ -36,10 +36,6 @@ public interface DataLineFilter extends ProtocolHandler {
     
     /**
      * Handle line processing
-     * 
-     * @param session
-     * @param line
-     * @param next
      */
     Response onLine(SMTPSession session, ByteBuffer line, LineHandler<SMTPSession> next);
 }
\ No newline at end of file
diff --git a/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/DataLineMessageHookHandler.java b/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/DataLineMessageHookHandler.java
index d2e7711..cc645ea 100644
--- a/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/DataLineMessageHookHandler.java
+++ b/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/DataLineMessageHookHandler.java
@@ -45,8 +45,7 @@ import org.slf4j.LoggerFactory;
 
 /**
  * This class handles the actual calling of the {@link MessageHook} implementations to queue the message. If no {@link MessageHook} return OK or DECLINED it will write back an
- * error to the client to report the problem while trying to queue the message 
- *
+ * error to the client to report the problem while trying to queue the message
  */
 public class DataLineMessageHookHandler implements DataLineFilter, ExtensibleHandler {
     private static final Logger LOGGER = LoggerFactory.getLogger(DataLineMessageHookHandler.class);
@@ -108,9 +107,6 @@ public class DataLineMessageHookHandler implements DataLineFilter, ExtensibleHan
         return bline;
     }
 
-    /**
-     * @param session
-     */
     protected Response processExtensions(SMTPSession session, MailEnvelopeImpl mail) {
        
 
diff --git a/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/ExpnCmdHandler.java b/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/ExpnCmdHandler.java
index 604b1c0..4e8e6e1 100644
--- a/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/ExpnCmdHandler.java
+++ b/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/ExpnCmdHandler.java
@@ -48,7 +48,6 @@ public class ExpnCmdHandler implements CommandHandler<SMTPSession> {
      * Handler method called upon receipt of a EXPN command.
      * This method informs the client that the command is
      * not implemented.
-     *
      */
     @Override
     public Response onCommand(SMTPSession session, Request request) {
diff --git a/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/HelpCmdHandler.java b/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/HelpCmdHandler.java
index 9fb5530..cac6a3e 100644
--- a/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/HelpCmdHandler.java
+++ b/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/HelpCmdHandler.java
@@ -44,7 +44,6 @@ public class HelpCmdHandler implements CommandHandler<SMTPSession> {
 
     /**
      * handles HELP command
-     *
     **/
     @Override
     public Response onCommand(SMTPSession session, Request request) {
diff --git a/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/NoopCmdHandler.java b/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/NoopCmdHandler.java
index 5b7e47d..72dba30 100644
--- a/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/NoopCmdHandler.java
+++ b/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/NoopCmdHandler.java
@@ -48,7 +48,6 @@ public class NoopCmdHandler implements CommandHandler<SMTPSession> {
     /**
      * Handler method called upon receipt of a NOOP command.
      * Just sends back an OK and logs the command.
-     *
      */
     @Override
     public Response onCommand(SMTPSession session, Request request) {
diff --git a/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/ReceivedDataLineFilter.java b/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/ReceivedDataLineFilter.java
index fe06546..c0f19f9 100644
--- a/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/ReceivedDataLineFilter.java
+++ b/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/ReceivedDataLineFilter.java
@@ -46,10 +46,6 @@ public class ReceivedDataLineFilter extends AbstractAddHeadersFilter {
 
     /**
      * Return the service type which will be used in the Received headers.
-     * 
-     * @param session
-     * @param heloMode
-     * @return type
      */
     protected String getServiceType(SMTPSession session, String heloMode) {
         // Check if EHLO was used
diff --git a/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/RsetCmdHandler.java b/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/RsetCmdHandler.java
index 8b0edf3..21ddf1f 100644
--- a/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/RsetCmdHandler.java
+++ b/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/RsetCmdHandler.java
@@ -54,7 +54,6 @@ public class RsetCmdHandler implements CommandHandler<SMTPSession> {
      *
      * @param session SMTP session object
      * @param argument the argument passed in with the command by the SMTP client
-     * @return 
      */
     private Response doRSET(SMTPSession session, String argument) {
         if ((argument == null) || (argument.length() == 0)) {
diff --git a/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/VrfyCmdHandler.java b/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/VrfyCmdHandler.java
index ab42862..83e2994 100644
--- a/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/VrfyCmdHandler.java
+++ b/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/VrfyCmdHandler.java
@@ -44,7 +44,6 @@ public class VrfyCmdHandler implements CommandHandler<SMTPSession> {
      * Handler method called upon receipt of a VRFY command.
      * This method informs the client that the command is
      * not implemented.
-     *
      */
     @Override
     public Response onCommand(SMTPSession session, Request request) {
diff --git a/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/esmtp/AuthCmdHandler.java b/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/esmtp/AuthCmdHandler.java
index a62abd9..84e0b57 100644
--- a/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/esmtp/AuthCmdHandler.java
+++ b/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/esmtp/AuthCmdHandler.java
@@ -213,7 +213,7 @@ public class AuthCmdHandler
      * Decoded: test\000test\000tEst42
      *
      * @param session SMTP session object
-     * @param initialResponse the initial response line passed in with the AUTH command
+     * @param line the initial response line passed in with the AUTH command
      */
     private Response doPlainAuthPass(SMTPSession session, String line) {
         String user = null;
@@ -286,7 +286,7 @@ public class AuthCmdHandler
      * Carries out the Login AUTH SASL exchange.
      *
      * @param session SMTP session object
-     * @param initialResponse the initial response line passed in with the AUTH command
+     * @param user the user passed in with the AUTH command
      */
     private Response doLoginAuthPass(SMTPSession session, String user) {
         if (user != null) {
@@ -335,15 +335,6 @@ public class AuthCmdHandler
         return doAuthTest(session, user, pass, "LOGIN");
     }
 
-
-
-    /**
-     * @param session
-     * @param user
-     * @param pass
-     * @param authType
-     * @return
-     */
     protected Response doAuthTest(SMTPSession session, String user, String pass, String authType) {
         if ((user == null) || (pass == null)) {
             return new SMTPResponse(SMTPRetCode.SYNTAX_ERROR_ARGUMENTS,"Could not decode parameters for AUTH " + authType);
diff --git a/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/fastfail/AbstractGreylistHandler.java b/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/fastfail/AbstractGreylistHandler.java
index 2095f3d..a320dfd 100644
--- a/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/fastfail/AbstractGreylistHandler.java
+++ b/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/fastfail/AbstractGreylistHandler.java
@@ -34,11 +34,8 @@ import org.apache.james.protocols.smtp.hook.RcptHook;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-
 /**
- * Abstract base class which implement GreyListing. 
- * 
- *
+ * Abstract base class which implement GreyListing.
  */
 public abstract class AbstractGreylistHandler implements RcptHook {
     private static final Logger LOGGER = LoggerFactory.getLogger(AbstractGreylistHandler.class);
@@ -152,7 +149,6 @@ public abstract class AbstractGreylistHandler implements RcptHook {
      *            The rcptTo
      * @return data
      *            The data
-     * @throws Exception
      */
     protected abstract  Iterator<String> getGreyListData(String ipAddress, String sender, String recip) throws Exception;
 
@@ -187,7 +183,6 @@ public abstract class AbstractGreylistHandler implements RcptHook {
      *            The count
      * @param time
      *            the current time in ms
-     * @throws Exception
      */
     protected abstract void updateTriplet(String ipAddress, String sender, String recip, int count, Instant time) throws Exception;
        
@@ -197,7 +192,6 @@ public abstract class AbstractGreylistHandler implements RcptHook {
      * 
      * @param time
      *            The time which must be reached before delete the records
-     * @throws Exception
      */
     protected abstract void cleanupAutoWhiteListGreyList(Instant time)throws Exception;
 
@@ -206,7 +200,6 @@ public abstract class AbstractGreylistHandler implements RcptHook {
      * 
      * @param time
      *            The time which must be reached before delete the records
-     * @throws Exception
      */
     protected abstract void cleanupGreyList(Instant time) throws Exception;
 
diff --git a/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/fastfail/DNSRBLHandler.java b/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/fastfail/DNSRBLHandler.java
index dc90d37..2439de8 100644
--- a/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/fastfail/DNSRBLHandler.java
+++ b/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/fastfail/DNSRBLHandler.java
@@ -198,8 +198,7 @@ public class DNSRBLHandler implements RcptHook {
      * Check if the given ipaddress is resolvable. 
      * 
      * This implementation use {@link InetAddress#getByName(String)}. Sub-classes may override this with a more performant solution
-     * 
-     * @param ip
+     *
      * @return canResolve
      */
     protected boolean resolve(String ip) {
@@ -215,8 +214,7 @@ public class DNSRBLHandler implements RcptHook {
      * Return a {@link Collection} which holds all TXT records for the ip. This is most times used to add details for a RBL entry.
      * 
      * This implementation always returns an empty {@link Collection}. Sub-classes may override this.
-     * 
-     * @param ip
+     *
      * @return txtRecords
      */
     protected Collection<String> resolveTXTRecords(String ip) {
diff --git a/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/fastfail/ValidSenderDomainHandler.java b/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/fastfail/ValidSenderDomainHandler.java
index efb0384..c3649bb 100644
--- a/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/fastfail/ValidSenderDomainHandler.java
+++ b/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/fastfail/ValidSenderDomainHandler.java
@@ -27,8 +27,7 @@ import org.apache.james.protocols.smtp.hook.HookReturnCode;
 import org.apache.james.protocols.smtp.hook.MailHook;
 
 /**
- * Add MFDNSCheck feature to SMTPServer. This handler reject mail from domains which have not an an valid MX record.  
- * 
+ * Add MFDNSCheck feature to SMTPServer. This handler reject mail from domains which have not an an valid MX record.
  */
 public abstract class ValidSenderDomainHandler implements MailHook { 
 
diff --git a/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/log/HookResultLogger.java b/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/log/HookResultLogger.java
index 8253e63..726e9cc 100644
--- a/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/log/HookResultLogger.java
+++ b/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/log/HookResultLogger.java
@@ -27,10 +27,8 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * 
  * Log the {@link HookResult}. If {@link HookReturnCode.Action#DENY}, {@link HookReturnCode.Action#DENYSOFT} or {@link HookReturnCode#isDisconnected()} was used it will get
  * logged to INFO. If not to DEBUG
- *
  */
 public class HookResultLogger implements HookResultHook {
     private static final Logger LOGGER = LoggerFactory.getLogger(HookResultLogger.class);
diff --git a/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/hook/HeloHook.java b/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/hook/HeloHook.java
index 716a0e1..f792a40 100644
--- a/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/hook/HeloHook.java
+++ b/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/hook/HeloHook.java
@@ -17,16 +17,12 @@
  * under the License.                                           *
  ****************************************************************/
 
-
-
-
 package org.apache.james.protocols.smtp.hook;
 
 import org.apache.james.protocols.smtp.SMTPSession;
 
 /**
  * Implement this interfaces to hook in the HELO Command
- * 
  */
 public interface HeloHook extends Hook {
 
diff --git a/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/hook/Hook.java b/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/hook/Hook.java
index 6e60f8b..995b12a 100644
--- a/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/hook/Hook.java
+++ b/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/hook/Hook.java
@@ -22,8 +22,6 @@ import org.apache.james.protocols.api.handler.ProtocolHandler;
 
 /**
  * Just and marker interface for the different Hooks
- * 
- *
  */
 public interface Hook extends ProtocolHandler{
 
diff --git a/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/hook/SimpleHook.java b/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/hook/SimpleHook.java
index 50a3371..e73d2be 100644
--- a/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/hook/SimpleHook.java
+++ b/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/hook/SimpleHook.java
@@ -24,12 +24,10 @@ import org.apache.james.core.MaybeSender;
 import org.apache.james.protocols.smtp.MailEnvelope;
 import org.apache.james.protocols.smtp.SMTPSession;
 
-
 /**
  * Simple {@link Hook} implementation which can be used as base class when writing simple {@link Hook}'s
  * 
  * The SMTP-Server will just accept email with this {@link Hook} in place and discard it
- *
  */
 public class SimpleHook implements HeloHook, MailHook, RcptHook, MessageHook {
 
diff --git a/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/hook/UnknownHook.java b/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/hook/UnknownHook.java
index 91820fc..2505e20 100644
--- a/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/hook/UnknownHook.java
+++ b/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/hook/UnknownHook.java
@@ -22,16 +22,12 @@ import org.apache.james.protocols.smtp.SMTPSession;
 
 /**
  * Hook for unknown commands
- * 
- *
  */
 public interface UnknownHook extends Hook {
 
     /**
      * Called on unknown smtp command
      *
-     * @param session
-     * @param command
      * @return result
      */
     HookResult doUnknown(SMTPSession session, String command);


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[james-project] 24/36: PROTOCOLS-37 [Refactoring] unwrap writeResponseToClient

Posted by bt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit 69e25a08b61fa3489e5a2832f87e27c1751cf46c
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Thu Nov 7 17:18:19 2019 +0700

    PROTOCOLS-37 [Refactoring] unwrap writeResponseToClient
---
 .../james/protocols/api/AbstractProtocolTransport.java       | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)

diff --git a/protocols/api/src/main/java/org/apache/james/protocols/api/AbstractProtocolTransport.java b/protocols/api/src/main/java/org/apache/james/protocols/api/AbstractProtocolTransport.java
index 1b76bf8..b578d51 100644
--- a/protocols/api/src/main/java/org/apache/james/protocols/api/AbstractProtocolTransport.java
+++ b/protocols/api/src/main/java/org/apache/james/protocols/api/AbstractProtocolTransport.java
@@ -33,16 +33,6 @@ public abstract class AbstractProtocolTransport implements ProtocolTransport {
     
     @Override
     public final void writeResponse(Response response, ProtocolSession session) {
-        writeResponseToClient(response, session);
-    }
-    
-    /**
-     * Write the {@link Response} to the client
-     * 
-     * @param response
-     * @param session
-     */
-    protected void writeResponseToClient(Response response, ProtocolSession session) {
         if (response != null) {
             boolean startTLS = false;
             if (response instanceof StartTlsResponse) {
@@ -64,7 +54,7 @@ public abstract class AbstractProtocolTransport implements ProtocolTransport {
             if (startTLS) {
                 session.resetState();
             }
-            
+
             if (response.isEndSession()) {
                 // close the channel if needed after the message was written out
                 close();


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[james-project] 13/36: JAMES-2904 Clear some unecessary cassandra components in tests

Posted by bt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit 0f97a259f605e339b669bf5a49072dbdd20f6a63
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Fri Oct 4 10:30:02 2019 +0700

    JAMES-2904 Clear some unecessary cassandra components in tests
---
 .../init/configuration/ClusterConfiguration.java   | 10 ++--
 .../james/backends/cassandra/DockerCassandra.java  |  2 +-
 .../DockerCassandraAuthenticatedSingleton.java     | 30 ------------
 .../AuthenticatedCassandraJamesServerTest.java     | 14 +++---
 .../james/CassandraAuthenticationExtension.java    | 45 +++++++++++++++---
 .../james/CassandraBadAuthenticationExtension.java | 54 ----------------------
 6 files changed, 52 insertions(+), 103 deletions(-)

diff --git a/backends-common/cassandra/src/main/java/org/apache/james/backends/cassandra/init/configuration/ClusterConfiguration.java b/backends-common/cassandra/src/main/java/org/apache/james/backends/cassandra/init/configuration/ClusterConfiguration.java
index 82c4afb..d310627 100644
--- a/backends-common/cassandra/src/main/java/org/apache/james/backends/cassandra/init/configuration/ClusterConfiguration.java
+++ b/backends-common/cassandra/src/main/java/org/apache/james/backends/cassandra/init/configuration/ClusterConfiguration.java
@@ -163,11 +163,15 @@ public class ClusterConfiguration {
             return password(Optional.of(password));
         }
 
-        public Builder useSsl(boolean useSsl) {
-            this.useSsl = Optional.of(useSsl);
+        public Builder useSsl(Optional<Boolean> useSsl) {
+            this.useSsl = useSsl;
             return this;
         }
 
+        public Builder useSsl(boolean useSsl) {
+            return useSsl(Optional.of(useSsl));
+        }
+
         public Builder useSsl() {
             return useSsl(true);
         }
@@ -236,7 +240,7 @@ public class ClusterConfiguration {
             .poolingOptions(readPoolingOptions(configuration))
             .readTimeoutMillis(Optional.ofNullable(configuration.getInteger(READ_TIMEOUT_MILLIS, null)))
             .connectTimeoutMillis(Optional.ofNullable(configuration.getInteger(CONNECT_TIMEOUT_MILLIS, null)))
-            .useSsl(configuration.getBoolean(CASSANDRA_SSL, false))
+            .useSsl(Optional.ofNullable(configuration.getBoolean(CASSANDRA_SSL, null)))
             .username(Optional.ofNullable(configuration.getString(CASSANDRA_USER, null)))
             .password(Optional.ofNullable(configuration.getString(CASSANDRA_PASSWORD, null)))
             .build();
diff --git a/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/DockerCassandra.java b/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/DockerCassandra.java
index 99dce87..7adf502 100644
--- a/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/DockerCassandra.java
+++ b/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/DockerCassandra.java
@@ -36,7 +36,7 @@ public class DockerCassandra {
     private static final Logger logger = LoggerFactory.getLogger(DockerCassandra.class);
 
     @FunctionalInterface
-    interface AdditionalDockerFileStep {
+    public interface AdditionalDockerFileStep {
         AdditionalDockerFileStep IDENTITY = builder -> builder;
 
         DockerfileBuilder applyStep(DockerfileBuilder builder);
diff --git a/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/DockerCassandraAuthenticatedSingleton.java b/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/DockerCassandraAuthenticatedSingleton.java
deleted file mode 100644
index e16f639..0000000
--- a/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/DockerCassandraAuthenticatedSingleton.java
+++ /dev/null
@@ -1,30 +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.backends.cassandra;
-
-public class DockerCassandraAuthenticatedSingleton {
-    public static final DockerCassandra singleton = new DockerCassandra("cassandra_3_11_3_auth",
-        dockerfileBuilder -> dockerfileBuilder
-            .run("echo 'authenticator: PasswordAuthenticator' >> /etc/cassandra/cassandra.yaml"));
-
-    static {
-        singleton.start();
-    }
-}
diff --git a/server/container/guice/cassandra-guice/src/test/java/org/apache/james/AuthenticatedCassandraJamesServerTest.java b/server/container/guice/cassandra-guice/src/test/java/org/apache/james/AuthenticatedCassandraJamesServerTest.java
index 130f4c9..48a450c 100644
--- a/server/container/guice/cassandra-guice/src/test/java/org/apache/james/AuthenticatedCassandraJamesServerTest.java
+++ b/server/container/guice/cassandra-guice/src/test/java/org/apache/james/AuthenticatedCassandraJamesServerTest.java
@@ -21,11 +21,8 @@ package org.apache.james;
 
 import static org.apache.james.CassandraJamesServerMain.ALL_BUT_JMX_CASSANDRA_MODULE;
 import static org.apache.james.JamesServerContract.DOMAIN_LIST_CONFIGURATION_MODULE;
-import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 
-import org.apache.commons.lang3.NotImplementedException;
-import org.apache.james.backends.cassandra.DockerCassandraAuthenticatedSingleton;
 import org.apache.james.backends.cassandra.init.configuration.ClusterConfiguration;
 import org.apache.james.mailbox.extractor.TextExtractor;
 import org.apache.james.mailbox.store.search.PDFTextExtractor;
@@ -34,7 +31,6 @@ import org.junit.jupiter.api.Nested;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.extension.RegisterExtension;
 
-import com.datastax.driver.core.exceptions.AuthenticationException;
 import com.google.inject.CreationException;
 
 class AuthenticatedCassandraJamesServerTest {
@@ -45,7 +41,7 @@ class AuthenticatedCassandraJamesServerTest {
         @RegisterExtension
         JamesServerExtension testExtension = new JamesServerBuilder()
             .extension(new DockerElasticSearchExtension())
-            .extension(new CassandraAuthenticationExtension())
+            .extension(CassandraAuthenticationExtension.withValidCredentials())
             .server(configuration -> GuiceJamesServer.forConfiguration(configuration)
                 .combineWith(ALL_BUT_JMX_CASSANDRA_MODULE)
                 .overrideWith(binder -> binder.bind(TextExtractor.class).to(PDFTextExtractor.class))
@@ -56,10 +52,12 @@ class AuthenticatedCassandraJamesServerTest {
 
     @Nested
     class SslTest {
+        private final CassandraExtension cassandraExtension = new CassandraExtension();
+
         @RegisterExtension
         JamesServerExtension testExtension = new JamesServerBuilder()
             .extension(new DockerElasticSearchExtension())
-            .extension(new CassandraExtension())
+            .extension(cassandraExtension)
             .disableAutoStart()
             .server(configuration -> GuiceJamesServer.forConfiguration(configuration)
                 .combineWith(ALL_BUT_JMX_CASSANDRA_MODULE)
@@ -68,7 +66,7 @@ class AuthenticatedCassandraJamesServerTest {
                 .overrideWith(DOMAIN_LIST_CONFIGURATION_MODULE))
             .overrideServerModule(binder -> binder.bind(ClusterConfiguration.class)
                 .toInstance(ClusterConfiguration.builder()
-                    .host(DockerCassandraAuthenticatedSingleton.singleton.getHost())
+                    .host(cassandraExtension.getCassandra().getHost())
                     .keyspace("testing")
                     .replicationFactor(1)
                     .maxRetry(1)
@@ -90,7 +88,7 @@ class AuthenticatedCassandraJamesServerTest {
         @RegisterExtension
         JamesServerExtension testExtension = new JamesServerBuilder()
             .extension(new DockerElasticSearchExtension())
-            .extension(new CassandraBadAuthenticationExtension())
+            .extension(CassandraAuthenticationExtension.withInvalidCredentials())
             .disableAutoStart()
             .server(configuration -> GuiceJamesServer.forConfiguration(configuration)
                 .combineWith(ALL_BUT_JMX_CASSANDRA_MODULE)
diff --git a/server/container/guice/cassandra-guice/src/test/java/org/apache/james/CassandraAuthenticationExtension.java b/server/container/guice/cassandra-guice/src/test/java/org/apache/james/CassandraAuthenticationExtension.java
index 7528d6c..e0578be 100644
--- a/server/container/guice/cassandra-guice/src/test/java/org/apache/james/CassandraAuthenticationExtension.java
+++ b/server/container/guice/cassandra-guice/src/test/java/org/apache/james/CassandraAuthenticationExtension.java
@@ -19,7 +19,7 @@
 
 package org.apache.james;
 
-import org.apache.james.backends.cassandra.DockerCassandraAuthenticatedSingleton;
+import org.apache.james.backends.cassandra.DockerCassandra;
 import org.apache.james.backends.cassandra.init.configuration.ClusterConfiguration;
 import org.apache.james.server.CassandraTruncateTableTask;
 import org.junit.jupiter.api.extension.ExtensionContext;
@@ -29,23 +29,54 @@ import com.google.inject.multibindings.Multibinder;
 import com.google.inject.util.Modules;
 
 public class CassandraAuthenticationExtension implements GuiceModuleTestExtension {
+    private static final String VALID_PASSWORD = "cassandra";
+    private static final String INVALID_PASSWORD = "bad";
+    private static final DockerCassandra authenticatedCassandra = new DockerCassandra("cassandra_3_11_3_auth",
+        dockerfileBuilder -> dockerfileBuilder
+            .run("echo 'authenticator: PasswordAuthenticator' >> /etc/cassandra/cassandra.yaml"));
+
+    static {
+        authenticatedCassandra.start();
+    }
+
+    public static CassandraAuthenticationExtension withValidCredentials() {
+        return new CassandraAuthenticationExtension(ClusterConfiguration.builder()
+            .password(VALID_PASSWORD)
+            .maxRetry(20)
+            .minDelay(5000));
+    }
+
+    public static CassandraAuthenticationExtension withInvalidCredentials() {
+        return new CassandraAuthenticationExtension(ClusterConfiguration.builder()
+            .password(INVALID_PASSWORD)
+            .maxRetry(1)
+            .minDelay(100));
+    }
+
+    private final ClusterConfiguration.Builder configurationBuilder;
+
+    private CassandraAuthenticationExtension(ClusterConfiguration.Builder configurationBuilder) {
+        this.configurationBuilder = configurationBuilder;
+    }
 
     @Override
     public void beforeAll(ExtensionContext extensionContext) {
-        DockerCassandraAuthenticatedSingleton.singleton.start();
+        authenticatedCassandra.start();
+    }
+
+    @Override
+    public void afterAll(ExtensionContext extensionContext) {
+        authenticatedCassandra.stop();
     }
 
     @Override
     public Module getModule() {
         return Modules.combine((binder) -> binder.bind(ClusterConfiguration.class)
-                .toInstance(ClusterConfiguration.builder()
-                    .host(DockerCassandraAuthenticatedSingleton.singleton.getHost())
+                .toInstance(configurationBuilder
+                    .host(authenticatedCassandra.getHost())
                     .keyspace("testing")
                     .username("cassandra")
-                    .password("cassandra")
                     .replicationFactor(1)
-                    .maxRetry(20)
-                    .minDelay(5000)
                     .build()),
             binder -> Multibinder.newSetBinder(binder, CleanupTasksPerformer.CleanupTask.class)
                 .addBinding()
diff --git a/server/container/guice/cassandra-guice/src/test/java/org/apache/james/CassandraBadAuthenticationExtension.java b/server/container/guice/cassandra-guice/src/test/java/org/apache/james/CassandraBadAuthenticationExtension.java
deleted file mode 100644
index a001393..0000000
--- a/server/container/guice/cassandra-guice/src/test/java/org/apache/james/CassandraBadAuthenticationExtension.java
+++ /dev/null
@@ -1,54 +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;
-
-import org.apache.james.backends.cassandra.DockerCassandraAuthenticatedSingleton;
-import org.apache.james.backends.cassandra.init.configuration.ClusterConfiguration;
-import org.apache.james.server.CassandraTruncateTableTask;
-import org.junit.jupiter.api.extension.ExtensionContext;
-
-import com.google.inject.Module;
-import com.google.inject.multibindings.Multibinder;
-import com.google.inject.util.Modules;
-
-public class CassandraBadAuthenticationExtension implements GuiceModuleTestExtension {
-
-    @Override
-    public void beforeAll(ExtensionContext extensionContext) {
-        DockerCassandraAuthenticatedSingleton.singleton.start();
-    }
-
-    @Override
-    public Module getModule() {
-        return Modules.combine((binder) -> binder.bind(ClusterConfiguration.class)
-                .toInstance(ClusterConfiguration.builder()
-                    .host(DockerCassandraAuthenticatedSingleton.singleton.getHost())
-                    .keyspace("testing")
-                    .username("cassandra")
-                    .password("bad")
-                    .replicationFactor(1)
-                    .maxRetry(1)
-                    .minDelay(100)
-                    .build()),
-            binder -> Multibinder.newSetBinder(binder, CleanupTasksPerformer.CleanupTask.class)
-                .addBinding()
-                .to(CassandraTruncateTableTask.class));
-    }
-}


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[james-project] 34/36: [REFACTORING] Remove unused class IMAPRequest

Posted by bt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit ef3a89fc324d9e3ff43972936c3769b8b4cc0be8
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Thu Nov 7 12:18:11 2019 +0700

    [REFACTORING] Remove unused class IMAPRequest
    
    This is part of the unused package protocols.imap
---
 .../apache/james/protocols/imap/IMAPRequest.java   | 140 ---------------------
 1 file changed, 140 deletions(-)

diff --git a/protocols/imap/src/main/java/org/apache/james/protocols/imap/IMAPRequest.java b/protocols/imap/src/main/java/org/apache/james/protocols/imap/IMAPRequest.java
deleted file mode 100644
index 3d1de81..0000000
--- a/protocols/imap/src/main/java/org/apache/james/protocols/imap/IMAPRequest.java
+++ /dev/null
@@ -1,140 +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.protocols.imap;
-
-import java.io.UnsupportedEncodingException;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.Locale;
-
-import org.apache.james.protocols.api.Request;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class IMAPRequest implements Request {
-
-    private static final Logger LOGGER = LoggerFactory.getLogger(IMAPRequest.class);
-
-    private static final String US_ASCII = "US_ASCII";
-    
-    private static final String CRLF = "\r\n";
-    private final Collection<ByteBuffer> lines;
-    private final String tag;
-    private final String command;
-    
-    public IMAPRequest(Collection<ByteBuffer> lines) {
-        this.lines = lines;
-        ByteBuffer buf = lines.iterator().next();
-        buf.rewind();
-        
-        this.tag = read(buf);
-        this.command = read(buf).toUpperCase(Locale.US);
-    }
-    
-    public IMAPRequest(ByteBuffer line) {
-        this(Arrays.asList(line));
-    }
-    
-    private String read(ByteBuffer buf) {
-        StringBuilder sb = new StringBuilder();
-        int i;
-        while ((i = buf.get()) != ' ') {
-            sb.append((byte) i);
-        }
-        return sb.toString();
-    }
-    
-    /**
-     * Return the tag of the request
-     */
-    public String getTag() {
-        return tag;
-    }
-    
-    @Override
-    public String getArgument() {
-        int tagOffeset = tag.length() + command.length() + 2;
-        StringBuilder sb = new StringBuilder();
-        Iterator<ByteBuffer> linesIt = lines.iterator();
-        
-        while (linesIt.hasNext()) {
-            ByteBuffer line = linesIt.next();
-            byte[] buf;
-            if (line.hasArray()) {
-                buf = line.array();
-            } else {
-                line.rewind();
-                buf = new byte[line.remaining() - tagOffeset];
-                line.get(buf, tagOffeset, line.remaining());
-            }
-            try {
-                sb.append(new String(buf, US_ASCII));
-            } catch (UnsupportedEncodingException e) {
-                // Should never happend
-                LOGGER.error("Unupported encoding", e);
-            }
-            if (linesIt.hasNext()) {
-                sb.append(CRLF);
-            }
-        }
-        return sb.toString();
-    }
-
-    @Override
-    public String getCommand() {
-        return command;
-    }
-    
-    /**
-     * Return an {@link Iterator} which holds all argument lines. The returned {@link ByteBuffer}'s will be 
-     * rewind by calling {@link ByteBuffer#rewind()} before return them
-     */
-    public Iterator<ByteBuffer> getArguments() {
-        return new Iterator<ByteBuffer>() {
-            boolean first = true;
-            Iterator<ByteBuffer> buffIt = lines.iterator();
-
-            @Override
-            public boolean hasNext() {
-                return buffIt.hasNext();
-            }
-
-            @Override
-            public ByteBuffer next() {
-                ByteBuffer buf = buffIt.next();
-                buf.rewind();
-
-                if (first) {
-                    first = false;
-                    buf.position(getTag().length() + getCommand().length() + 2);
-                    buf = buf.slice();
-                }
-                return buf;
-            }
-
-            @Override
-            public void remove() {
-                throw new UnsupportedOperationException();
-            }
-        };
-    }
-
-}


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[james-project] 35/36: [REFACTORING] Remove unused class IMAPSession

Posted by bt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit bb5bc9805dfe57c4455145dabcb8291369cddb74
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Thu Nov 7 12:18:38 2019 +0700

    [REFACTORING] Remove unused class IMAPSession
    
    This is part of the unused package protocols.imap
---
 .../apache/james/protocols/imap/IMAPSession.java   | 118 ---------------------
 1 file changed, 118 deletions(-)

diff --git a/protocols/imap/src/main/java/org/apache/james/protocols/imap/IMAPSession.java b/protocols/imap/src/main/java/org/apache/james/protocols/imap/IMAPSession.java
deleted file mode 100644
index 2e01134..0000000
--- a/protocols/imap/src/main/java/org/apache/james/protocols/imap/IMAPSession.java
+++ /dev/null
@@ -1,118 +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.protocols.imap;
-
-import org.apache.james.imap.api.ImapSessionState;
-import org.apache.james.imap.api.process.SelectedMailbox;
-import org.apache.james.protocols.api.ProtocolSession;
-import org.apache.james.protocols.api.handler.LineHandler;
-
-public interface IMAPSession extends ProtocolSession {
-
-    /**
-     * Pop the last command handler 
-     */
-    @Override
-    void popLineHandler();
-    
-    /**
-     * Return the size of the pushed {@link LineHandler}
-     * @return size of the pushed line handler
-     */
-    @Override
-    int getPushedLineHandlerCount();
-
-    /**
-     * Logs out the session. Marks the connection for closure;
-     */
-    void logout();
-
-    /**
-     * Gets the current client state.
-     * 
-     * @return Returns the current state of this session.
-     */
-    ImapSessionState getSessionState();
-
-    /**
-     * Moves the session into {@link ImapSessionState#AUTHENTICATED} state.
-     */
-    void authenticated();
-
-    /**
-     * Moves this session into {@link ImapSessionState#SELECTED} state and sets
-     * the supplied mailbox to be the currently selected mailbox.
-     * 
-     * @param mailbox
-     *            The selected mailbox.
-     */
-    void selected(SelectedMailbox mailbox);
-
-    /**
-     * Moves the session out of {@link ImapSessionState#SELECTED} state and back
-     * into {@link ImapSessionState#AUTHENTICATED} state. The selected mailbox
-     * is cleared.
-     */
-    void deselect();
-
-    /**
-     * Provides the selected mailbox for this session, or <code>null</code> if
-     * this session is not in {@link ImapSessionState#SELECTED} state.
-     * 
-     * @return the currently selected mailbox.
-     */
-    SelectedMailbox getSelected();
-
-    /**
-     * Return true if compression is active
-     * 
-     * @return compActive
-     */
-    boolean isCompressionActive();
-
-    /**
-     * Return true if compression is supported. This is related to COMPRESS extension.
-     * See http://www.ietf.org/rfc/rfc4978.txt
-     * 
-     * @return compressSupport
-     */
-    boolean isCompressionSupported();
-
-    /**
-     * Start the compression
-     * 
-     * @return success
-     */
-    boolean startCompression();
-
-    /**
-     * Return true if multiple namespaces are supported
-     * 
-     * @return multipleNamespaces
-     */
-    boolean supportMultipleNamespaces();
-    
-    /**
-     * Return true if the login / authentication via plain username / password is
-     * disallowed
-     * 
-     * @return plainDisallowed
-     */
-    boolean isPlainAuthDisallowed();
-}


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[james-project] 14/36: JAMES-2904 Enhance cassandra authentification integration test

Posted by bt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit d054a8b30059696b8b9636b38f222022a80b7d72
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Wed Oct 16 11:35:52 2019 +0700

    JAMES-2904 Enhance cassandra authentification integration test
---
 .../org/apache/james/CassandraAuthenticationExtension.java    | 11 -----------
 1 file changed, 11 deletions(-)

diff --git a/server/container/guice/cassandra-guice/src/test/java/org/apache/james/CassandraAuthenticationExtension.java b/server/container/guice/cassandra-guice/src/test/java/org/apache/james/CassandraAuthenticationExtension.java
index e0578be..8351bce 100644
--- a/server/container/guice/cassandra-guice/src/test/java/org/apache/james/CassandraAuthenticationExtension.java
+++ b/server/container/guice/cassandra-guice/src/test/java/org/apache/james/CassandraAuthenticationExtension.java
@@ -22,7 +22,6 @@ package org.apache.james;
 import org.apache.james.backends.cassandra.DockerCassandra;
 import org.apache.james.backends.cassandra.init.configuration.ClusterConfiguration;
 import org.apache.james.server.CassandraTruncateTableTask;
-import org.junit.jupiter.api.extension.ExtensionContext;
 
 import com.google.inject.Module;
 import com.google.inject.multibindings.Multibinder;
@@ -60,16 +59,6 @@ public class CassandraAuthenticationExtension implements GuiceModuleTestExtensio
     }
 
     @Override
-    public void beforeAll(ExtensionContext extensionContext) {
-        authenticatedCassandra.start();
-    }
-
-    @Override
-    public void afterAll(ExtensionContext extensionContext) {
-        authenticatedCassandra.stop();
-    }
-
-    @Override
     public Module getModule() {
         return Modules.combine((binder) -> binder.bind(ClusterConfiguration.class)
                 .toInstance(configurationBuilder


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[james-project] 33/36: [REFACTORING] Remove unused class IMAPCommandDispatcher

Posted by bt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit 83b1c51be1b1075344d6cbbab866db97c3d424d2
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Thu Nov 7 12:17:53 2019 +0700

    [REFACTORING] Remove unused class IMAPCommandDispatcher
    
    This is part of the unused package protocols.imap
---
 .../protocols/imap/core/IMAPCommandDispatcher.java | 78 ----------------------
 1 file changed, 78 deletions(-)

diff --git a/protocols/imap/src/main/java/org/apache/james/protocols/imap/core/IMAPCommandDispatcher.java b/protocols/imap/src/main/java/org/apache/james/protocols/imap/core/IMAPCommandDispatcher.java
deleted file mode 100644
index aac46b4..0000000
--- a/protocols/imap/src/main/java/org/apache/james/protocols/imap/core/IMAPCommandDispatcher.java
+++ /dev/null
@@ -1,78 +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.protocols.imap.core;
-
-import java.nio.ByteBuffer;
-import java.util.Collection;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import org.apache.james.protocols.api.ProtocolSession.State;
-import org.apache.james.protocols.api.Request;
-import org.apache.james.protocols.api.Response;
-import org.apache.james.protocols.api.handler.CommandDispatcher;
-import org.apache.james.protocols.api.handler.MultiLineHandler;
-import org.apache.james.protocols.imap.IMAPRequest;
-import org.apache.james.protocols.imap.IMAPSession;
-
-public class IMAPCommandDispatcher extends CommandDispatcher<IMAPSession> {
-
-    private static final Pattern LITERAL_PATTERN = Pattern.compile(".*\\{(\\d+)\\}.*");
-    
-    @Override
-    protected Request parseRequest(IMAPSession session, ByteBuffer buffer) throws Exception {
-        IMAPRequest request = new IMAPRequest(buffer);
-        Matcher matcher = LITERAL_PATTERN.matcher(request.getArgument());
-        if (matcher.matches()) {
-            final long bytesToRead = Long.parseLong(matcher.group(1));
-            MultiLineHandler<IMAPSession> handler = new MultiLineHandler<IMAPSession>() {
-                
-                private static final String BYTES_READ = "BYTES_READ";
-
-                @Override
-                protected boolean isReady(IMAPSession session, ByteBuffer line) {
-                    long bytesRead = (Long) session.setAttachment(BYTES_READ, null, State.Transaction);
-                    bytesRead += line.remaining();
-                    if (bytesRead >= bytesToRead) {
-                        return true;
-                    } else {
-                        session.setAttachment(BYTES_READ, bytesRead, State.Transaction);
-                        return false;
-                    }
-                }
-
-                @Override
-                protected Response onLines(IMAPSession session, Collection<ByteBuffer> lines) {
-                    session.popLineHandler();
-                    return dispatchCommandHandlers(session, new IMAPRequest(lines));
-                }
-            };
-            buffer.rewind();
-            
-            // push the line to the handler
-            handler.onLine(session, buffer);
-            
-            session.pushLineHandler(handler);
-            return null;
-            
-        } else {
-            return request;
-        }
-    }
-}


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[james-project] 03/36: JAMES-2933 Move intellij section first

Posted by bt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit c34ae1bf8c1297dd28a2347f5f0eedf381749b3d
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Tue Oct 29 12:22:08 2019 +0700

    JAMES-2933 Move intellij section first
---
 src/site/xdoc/server/dev-build.xml | 62 ++++++++++++++++++++------------------
 1 file changed, 33 insertions(+), 29 deletions(-)

diff --git a/src/site/xdoc/server/dev-build.xml b/src/site/xdoc/server/dev-build.xml
index bdfdb8e..99b530f 100644
--- a/src/site/xdoc/server/dev-build.xml
+++ b/src/site/xdoc/server/dev-build.xml
@@ -65,7 +65,7 @@
 
     <p>To run the build you need two third-party tools.</p>
     <ol>
-      <li>Java Development Kit - You must have a JDK of Java version 1.11 or higher installed to build the
+      <li>Java Development Kit - You must have a JDK of Java version 11 or higher installed to build the
           James distribution.  The exact JDKs available depend on the platform. A JDK must be downloaded and
           installed before the build can run.</li>
       <li>Maven 3.3.9 - This is a Java-tailored, XML-configured, extensible build or make system. You need maven (3.3.9+) in order
@@ -90,7 +90,7 @@
     </ul>
     </p>
     <p>For example, invoke <code>mvn package</code> to get a zip/tar of James distribution.</p>
-    <p>All built products are output in the <code>server/app/target</code>
+    <p>Spring product is output in the <code>server/app/target</code>
       subdirectory of the James source directory.
       This directory will be deleted if you run build with the clean argument.</p>
     <p><strong>Warning!</strong> Any changes you've made in the 'dist' directory
@@ -101,6 +101,9 @@
 
   <section name="Build James Source from Eclipse">
 
+    <p>Warning: due to bad scala support in eclipse, we are not able to compile James with Eclipse. Contributions to
+    enhance the current situation are more than welcome.</p>
+
     <p>Upon the following documentation, an interesting resource
        <a href="http://blog.bonnydoonmedia.com/post.cfm/walkthrough-tutorials-compiling-apache-james-v3-with-eclipse">
        can be found here</a>
@@ -155,6 +158,34 @@
 
     </subsection>
 
+    <section name="Build James from IntelliJ IDEA">
+
+          <p>This section has been created using IntelliJ IDEA 12 and Maven 3. And downloading the master version of the server
+              from <code>http://git-wip-us.apache.org/repos/asf/james-project.git/</code>.
+          </p>
+
+          <subsection name="Getting the sources from the repository">
+              <p>To download the source code, you can use the Git support that comes with IntelliJ IDEA following the next steps:</p>
+
+              <p>First, in the Welcome page, click on <strong>Check out from Version Control</strong> and select <strong>Git</strong>.</p>
+              <img src="./images/intellij-idea/intellij-new-project.png"/>
+              <p>In the pop-up window, press the <strong>+</strong> button to add the James code repository in the next pop-up.</p>
+              <img src="./images/intellij-idea/intellij-git-repo.png"/>            <br/>
+
+              <p>When this process is done, the project should look like this. <br/></p>
+              <img src="./images/intellij-idea/intellij-james-project.png"/>
+
+          </subsection>
+
+          <subsection name="Building the project">
+              <p> To build the project, you must open the <strong>Maven Projects</strong> panel. Then double click on the install goal to run this goal.<br/></p>
+              <img src="./images/intellij-idea/intellij-mvn.png"/>
+              <p>Then you will find the James server zip in the <strong>server/app/target</strong> folder.<br/></p>
+              <img src="./images/intellij-idea/intellij-james-zip.png"/>
+              <p>Note that tests can be long and can be skept by toggling <i>skip test</i></p>
+          </subsection>
+    </section>
+
     <subsection name="Run James from Eclipse">
 
       <p>That's it. Run or Debug James in Eclipse (right-click on the Main class) and Have Fun!.</p>
@@ -210,33 +241,6 @@
 
   </section>
 
-  <section name="Build James from IntelliJ IDEA">
-
-      <p>This section has been created using IntelliJ IDEA 12 and Maven 3. And downloading the master version of the server
-          from <code>http://git-wip-us.apache.org/repos/asf/james-project.git/</code>.
-      </p>
-
-      <subsection name="Getting the sources from the repository">
-          <p>To download the source code, you can use the Git support that comes with IntelliJ IDEA following the next steps:</p>
-
-          <p>First, in the Welcome page, click on <strong>Check out from Version Control</strong> and select <strong>Git</strong>.</p>
-          <img src="./images/intellij-idea/intellij-new-project.png"/>
-          <p>In the pop-up window, press the <strong>+</strong> button to add the James code repository in the next pop-up.</p>
-          <img src="./images/intellij-idea/intellij-git-repo.png"/>            <br/>
-
-          <p>When this process is done, the project should look like this. <br/></p>
-          <img src="./images/intellij-idea/intellij-james-project.png"/>
-
-      </subsection>
-
-    <subsection name="Building the project">
-        <p> To build the project, you must open the <strong>Maven Projects</strong> panel. Then double click on the install goal to run this goal.<br/></p>
-        <img src="./images/intellij-idea/intellij-mvn.png"/>
-        <p>Then you will find the James server zip in the <strong>app/target</strong> folder.<br/></p>
-        <img src="./images/intellij-idea/intellij-james-zip.png"/>
-    </subsection>
-  </section>
-
 
     <section name="Build James Source from other IDEs">
 


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[james-project] 16/36: PROTOCOLS-37 [Refactoring] Remove unused class FutureStreamResponseImpl

Posted by bt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit afb905ba4eef80f9eec891b11232e3bbc9db5bcd
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Thu Nov 7 08:51:44 2019 +0700

    PROTOCOLS-37 [Refactoring] Remove unused class FutureStreamResponseImpl
---
 .../api/future/FutureStreamResponseImpl.java       | 53 ----------------------
 1 file changed, 53 deletions(-)

diff --git a/protocols/api/src/main/java/org/apache/james/protocols/api/future/FutureStreamResponseImpl.java b/protocols/api/src/main/java/org/apache/james/protocols/api/future/FutureStreamResponseImpl.java
deleted file mode 100644
index 211ecde..0000000
--- a/protocols/api/src/main/java/org/apache/james/protocols/api/future/FutureStreamResponseImpl.java
+++ /dev/null
@@ -1,53 +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.protocols.api.future;
-
-import java.io.InputStream;
-
-import org.apache.james.protocols.api.Response;
-import org.apache.james.protocols.api.StreamResponse;
-
-/**
- * Special {@link FutureResponse} which wraps a {@link StreamResponse} and so provide an async way to get notified about ready responses
- * 
- *
- */
-public class FutureStreamResponseImpl extends FutureResponseImpl implements StreamResponse {
-
-    /**
-     * Set the {@link StreamResponse} to wrap. If a non {@link StreamResponse} is set this implementation will throw an {@link IllegalArgumentException}
-     * 
-     */
-    @Override
-    public void setResponse(Response response) {
-        if (response instanceof StreamResponse) {
-            super.setResponse(response);
-        } else {
-            throw new IllegalArgumentException("Response MUST be of type " + StreamResponse.class.getName());
-        }
-    }
-
-    @Override
-    public InputStream getStream() {
-        checkReady();
-        return ((StreamResponse) response).getStream();
-        
-    }
-}


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[james-project] 25/36: [REFACTORING] Clean protocols-api javadoc

Posted by bt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit bad42893a6ec3e001fa1dda68835e97c4ead0a2a
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Thu Nov 7 11:12:15 2019 +0700

    [REFACTORING] Clean protocols-api javadoc
    
     - Solve IntellijJ warnings related to javaDoc
     - Remove verbose, meaningless entries
---
 .../protocols/api/AbstractProtocolTransport.java   |  2 --
 .../james/protocols/api/AbstractResponse.java      |  4 ----
 .../apache/james/protocols/api/BaseRequest.java    |  1 -
 .../james/protocols/api/CombinedInputStream.java   |  2 --
 .../org/apache/james/protocols/api/Encryption.java |  9 ++------
 .../org/apache/james/protocols/api/Protocol.java   |  9 ++------
 .../james/protocols/api/ProtocolConfiguration.java |  4 ----
 .../protocols/api/ProtocolConfigurationImpl.java   |  2 --
 .../apache/james/protocols/api/ProtocolImpl.java   |  3 +--
 .../apache/james/protocols/api/ProtocolServer.java |  8 +-------
 .../james/protocols/api/ProtocolSession.java       | 17 +--------------
 .../james/protocols/api/ProtocolSessionImpl.java   |  2 --
 .../james/protocols/api/ProtocolTransport.java     | 24 +---------------------
 .../org/apache/james/protocols/api/Request.java    |  6 ------
 .../org/apache/james/protocols/api/Response.java   |  2 --
 .../james/protocols/api/StartTlsResponse.java      |  1 -
 .../apache/james/protocols/api/StreamResponse.java |  4 ----
 .../api/handler/AbstractProtocolHandlerChain.java  |  2 --
 .../protocols/api/handler/CommandDispatcher.java   |  5 -----
 .../api/handler/CommandHandlerResultLogger.java    |  2 --
 .../protocols/api/handler/ConnectHandler.java      |  3 ---
 .../protocols/api/handler/DisconnectHandler.java   |  2 --
 .../protocols/api/handler/ExtensibleHandler.java   |  3 +--
 .../james/protocols/api/handler/LineHandler.java   |  2 +-
 .../protocols/api/handler/MultiLineHandler.java    |  8 +-------
 .../protocols/api/handler/ProtocolHandler.java     |  4 ----
 .../api/handler/ProtocolHandlerChain.java          |  2 --
 .../api/handler/ProtocolHandlerChainImpl.java      |  2 --
 .../api/handler/ProtocolHandlerResultHandler.java  |  8 +-------
 .../api/handler/UnknownCommandHandler.java         |  3 ---
 .../protocols/api/handler/WiringException.java     | 13 ------------
 31 files changed, 12 insertions(+), 147 deletions(-)

diff --git a/protocols/api/src/main/java/org/apache/james/protocols/api/AbstractProtocolTransport.java b/protocols/api/src/main/java/org/apache/james/protocols/api/AbstractProtocolTransport.java
index b578d51..d3f814b 100644
--- a/protocols/api/src/main/java/org/apache/james/protocols/api/AbstractProtocolTransport.java
+++ b/protocols/api/src/main/java/org/apache/james/protocols/api/AbstractProtocolTransport.java
@@ -64,8 +64,6 @@ public abstract class AbstractProtocolTransport implements ProtocolTransport {
 
     /**
      * Take the {@link Response} and encode it to a <code>byte</code> array
-     * 
-     * @param response
      * @return bytes
      */
     protected static byte[] toBytes(Response response) {
diff --git a/protocols/api/src/main/java/org/apache/james/protocols/api/AbstractResponse.java b/protocols/api/src/main/java/org/apache/james/protocols/api/AbstractResponse.java
index 9135d20..921100a 100644
--- a/protocols/api/src/main/java/org/apache/james/protocols/api/AbstractResponse.java
+++ b/protocols/api/src/main/java/org/apache/james/protocols/api/AbstractResponse.java
@@ -24,8 +24,6 @@ import java.util.List;
 
 /**
  * Abstract base implementation of {@link Response}
- * 
- *
  */
 public abstract class AbstractResponse implements Response {
 
@@ -94,8 +92,6 @@ public abstract class AbstractResponse implements Response {
 
     /**
      * Set to true to end the session
-     * 
-     * @param endSession
      */
     public void setEndSession(boolean endSession) {
         this.endSession = endSession;
diff --git a/protocols/api/src/main/java/org/apache/james/protocols/api/BaseRequest.java b/protocols/api/src/main/java/org/apache/james/protocols/api/BaseRequest.java
index 8b1ed75..8f405d6 100644
--- a/protocols/api/src/main/java/org/apache/james/protocols/api/BaseRequest.java
+++ b/protocols/api/src/main/java/org/apache/james/protocols/api/BaseRequest.java
@@ -21,7 +21,6 @@ package org.apache.james.protocols.api;
 
 /**
  * Basic Request which contains a command and argument
- *
  */
 public class BaseRequest implements Request {
 
diff --git a/protocols/api/src/main/java/org/apache/james/protocols/api/CombinedInputStream.java b/protocols/api/src/main/java/org/apache/james/protocols/api/CombinedInputStream.java
index a01f291..d0f4924 100644
--- a/protocols/api/src/main/java/org/apache/james/protocols/api/CombinedInputStream.java
+++ b/protocols/api/src/main/java/org/apache/james/protocols/api/CombinedInputStream.java
@@ -28,8 +28,6 @@ import java.util.NoSuchElementException;
  * {@link SequenceInputStream} sub-class which allows direct access to the pair of {@link InputStream}'s.
  * 
  * When ever you need to "combine" two {@link InputStream}'s you should use this class as it may allow the Transport to optimize the transfer of it!
- * 
- *
  */
 public class CombinedInputStream extends SequenceInputStream implements Iterable<InputStream> {
 
diff --git a/protocols/api/src/main/java/org/apache/james/protocols/api/Encryption.java b/protocols/api/src/main/java/org/apache/james/protocols/api/Encryption.java
index 0955670..8b0ed11 100644
--- a/protocols/api/src/main/java/org/apache/james/protocols/api/Encryption.java
+++ b/protocols/api/src/main/java/org/apache/james/protocols/api/Encryption.java
@@ -23,7 +23,6 @@ import javax.net.ssl.SSLContext;
 
 /**
  * This class should be used to setup encrypted protocol handling
- * 
  */
 public final class Encryption {
 
@@ -44,11 +43,9 @@ public final class Encryption {
     /**
      * Create a new {@link Encryption} which is TLS based and only allows the
      * given Ciphersuites
-     * 
-     * @param context
+     *
      * @param enabledCipherSuites
      *            or <code>null</code> if all Ciphersuites should be allowed
-     * @return enc
      */
     public static Encryption createTls(SSLContext context, String[] enabledCipherSuites) {
         return new Encryption(context, false, enabledCipherSuites);
@@ -61,11 +58,9 @@ public final class Encryption {
     /**
      * Create a new {@link Encryption} which uses STARTTLS and only allows the
      * given Ciphersuites
-     * 
-     * @param context
+     *
      * @param enabledCipherSuites
      *            or <code>null</code> if all Ciphersuites should be allowed
-     * @return enc
      */
     public static Encryption createStartTls(SSLContext context, String[] enabledCipherSuites) {
         return new Encryption(context, true, enabledCipherSuites);
diff --git a/protocols/api/src/main/java/org/apache/james/protocols/api/Protocol.java b/protocols/api/src/main/java/org/apache/james/protocols/api/Protocol.java
index f4b74f3..e791284 100644
--- a/protocols/api/src/main/java/org/apache/james/protocols/api/Protocol.java
+++ b/protocols/api/src/main/java/org/apache/james/protocols/api/Protocol.java
@@ -34,18 +34,13 @@ public interface Protocol {
     ProtocolHandlerChain getProtocolChain();
 
     /**
-     * Return the {@link ProtocolConfiguration} 
-     * 
-     * @return config
+     * Return the {@link ProtocolConfiguration}
      */
     ProtocolConfiguration getConfiguration();
     
     
     /**
-     * Create a new {@link ProtocolSession} for the given {@link ProtocolTransport} 
-     * 
-     * @param transport
-     * @return session
+     * Create a new {@link ProtocolSession} for the given {@link ProtocolTransport}
      */
     ProtocolSession newSession(ProtocolTransport transport);
 
diff --git a/protocols/api/src/main/java/org/apache/james/protocols/api/ProtocolConfiguration.java b/protocols/api/src/main/java/org/apache/james/protocols/api/ProtocolConfiguration.java
index 42217b9..e982ee8 100644
--- a/protocols/api/src/main/java/org/apache/james/protocols/api/ProtocolConfiguration.java
+++ b/protocols/api/src/main/java/org/apache/james/protocols/api/ProtocolConfiguration.java
@@ -21,12 +21,8 @@ package org.apache.james.protocols.api;
 
 /**
  * Configuration which is used in scope of a Protocol
- * 
- *
  */
 public interface ProtocolConfiguration {
-
-    
     /**
      * Return the Greeting which should used.
      * 
diff --git a/protocols/api/src/main/java/org/apache/james/protocols/api/ProtocolConfigurationImpl.java b/protocols/api/src/main/java/org/apache/james/protocols/api/ProtocolConfigurationImpl.java
index 9cbf4cb..5482920 100644
--- a/protocols/api/src/main/java/org/apache/james/protocols/api/ProtocolConfigurationImpl.java
+++ b/protocols/api/src/main/java/org/apache/james/protocols/api/ProtocolConfigurationImpl.java
@@ -27,8 +27,6 @@ import java.net.UnknownHostException;
  * Default implementation of a {@link ProtocolConfiguration} which allows to easily set the different configurations. 
  * 
  * Be aware that set and get operations are not thread-safe
- * 
- *
  */
 public class ProtocolConfigurationImpl implements ProtocolConfiguration {
     
diff --git a/protocols/api/src/main/java/org/apache/james/protocols/api/ProtocolImpl.java b/protocols/api/src/main/java/org/apache/james/protocols/api/ProtocolImpl.java
index 962019e..e7a743a 100644
--- a/protocols/api/src/main/java/org/apache/james/protocols/api/ProtocolImpl.java
+++ b/protocols/api/src/main/java/org/apache/james/protocols/api/ProtocolImpl.java
@@ -22,8 +22,7 @@ package org.apache.james.protocols.api;
 import org.apache.james.protocols.api.handler.ProtocolHandlerChain;
 
 /**
- * Basic {@link Protocol} implementation 
- *
+ * Basic {@link Protocol} implementation
  */
 public abstract class ProtocolImpl implements Protocol {
     private final ProtocolHandlerChain chain;
diff --git a/protocols/api/src/main/java/org/apache/james/protocols/api/ProtocolServer.java b/protocols/api/src/main/java/org/apache/james/protocols/api/ProtocolServer.java
index edf47ef..f48c51a 100644
--- a/protocols/api/src/main/java/org/apache/james/protocols/api/ProtocolServer.java
+++ b/protocols/api/src/main/java/org/apache/james/protocols/api/ProtocolServer.java
@@ -23,15 +23,11 @@ import java.util.List;
 
 /**
  * A {@link ProtocolServer} accept inbound traffic and handle it. Basically the protocols API can be used to handle every "line based" protocol in an easy fashion
- *
  */
 public interface ProtocolServer {
 
     /**
      * Start the server
-     * 
-     * @throws Exception 
-     * 
      */
     void bind() throws Exception;
     
@@ -41,9 +37,7 @@ public interface ProtocolServer {
     void unbind();
     
     /**
-     * return true if the server is bound 
-     * 
-     * @return bound
+     * return true if the server is bound
      */
     boolean isBound();
 
diff --git a/protocols/api/src/main/java/org/apache/james/protocols/api/ProtocolSession.java b/protocols/api/src/main/java/org/apache/james/protocols/api/ProtocolSession.java
index bc48249..fbcb830 100644
--- a/protocols/api/src/main/java/org/apache/james/protocols/api/ProtocolSession.java
+++ b/protocols/api/src/main/java/org/apache/james/protocols/api/ProtocolSession.java
@@ -27,8 +27,6 @@ import org.apache.james.protocols.api.handler.LineHandler;
 
 /**
  * Session for a protocol. Every new connection generates a new session
- * 
- *
  */
 public interface ProtocolSession {
    
@@ -85,22 +83,16 @@ public interface ProtocolSession {
     
     /**
      * Return the {@link InetSocketAddress} of the remote peer
-     * 
-     * @return address
      */
     InetSocketAddress getRemoteAddress();
 
     /**
      * Return the {@link InetSocketAddress} of the local bound address
-     * 
-     * @return local
      */
     InetSocketAddress getLocalAddress();
     
     /**
      * Return the ID for the session
-     * 
-     * @return id
      */
     String getSessionID();
 
@@ -142,22 +134,16 @@ public interface ProtocolSession {
     
     /**
      * Return true if the starttls was started
-     * 
-     * @return true
      */
     boolean isTLSStarted();
     
     /**
-     * Return the {@link ProtocolConfiguration} 
-     * 
-     * @return config
+     * Return the {@link ProtocolConfiguration}
      */
     ProtocolConfiguration getConfiguration();
     
     /**
      * Return the {@link Charset} which is used by the {@link ProtocolSession}
-     * 
-     * @return charset
      */
     Charset getCharset();
     
@@ -170,7 +156,6 @@ public interface ProtocolSession {
     
     /**
      * Put a new line handler in the chain
-     * @param overrideCommandHandler
      */
     <T extends ProtocolSession> void pushLineHandler(LineHandler<T> overrideCommandHandler);
     
diff --git a/protocols/api/src/main/java/org/apache/james/protocols/api/ProtocolSessionImpl.java b/protocols/api/src/main/java/org/apache/james/protocols/api/ProtocolSessionImpl.java
index 5aec3ee..8f32966 100644
--- a/protocols/api/src/main/java/org/apache/james/protocols/api/ProtocolSessionImpl.java
+++ b/protocols/api/src/main/java/org/apache/james/protocols/api/ProtocolSessionImpl.java
@@ -69,8 +69,6 @@ public class ProtocolSessionImpl implements ProtocolSession {
 
     /**
      * Return the wrapped {@link ProtocolTransport} which is used for this {@link ProtocolSession}
-     * 
-     * @return transport
      */
     public ProtocolTransport getProtocolTransport() {
         return transport;
diff --git a/protocols/api/src/main/java/org/apache/james/protocols/api/ProtocolTransport.java b/protocols/api/src/main/java/org/apache/james/protocols/api/ProtocolTransport.java
index d65ccb2..add23e8 100644
--- a/protocols/api/src/main/java/org/apache/james/protocols/api/ProtocolTransport.java
+++ b/protocols/api/src/main/java/org/apache/james/protocols/api/ProtocolTransport.java
@@ -33,15 +33,11 @@ public interface ProtocolTransport {
 
     /**
      * Return the {@link InetSocketAddress} of the remote peer
-     * 
-     * @return address
      */
     InetSocketAddress getRemoteAddress();
 
     /**
      * Return the {@link InetSocketAddress} of the local bound address
-     * 
-     * @return local
      */
     InetSocketAddress getLocalAddress();
 
@@ -49,31 +45,22 @@ public interface ProtocolTransport {
     /**
      * Return the unique id. The id MUST NOT be 100 % unique for ever. It just should just not have the same
      * id when having concurrent connections
-     * 
-     * @return id
      */
     String getId();
 
     /**
      * Return <code>true</code> if <code>TLS</code> encryption is active
-     * 
-     * @return tlsStarted
      */
     boolean isTLSStarted();
 
     /**
      * Return <code>true</code> if <code>STARTTLS</code> is supported by this {@link ProtocolTransport}
-     * 
-     * @return tlsSupprted
      */
     boolean isStartTLSSupported();
     
     /**
      * Write the {@link Response} to the {@link ProtocolTransport} which will forward it to the connected
      * peer
-     * 
-     * @param response
-     * @param session
      */
     void writeResponse(Response response, ProtocolSession session);
 
@@ -84,31 +71,22 @@ public interface ProtocolTransport {
 
     /**
      * Push a {@link LineHandler} in.
-     * 
-     * @param overrideCommandHandler
-     * @param session
      */
     void pushLineHandler(LineHandler<? extends ProtocolSession> overrideCommandHandler, ProtocolSession session);
 
     /**
      * Return the count of pushed {@link LineHandler}'s
-     * 
-     * @return lineCount
      */
     int getPushedLineHandlerCount();
     
     
     /**
-     * Set the {@link ProtocolTransport} readable or not. If its not readable then no new lines should get processed 
-     * 
-     * @param readable
+     * Set the {@link ProtocolTransport} readable or not. If its not readable then no new lines should get processed
      */
     void setReadable(boolean readable);
 
     /**
      * Return <code>true</code> if the channel is readable
-     * 
-     * @return
      */
     boolean isReadable();
 }
diff --git a/protocols/api/src/main/java/org/apache/james/protocols/api/Request.java b/protocols/api/src/main/java/org/apache/james/protocols/api/Request.java
index 81747fe..01573b6 100644
--- a/protocols/api/src/main/java/org/apache/james/protocols/api/Request.java
+++ b/protocols/api/src/main/java/org/apache/james/protocols/api/Request.java
@@ -21,23 +21,17 @@ package org.apache.james.protocols.api;
 
 /**
  * Request received from the client
- * 
- *
  */
 public interface Request {
 
     
     /**
      * Return the current argument. If there is no argument null is returned
-     * 
-     * @return argument
      */
     String getArgument();
 
     /**
      * Return the current command
-     * 
-     * @return command
      */
     String getCommand();
 }
diff --git a/protocols/api/src/main/java/org/apache/james/protocols/api/Response.java b/protocols/api/src/main/java/org/apache/james/protocols/api/Response.java
index d5f5586..7c25bef 100644
--- a/protocols/api/src/main/java/org/apache/james/protocols/api/Response.java
+++ b/protocols/api/src/main/java/org/apache/james/protocols/api/Response.java
@@ -24,8 +24,6 @@ import java.util.List;
 
 /**
  * Protocol response to send to the client
- * 
- *
  */
 public interface Response {
     
diff --git a/protocols/api/src/main/java/org/apache/james/protocols/api/StartTlsResponse.java b/protocols/api/src/main/java/org/apache/james/protocols/api/StartTlsResponse.java
index f36fda6..eca0f00 100644
--- a/protocols/api/src/main/java/org/apache/james/protocols/api/StartTlsResponse.java
+++ b/protocols/api/src/main/java/org/apache/james/protocols/api/StartTlsResponse.java
@@ -23,7 +23,6 @@ package org.apache.james.protocols.api;
  * An special sub-type of {@link Response} which makes it possible to detect a response to a STARTTLS request.
  * 
  * After writing this response its a MUST to enable STARTTLS before further processing
- *
  */
 public interface StartTlsResponse extends Response {
 
diff --git a/protocols/api/src/main/java/org/apache/james/protocols/api/StreamResponse.java b/protocols/api/src/main/java/org/apache/james/protocols/api/StreamResponse.java
index 2b621c0..de94944 100644
--- a/protocols/api/src/main/java/org/apache/james/protocols/api/StreamResponse.java
+++ b/protocols/api/src/main/java/org/apache/james/protocols/api/StreamResponse.java
@@ -23,16 +23,12 @@ import java.io.InputStream;
 
 /**
  * Special {@link Response} sub-type which allows to write an {@link InputStream} to the remote peer
- * 
- *
  */
 public interface StreamResponse extends Response {
 
     /**
      * Return the stream which needs to get written to the remote peer. This method should only be called one time (when the data is written to the client) as it returns
      * the same {@link InputStream} on every call. So once it is consumed there is no way to re-process it.
-     * 
-     * @return stream
      */
     InputStream getStream();
 
diff --git a/protocols/api/src/main/java/org/apache/james/protocols/api/handler/AbstractProtocolHandlerChain.java b/protocols/api/src/main/java/org/apache/james/protocols/api/handler/AbstractProtocolHandlerChain.java
index 0b1803f..3abc754 100644
--- a/protocols/api/src/main/java/org/apache/james/protocols/api/handler/AbstractProtocolHandlerChain.java
+++ b/protocols/api/src/main/java/org/apache/james/protocols/api/handler/AbstractProtocolHandlerChain.java
@@ -50,8 +50,6 @@ public abstract class AbstractProtocolHandlerChain implements ProtocolHandlerCha
     /**
      * ExtensibleHandler wiring. This should get called after the class was constructed
      * and every stuff was set
-     * 
-     * @throws WiringException 
      */
     public void wireExtensibleHandlers() throws WiringException {
         List<ProtocolHandler> handlers = getHandlers();
diff --git a/protocols/api/src/main/java/org/apache/james/protocols/api/handler/CommandDispatcher.java b/protocols/api/src/main/java/org/apache/james/protocols/api/handler/CommandDispatcher.java
index 90bd4a0..bd03ee4 100644
--- a/protocols/api/src/main/java/org/apache/james/protocols/api/handler/CommandDispatcher.java
+++ b/protocols/api/src/main/java/org/apache/james/protocols/api/handler/CommandDispatcher.java
@@ -150,9 +150,6 @@ public class CommandDispatcher<SessionT extends ProtocolSession> implements Exte
     /**
      * Dispatch the {@link CommandHandler}'s for the given {@link Request} and return a {@link Response} or <code>null</code> if non should get written
      * back to the client
-     * 
-     * @param session
-     * @param request
      * @return response
      */
     protected Response dispatchCommandHandlers(SessionT session, Request request) {
@@ -191,8 +188,6 @@ public class CommandDispatcher<SessionT extends ProtocolSession> implements Exte
     
     /**
      * Parse the line into a {@link Request}
-     *
-     * @throws Exception
      */
     protected Request parseRequest(SessionT session, ByteBuffer buffer) throws Exception {
         String curCommandName;
diff --git a/protocols/api/src/main/java/org/apache/james/protocols/api/handler/CommandHandlerResultLogger.java b/protocols/api/src/main/java/org/apache/james/protocols/api/handler/CommandHandlerResultLogger.java
index 06cdac4..dd33bc9 100644
--- a/protocols/api/src/main/java/org/apache/james/protocols/api/handler/CommandHandlerResultLogger.java
+++ b/protocols/api/src/main/java/org/apache/james/protocols/api/handler/CommandHandlerResultLogger.java
@@ -24,9 +24,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * 
  * {@link ProtocolHandlerResultHandler} which logs the {@link Response} of {@link CommandHandler}'s.
- *
  */
 public class CommandHandlerResultLogger implements ProtocolHandlerResultHandler<Response, ProtocolSession> {
 
diff --git a/protocols/api/src/main/java/org/apache/james/protocols/api/handler/ConnectHandler.java b/protocols/api/src/main/java/org/apache/james/protocols/api/handler/ConnectHandler.java
index e310d71..0ee6767 100644
--- a/protocols/api/src/main/java/org/apache/james/protocols/api/handler/ConnectHandler.java
+++ b/protocols/api/src/main/java/org/apache/james/protocols/api/handler/ConnectHandler.java
@@ -33,10 +33,7 @@ import org.apache.james.protocols.api.Response;
 public interface ConnectHandler<SessionT extends ProtocolSession> extends ProtocolHandler {
     /**
      * Handle connection and disconnect if true is returned
-     * 
-     * @param session
      * @return response or null
-     * 
     **/
     Response onConnect(SessionT session);
 
diff --git a/protocols/api/src/main/java/org/apache/james/protocols/api/handler/DisconnectHandler.java b/protocols/api/src/main/java/org/apache/james/protocols/api/handler/DisconnectHandler.java
index 4690b81..2efd235 100644
--- a/protocols/api/src/main/java/org/apache/james/protocols/api/handler/DisconnectHandler.java
+++ b/protocols/api/src/main/java/org/apache/james/protocols/api/handler/DisconnectHandler.java
@@ -33,8 +33,6 @@ public interface DisconnectHandler<S extends ProtocolSession> extends ProtocolHa
     
     /**
      * Get called on disconnect
-     *
-     * @param session
     **/
     void onDisconnect(S session);
 
diff --git a/protocols/api/src/main/java/org/apache/james/protocols/api/handler/ExtensibleHandler.java b/protocols/api/src/main/java/org/apache/james/protocols/api/handler/ExtensibleHandler.java
index 238f75b..866254e 100644
--- a/protocols/api/src/main/java/org/apache/james/protocols/api/handler/ExtensibleHandler.java
+++ b/protocols/api/src/main/java/org/apache/james/protocols/api/handler/ExtensibleHandler.java
@@ -39,8 +39,7 @@ public interface ExtensibleHandler {
     /**
      * Method called during initialization after all the handlers have been declared
      * in the ProtocolHandlerChain.
-     * 
-     * @param interfaceName
+     *
      * @param extension a list of objects implementing the marker interface
      */
     void wireExtensions(Class<?> interfaceName, List<?> extension) throws WiringException;
diff --git a/protocols/api/src/main/java/org/apache/james/protocols/api/handler/LineHandler.java b/protocols/api/src/main/java/org/apache/james/protocols/api/handler/LineHandler.java
index 5449271..f140f2b 100644
--- a/protocols/api/src/main/java/org/apache/james/protocols/api/handler/LineHandler.java
+++ b/protocols/api/src/main/java/org/apache/james/protocols/api/handler/LineHandler.java
@@ -35,7 +35,7 @@ public interface LineHandler<SessionT extends ProtocolSession> extends ProtocolH
      * Processing the give line. The line includes the {@link ProtocolSession#getLineDelimiter()} delimiter.
      * 
      * @param session not null
-     * @param line not null 
+     * @param buffer not null
      * @return response or null
      */
     Response onLine(SessionT session, ByteBuffer buffer);
diff --git a/protocols/api/src/main/java/org/apache/james/protocols/api/handler/MultiLineHandler.java b/protocols/api/src/main/java/org/apache/james/protocols/api/handler/MultiLineHandler.java
index 6266878..5590df3 100644
--- a/protocols/api/src/main/java/org/apache/james/protocols/api/handler/MultiLineHandler.java
+++ b/protocols/api/src/main/java/org/apache/james/protocols/api/handler/MultiLineHandler.java
@@ -55,18 +55,12 @@ public abstract class MultiLineHandler<S extends ProtocolSession> implements Lin
 
     /**
      * Return <code>true</code> if the buffered lines are ready to get pushed to the {@link #onLines(ProtocolSession, Collection)} method
-     * 
-     * @param session
-     * @param line
-     * @return ready
      */
     protected abstract boolean isReady(S session, ByteBuffer line);
     
     /**
      * Handle the buffered lines
-     * 
-     * @param session
-     * @param lines
+     *
      * @return response
      */
     protected abstract Response onLines(S session, Collection<ByteBuffer> lines);
diff --git a/protocols/api/src/main/java/org/apache/james/protocols/api/handler/ProtocolHandler.java b/protocols/api/src/main/java/org/apache/james/protocols/api/handler/ProtocolHandler.java
index 02e85cd..8914329 100644
--- a/protocols/api/src/main/java/org/apache/james/protocols/api/handler/ProtocolHandler.java
+++ b/protocols/api/src/main/java/org/apache/james/protocols/api/handler/ProtocolHandler.java
@@ -26,15 +26,11 @@ import org.apache.commons.configuration2.ex.ConfigurationException;
  * Just the base interface for all kind of "protocol" handlers.
  * 
  * Every of them should implement this interface
- * 
  */
 public interface ProtocolHandler {
 
     /**
      * Init with the given {@link Configuration}
-     *
-     * @param config
-     * @throws ConfigurationException
      */
     default void init(Configuration config) throws ConfigurationException {
 
diff --git a/protocols/api/src/main/java/org/apache/james/protocols/api/handler/ProtocolHandlerChain.java b/protocols/api/src/main/java/org/apache/james/protocols/api/handler/ProtocolHandlerChain.java
index 5e23bd7..1edbeee 100644
--- a/protocols/api/src/main/java/org/apache/james/protocols/api/handler/ProtocolHandlerChain.java
+++ b/protocols/api/src/main/java/org/apache/james/protocols/api/handler/ProtocolHandlerChain.java
@@ -25,13 +25,11 @@ import java.util.LinkedList;
 
 /**
  * Chain which can be used to get all Handlers for a given Class.
- *
  */
 public interface ProtocolHandlerChain {
 
     /**
      * Returns a list of handler of the requested type.
-     * @param <T>
      * 
      * @param type the type of handler we're interested in
      * @return a List of handlers
diff --git a/protocols/api/src/main/java/org/apache/james/protocols/api/handler/ProtocolHandlerChainImpl.java b/protocols/api/src/main/java/org/apache/james/protocols/api/handler/ProtocolHandlerChainImpl.java
index 6fe802a..3303ed2 100644
--- a/protocols/api/src/main/java/org/apache/james/protocols/api/handler/ProtocolHandlerChainImpl.java
+++ b/protocols/api/src/main/java/org/apache/james/protocols/api/handler/ProtocolHandlerChainImpl.java
@@ -32,8 +32,6 @@ import com.google.common.collect.ImmutableList;
  * {@link #wireExtensibleHandlers()} is called. After that all operations which
  * try to modify the instance will throw and
  * {@link UnsupportedOperationException}
- * 
- * 
  */
 public class ProtocolHandlerChainImpl extends AbstractProtocolHandlerChain implements List<ProtocolHandler> {
 
diff --git a/protocols/api/src/main/java/org/apache/james/protocols/api/handler/ProtocolHandlerResultHandler.java b/protocols/api/src/main/java/org/apache/james/protocols/api/handler/ProtocolHandlerResultHandler.java
index 4b46de9..d60f44f 100644
--- a/protocols/api/src/main/java/org/apache/james/protocols/api/handler/ProtocolHandlerResultHandler.java
+++ b/protocols/api/src/main/java/org/apache/james/protocols/api/handler/ProtocolHandlerResultHandler.java
@@ -26,18 +26,12 @@ import org.apache.james.protocols.api.Response;
  * An special {@link ProtocolHandler} which allows to <strong>intercept</code> returned {@link Response}'s and act on them.
  * 
  * This could be to gather statistics or even replace them.
- *
- * @param <R>
- * @param <S>
  */
 public interface ProtocolHandlerResultHandler<R extends Response, S extends ProtocolSession> extends ProtocolHandler {
 
     /**
      * Get called when a {@link Response} was returned from the {@link ProtocolHandler}
-     * 
-     * @param session
-     * @param response
-     * @param handler
+     *
      * @return response
      */
     Response onResponse(ProtocolSession session, R response, long executionTime, ProtocolHandler handler);
diff --git a/protocols/api/src/main/java/org/apache/james/protocols/api/handler/UnknownCommandHandler.java b/protocols/api/src/main/java/org/apache/james/protocols/api/handler/UnknownCommandHandler.java
index 4923d54..c719527 100644
--- a/protocols/api/src/main/java/org/apache/james/protocols/api/handler/UnknownCommandHandler.java
+++ b/protocols/api/src/main/java/org/apache/james/protocols/api/handler/UnknownCommandHandler.java
@@ -27,9 +27,6 @@ import com.google.common.collect.ImmutableSet;
 /**
  * A special {@link CommandHandler} implementation which should be extended by {@link CommandHandler}'s which should get called for unknown command. So this is some kind
  * of a <strong>fallback</strong> {@link CommandHandler} which will get executed if no other matching {@link CommandHandler} could be found for a given command.
- * 
- *
- * @param <S>
  */
 public abstract class UnknownCommandHandler<S extends ProtocolSession> implements CommandHandler<S> {
 
diff --git a/protocols/api/src/main/java/org/apache/james/protocols/api/handler/WiringException.java b/protocols/api/src/main/java/org/apache/james/protocols/api/handler/WiringException.java
index 7dd4d20..9e54ceb 100644
--- a/protocols/api/src/main/java/org/apache/james/protocols/api/handler/WiringException.java
+++ b/protocols/api/src/main/java/org/apache/james/protocols/api/handler/WiringException.java
@@ -25,31 +25,18 @@ public class WiringException extends Exception {
 
     private static final long serialVersionUID = 8824880646965171467L;
 
-    /**
-     * Empty constructor
-     */
     public WiringException() {
         super();
     }
 
-    /**
-     * @param message
-     * @param t
-     */
     public WiringException(String message, Throwable t) {
         super(message, t);
     }
 
-    /**
-     * @param message
-     */
     public WiringException(String message) {
         super(message);
     }
 
-    /**
-     * @param t
-     */
     public WiringException(Throwable t) {
         super(t);
     }


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[james-project] 17/36: PROTOCOLS-37 [Refactoring] Remove unused class FutureStartTlsResponse

Posted by bt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit db236b2234d6c75e84ed84b97e9d1186a8979d6b
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Thu Nov 7 08:52:03 2019 +0700

    PROTOCOLS-37 [Refactoring] Remove unused class FutureStartTlsResponse
---
 .../api/future/FutureStartTlsResponse.java         | 46 ----------------------
 1 file changed, 46 deletions(-)

diff --git a/protocols/api/src/main/java/org/apache/james/protocols/api/future/FutureStartTlsResponse.java b/protocols/api/src/main/java/org/apache/james/protocols/api/future/FutureStartTlsResponse.java
deleted file mode 100644
index d852871..0000000
--- a/protocols/api/src/main/java/org/apache/james/protocols/api/future/FutureStartTlsResponse.java
+++ /dev/null
@@ -1,46 +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.protocols.api.future;
-
-import org.apache.james.protocols.api.Response;
-import org.apache.james.protocols.api.StartTlsResponse;
-
-/**
- * Special {@link FutureResponse} which will get notified once a {@link StartTlsResponse} is ready
- * 
- *
- */
-public class FutureStartTlsResponse extends FutureResponseImpl implements StartTlsResponse {
-
-
-    /**
-     * Set the {@link StartTlsResponse} to wrap. If a non {@link StartTlsResponse} is set this implementation will throw an {@link IllegalArgumentException}
-     * 
-     */
-    @Override
-    public void setResponse(Response response) {
-        if (response instanceof StartTlsResponse) {
-            super.setResponse(response);
-        } else {
-            throw new IllegalArgumentException("Response MUST be of type " + StartTlsResponse.class.getName());
-        }
-    }
-
-}


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[james-project] 05/36: JAMES-2933 Update intelliJ version used

Posted by bt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit 084636c77d24d4da7b5bb154ea0de11aaed2a8e4
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Fri Nov 1 11:17:14 2019 +0700

    JAMES-2933 Update intelliJ version used
---
 src/site/xdoc/server/dev-build.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/site/xdoc/server/dev-build.xml b/src/site/xdoc/server/dev-build.xml
index aa630bb..a4aa408 100644
--- a/src/site/xdoc/server/dev-build.xml
+++ b/src/site/xdoc/server/dev-build.xml
@@ -160,7 +160,7 @@
 
     <section name="Build James from IntelliJ IDEA">
 
-          <p>This section has been created using IntelliJ IDEA 12 and Maven 3. And downloading the master version of the server
+          <p>This section has been created using IntelliJ IDEA 2019.2.1 and Maven 3. And downloading the master version of the server
               from <code>http://git-wip-us.apache.org/repos/asf/james-project.git/</code>.
           </p>
 


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[james-project] 09/36: JAMES-2904 ClusterWithKeyspaceCreatedFactory should rely on ClusterConfiguration

Posted by bt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit 9d366040c122a602707f912181613184bebea43a
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Wed Oct 2 11:32:15 2019 +0700

    JAMES-2904 ClusterWithKeyspaceCreatedFactory should rely on ClusterConfiguration
---
 .../init/ClusterWithKeyspaceCreatedFactory.java    | 47 +++-------------------
 .../cassandra/init/ResilientClusterProvider.java   |  6 +--
 .../init/configuration/ClusterConfiguration.java   | 20 ++++++++-
 .../james/backends/cassandra/CassandraCluster.java | 21 ++++------
 .../SessionWithInitializedTablesFactoryTest.java   | 22 +++++-----
 5 files changed, 45 insertions(+), 71 deletions(-)

diff --git a/backends-common/cassandra/src/main/java/org/apache/james/backends/cassandra/init/ClusterWithKeyspaceCreatedFactory.java b/backends-common/cassandra/src/main/java/org/apache/james/backends/cassandra/init/ClusterWithKeyspaceCreatedFactory.java
index 4ff38ba..a93ca15 100644
--- a/backends-common/cassandra/src/main/java/org/apache/james/backends/cassandra/init/ClusterWithKeyspaceCreatedFactory.java
+++ b/backends-common/cassandra/src/main/java/org/apache/james/backends/cassandra/init/ClusterWithKeyspaceCreatedFactory.java
@@ -19,53 +19,18 @@
 
 package org.apache.james.backends.cassandra.init;
 
+import org.apache.james.backends.cassandra.init.configuration.ClusterConfiguration;
+
 import com.datastax.driver.core.Cluster;
 import com.datastax.driver.core.Session;
 
 public class ClusterWithKeyspaceCreatedFactory {
-
-    private static final int DEFAULT_REPLICATION_FACTOR = 1;
-    
-    public static Configuration config(Cluster cluster, String keyspace) {
-        return new Configuration(cluster, keyspace);
-    }
-    
-    public static class Configuration {
-        private Cluster cluster;
-        private String keyspace;
-        private boolean durableWrites;
-        private int replicationFactor;
-        
-        private Configuration(Cluster cluster, String keyspace) {
-            this.cluster = cluster;
-            this.keyspace = keyspace;
-            this.durableWrites = true;
-            this.replicationFactor = DEFAULT_REPLICATION_FACTOR;
-        }
-        
-        public Configuration disableDurableWrites() {
-            this.durableWrites = false;
-            return this;
-        }
-        
-        public Configuration replicationFactor(int replicationFactor) {
-            this.replicationFactor = replicationFactor;
-            return this;
-        }
-        
-        public Cluster clusterWithInitializedKeyspace() {
-            createKeyspace(cluster, keyspace, replicationFactor, durableWrites);
-            return cluster;
-        }
-    }
-
-    private static void createKeyspace(Cluster cluster, String keyspace, int replicationFactor, boolean durableWrites) {
+    public static void createKeyspace(Cluster cluster, ClusterConfiguration clusterConfiguration) {
         try (Session session = cluster.connect()) {
-            session.execute("CREATE KEYSPACE IF NOT EXISTS " + keyspace
-                + " WITH replication = {'class':'SimpleStrategy', 'replication_factor':" + replicationFactor + "}"
-                + " AND durable_writes = " + String.valueOf(durableWrites)
+            session.execute("CREATE KEYSPACE IF NOT EXISTS " + clusterConfiguration.getKeyspace()
+                + " WITH replication = {'class':'SimpleStrategy', 'replication_factor':" + clusterConfiguration.getReplicationFactor() + "}"
+                + " AND durable_writes = " + clusterConfiguration.isDurableWrites()
                 + ";");
         }
     }
-
 }
diff --git a/backends-common/cassandra/src/main/java/org/apache/james/backends/cassandra/init/ResilientClusterProvider.java b/backends-common/cassandra/src/main/java/org/apache/james/backends/cassandra/init/ResilientClusterProvider.java
index 150152b..523a925 100644
--- a/backends-common/cassandra/src/main/java/org/apache/james/backends/cassandra/init/ResilientClusterProvider.java
+++ b/backends-common/cassandra/src/main/java/org/apache/james/backends/cassandra/init/ResilientClusterProvider.java
@@ -71,10 +71,8 @@ public class ResilientClusterProvider implements Provider<Cluster> {
                     .connectTimeoutMillis(configuration.getConnectTimeoutMillis())
                     .build();
             try {
-                return ClusterWithKeyspaceCreatedFactory
-                    .config(cluster, configuration.getKeyspace())
-                    .replicationFactor(configuration.getReplicationFactor())
-                    .clusterWithInitializedKeyspace();
+                ClusterWithKeyspaceCreatedFactory.createKeyspace(cluster, configuration);
+                return cluster;
             } catch (Exception e) {
                 cluster.close();
                 throw e;
diff --git a/backends-common/cassandra/src/main/java/org/apache/james/backends/cassandra/init/configuration/ClusterConfiguration.java b/backends-common/cassandra/src/main/java/org/apache/james/backends/cassandra/init/configuration/ClusterConfiguration.java
index 0173373..68958f4 100644
--- a/backends-common/cassandra/src/main/java/org/apache/james/backends/cassandra/init/configuration/ClusterConfiguration.java
+++ b/backends-common/cassandra/src/main/java/org/apache/james/backends/cassandra/init/configuration/ClusterConfiguration.java
@@ -47,6 +47,7 @@ public class ClusterConfiguration {
         private Optional<Integer> readTimeoutMillis;
         private Optional<Integer> connectTimeoutMillis;
         private Optional<Boolean> useSsl;
+        private Optional<Boolean> durableWrites;
         private Optional<String> username;
         private Optional<String> password;
 
@@ -63,6 +64,7 @@ public class ClusterConfiguration {
             username = Optional.empty();
             password = Optional.empty();
             useSsl = Optional.empty();
+            durableWrites = Optional.empty();
         }
 
         public Builder host(Host host) {
@@ -175,6 +177,12 @@ public class ClusterConfiguration {
             return connectTimeoutMillis(Optional.of(connectTimeoutMillis));
         }
 
+        public Builder disableDurableWrites() {
+            this.durableWrites = Optional.of(false);
+
+            return this;
+        }
+
         public ClusterConfiguration build() {
             return new ClusterConfiguration(
                 hosts.build(),
@@ -188,7 +196,8 @@ public class ClusterConfiguration {
                 connectTimeoutMillis.orElse(DEFAULT_CONNECT_TIMEOUT_MILLIS),
                 useSsl.orElse(false),
                 username,
-                password);
+                password,
+                durableWrites.orElse(true));
         }
     }
 
@@ -283,10 +292,12 @@ public class ClusterConfiguration {
     private final boolean useSsl;
     private final Optional<String> username;
     private final Optional<String> password;
+    private final boolean durableWrites;
 
     public ClusterConfiguration(List<Host> hosts, String keyspace, int replicationFactor, int minDelay, int maxRetry,
                                 QueryLoggerConfiguration queryLoggerConfiguration, Optional<PoolingOptions> poolingOptions,
-                                int readTimeoutMillis, int connectTimeoutMillis, boolean useSsl, Optional<String> username, Optional<String> password) {
+                                int readTimeoutMillis, int connectTimeoutMillis, boolean useSsl, Optional<String> username,
+                                Optional<String> password, boolean durableWrites) {
         this.hosts = hosts;
         this.keyspace = keyspace;
         this.replicationFactor = replicationFactor;
@@ -299,6 +310,11 @@ public class ClusterConfiguration {
         this.useSsl = useSsl;
         this.username = username;
         this.password = password;
+        this.durableWrites = durableWrites;
+    }
+
+    public boolean isDurableWrites() {
+        return durableWrites;
     }
 
     public List<Host> getHosts() {
diff --git a/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/CassandraCluster.java b/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/CassandraCluster.java
index 6c95990..aff80b4 100644
--- a/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/CassandraCluster.java
+++ b/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/CassandraCluster.java
@@ -61,19 +61,14 @@ public final class CassandraCluster implements AutoCloseable {
                 .host(host.getHostName())
                 .port(host.getPort())
                 .build();
-            session = new SessionWithInitializedTablesFactory(
-                ClusterConfiguration.builder()
-                    .host(host)
-                    .keyspace(KEYSPACE)
-                    .replicationFactor(1)
-                    .build(),
-                ClusterWithKeyspaceCreatedFactory
-                    .config(cluster, KEYSPACE)
-                    .replicationFactor(1)
-                    .disableDurableWrites()
-                    .clusterWithInitializedKeyspace(),
-                module)
-                .get();
+            ClusterConfiguration clusterConfiguration = ClusterConfiguration.builder()
+                .host(host)
+                .keyspace(KEYSPACE)
+                .replicationFactor(1)
+                .disableDurableWrites()
+                .build();
+            ClusterWithKeyspaceCreatedFactory.createKeyspace(cluster, clusterConfiguration);
+            session = new SessionWithInitializedTablesFactory(clusterConfiguration, cluster, module).get();
             typesProvider = new CassandraTypesProvider(module, session);
         } catch (Exception exception) {
             throw new RuntimeException(exception);
diff --git a/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/init/SessionWithInitializedTablesFactoryTest.java b/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/init/SessionWithInitializedTablesFactoryTest.java
index 041aaf1..13a4f53 100644
--- a/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/init/SessionWithInitializedTablesFactoryTest.java
+++ b/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/init/SessionWithInitializedTablesFactoryTest.java
@@ -126,18 +126,18 @@ class SessionWithInitializedTablesFactoryTest {
                 .host(host.getHostName())
                 .port(host.getPort())
                 .build();
+        ClusterConfiguration clusterConfiguration = ClusterConfiguration.builder()
+            .host(host)
+            .keyspace(KEYSPACE)
+            .replicationFactor(1)
+            .disableDurableWrites()
+            .build();
+        ClusterWithKeyspaceCreatedFactory.createKeyspace(cluster, clusterConfiguration);
         return () -> new SessionWithInitializedTablesFactory(
-                ClusterConfiguration.builder()
-                        .host(host)
-                        .keyspace(KEYSPACE)
-                        .replicationFactor(1)
-                        .build(),
-                ClusterWithKeyspaceCreatedFactory
-                        .config(cluster, KEYSPACE)
-                        .replicationFactor(1)
-                        .disableDurableWrites()
-                        .clusterWithInitializedKeyspace(),
-                MODULE).get();
+                clusterConfiguration,
+                cluster,
+                MODULE)
+            .get();
     }
 
     private static void cleanCassandra(Session session) {


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[james-project] 01/36: JAMES-2933 Update the dev-build documentation page

Posted by bt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit cbe0805b999a80f32f6470e8c679bd69a68df9c1
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Tue Oct 29 12:10:21 2019 +0700

    JAMES-2933 Update the dev-build documentation page
    
    JDK 11 is required, as well as a recent maven version. The SVN repository
    no longer exists...
---
 src/site/xdoc/server/dev-build.xml | 25 +++++++++++--------------
 1 file changed, 11 insertions(+), 14 deletions(-)

diff --git a/src/site/xdoc/server/dev-build.xml b/src/site/xdoc/server/dev-build.xml
index dc47e25..81d9d7f 100644
--- a/src/site/xdoc/server/dev-build.xml
+++ b/src/site/xdoc/server/dev-build.xml
@@ -65,11 +65,11 @@
 
     <p>To run the build you need two third-party tools.</p>
     <ol>
-      <li>Java Development Kit - You must have a JDK of Java version 1.6 or higher installed to build the
-          James distribution.  The exact JDKs available depend on the platform.  A JDK must be downloaded and
+      <li>Java Development Kit - You must have a JDK of Java version 1.11 or higher installed to build the
+          James distribution.  The exact JDKs available depend on the platform. A JDK must be downloaded and
           installed before the build can run.</li>
-      <li>Maven 3.0.2 - This is a Java-tailored, XML-configured, extensible build or make system. You need maven (3.0.2+) in order
-          to build James. You can get maven 3.0.2 from <a href="http://maven.apache.org/download.html">here</a>.
+      <li>Maven 3.3.9 - This is a Java-tailored, XML-configured, extensible build or make system. You need maven (3.3.9+) in order
+          to build James. We recommend you to use maven 3.6.2. You can get maven from <a href="http://maven.apache.org/download.html">here</a>.
           Installation instructions for maven are also available on the same page <a href="http://maven.apache.org/download.html">http://maven.apache.org/download.html</a>.</li>
     </ol>
     <p>Set (on windows) or export (on Unix) MAVEN_OPTS to tune the memory needed by maven with "MAVEN_OPTS=-Xmx1024m -XX:MaxPermSize=128m"</p>
@@ -84,27 +84,24 @@
       <li>compile - compiles the source code.</li>
       <li>test - run unit tests for James.</li>
       <li><b>package - generates all the James distributions, packed.
-      From the root directory, cd to 'server/container/spring/target' to have the build distribution.
-      Notice, for the latest trunk(revision 1430655+), or on master, a specific profile argument need to be set: '-Pwith-assembly'.
-      The location of final distributions is also changed to 'JAMES_SRC_HOME/server/app/target'.</b></li>
+      From the root directory, cd to 'server/app/target' to have the build distribution.</b></li>
       <li>javadocs:javadocs - builds the James javadocs.</li>
       <li>site - builds the entirety of the James website.</li>
     </ul>
     </p>
     <p>For example, invoke <code>mvn package</code> to get a zip/tar of James distribution.</p>
-    <p>All built products are output in the <code>server/container/spring/target</code>
+    <p>All built products are output in the <code>server/app/target</code>
       subdirectory of the James source directory.
       This directory will be deleted if you run build with the clean argument.</p>
     <p><strong>Warning!</strong> Any changes you've made in the 'dist' directory
-      will be lost after a recompilation. If you are running James for this directory
-      we recommend you backup to avoid losing work. </p>
+      will be lost after a recompilation. You should not run James from this directory.</p>
     <p>You can also invoke the command line from a shell. Go to the server project cli folder and type mvn exec:java -Dexec.args="-h localhost -p 9999 help"</p>
 
   </section>
 
   <section name="Build James Source from Eclipse">
 
-    <p>Upon the following documentation, an interessting resource 
+    <p>Upon the following documentation, an interesting resource
        <a href="http://blog.bonnydoonmedia.com/post.cfm/walkthrough-tutorials-compiling-apache-james-v3-with-eclipse">
        can be found here</a>
     </p>
@@ -165,7 +162,7 @@
 
       <p>If you change a JPA Entity class, your will need to run 'mvn package'
           or add the following option to the VM argument of your run configuration
-          '-javaagent:my_home_folder/.m2/repository/org/apache/openjpa/openjpa/2.2.1/openjpa-2.2.1.jar'
+          '-javaagent:my_home_folder/.m2/repository/org/apache/openjpa/openjpa/3.1.0/openjpa-3.1.0.jar'
       </p>
 
     </subsection>
@@ -220,9 +217,9 @@
       </p>
 
       <subsection name="Getting the sources from the repository">
-          <p>To download the source code, you can use the Subversion support that comes with IntelliJ IDEA following the next steps:</p>
+          <p>To download the source code, you can use the Git support that comes with IntelliJ IDEA following the next steps:</p>
 
-          <p>First, in the Welcome page, click on <strong>Check out from Version Control</strong> and select <strong>Subversion</strong>.</p>
+          <p>First, in the Welcome page, click on <strong>Check out from Version Control</strong> and select <strong>Git</strong>.</p>
           <img src="./images/intellij-idea/intellij-new-project.png"/>
           <p>In the pop-up window, press the <strong>+</strong> button to add the James code repository in the next pop-up.</p>
           <img src="./images/intellij-idea/intellij-svn-repo.png"/>            <br/>


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[james-project] 10/36: JAMES-2904 Remove ClusterBuilder complicated host/port options

Posted by bt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit 6a4ad33402ffd5d1ed16ddcc7a786f9e0e14ed97
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Wed Oct 2 12:17:10 2019 +0700

    JAMES-2904 Remove ClusterBuilder complicated host/port options
    
    Rely only on Host objects
---
 .../backends/cassandra/init/ClusterBuilder.java    | 40 +++-------------------
 .../james/backends/cassandra/CassandraCluster.java |  3 +-
 .../cassandra/init/ClusterBuilderTest.java         |  4 +--
 .../SessionWithInitializedTablesFactoryTest.java   |  5 ++-
 4 files changed, 10 insertions(+), 42 deletions(-)

diff --git a/backends-common/cassandra/src/main/java/org/apache/james/backends/cassandra/init/ClusterBuilder.java b/backends-common/cassandra/src/main/java/org/apache/james/backends/cassandra/init/ClusterBuilder.java
index 681992a..e41c6d6 100644
--- a/backends-common/cassandra/src/main/java/org/apache/james/backends/cassandra/init/ClusterBuilder.java
+++ b/backends-common/cassandra/src/main/java/org/apache/james/backends/cassandra/init/ClusterBuilder.java
@@ -47,8 +47,6 @@ public class ClusterBuilder {
     private Optional<String> username;
     private Optional<String> password;
 
-    private Optional<String> host;
-    private Optional<Integer> port;
     private Optional<Collection<Host>> servers;
 
     private Optional<QueryLoggerConfiguration> queryLogger;
@@ -62,8 +60,6 @@ public class ClusterBuilder {
         password = Optional.empty();
         useSsl = Optional.empty();
 
-        host = Optional.empty();
-        port = Optional.empty();
         servers = Optional.empty();
 
         queryLogger = Optional.empty();
@@ -92,18 +88,6 @@ public class ClusterBuilder {
         return this;
     }
 
-    public ClusterBuilder host(String host) {
-        this.host = Optional.of(host);
-
-        return this;
-    }
-
-    public ClusterBuilder port(int port) {
-        this.port = Optional.of(port);
-
-        return this;
-    }
-
     public ClusterBuilder useSsl(boolean useSsl) {
         this.useSsl = Optional.of(useSsl);
 
@@ -149,15 +133,13 @@ public class ClusterBuilder {
     }
 
     public Cluster build() {
-        Preconditions.checkState(!(servers.isPresent() && host.isPresent()), "You can't specify a list of servers and a host at the same time");
-        Preconditions.checkState(!(servers.isPresent() && port.isPresent()), "You can't specify a list of servers and a port at the same time");
         Preconditions.checkState(username.isPresent() == password.isPresent(), "If you specify username, you must specify password");
 
         Cluster.Builder clusterBuilder = Cluster.builder()
             .withoutJMXReporting();
-        getServers().forEach(
-                (server) -> clusterBuilder.addContactPoint(server.getHostName()).withPort(server.getPort())
-        );
+        getServers().forEach(server -> clusterBuilder
+            .addContactPoint(server.getHostName())
+            .withPort(server.getPort()));
 
         username.map(username ->
             password.map(password ->
@@ -190,19 +172,7 @@ public class ClusterBuilder {
     }
 
     private Collection<Host> getServers() {
-        return servers.orElse(getServersFromHostAndPort());
-    }
-
-    private Collection<Host> getServersFromHostAndPort() {
-        String host = this.host.orElseGet(() -> {
-            LOGGER.info("No cassandra host specified. Falling back to {}", DEFAULT_CLUSTER_IP);
-            return DEFAULT_CLUSTER_IP;
-        });
-        int port = this.port.orElseGet(() -> {
-            LOGGER.info("No cassandra port specified. Falling back to {}", DEFAULT_CASSANDRA_PORT);
-            return DEFAULT_CASSANDRA_PORT;
-        });
-
-        return ImmutableList.of(Host.from(host, port));
+        return servers.orElse(ImmutableList.of(
+            Host.from(DEFAULT_CLUSTER_IP, DEFAULT_CASSANDRA_PORT)));
     }
 }
diff --git a/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/CassandraCluster.java b/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/CassandraCluster.java
index aff80b4..9a6d412 100644
--- a/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/CassandraCluster.java
+++ b/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/CassandraCluster.java
@@ -58,8 +58,7 @@ public final class CassandraCluster implements AutoCloseable {
         this.module = module;
         try {
             cluster = ClusterBuilder.builder()
-                .host(host.getHostName())
-                .port(host.getPort())
+                .servers(host)
                 .build();
             ClusterConfiguration clusterConfiguration = ClusterConfiguration.builder()
                 .host(host)
diff --git a/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/init/ClusterBuilderTest.java b/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/init/ClusterBuilderTest.java
index 9c440f4..4ad3db7 100644
--- a/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/init/ClusterBuilderTest.java
+++ b/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/init/ClusterBuilderTest.java
@@ -20,6 +20,7 @@ package org.apache.james.backends.cassandra.init;
 
 import static org.assertj.core.api.Assertions.assertThat;
 
+import org.apache.james.util.Host;
 import org.junit.jupiter.api.Test;
 
 import com.datastax.driver.core.Cluster;
@@ -30,8 +31,7 @@ class ClusterBuilderTest {
     @Test
     void consistencyLevelShouldBeEqualToQuorum() {
         Cluster cluster = ClusterBuilder.builder()
-            .host("localhost")
-            .port(ClusterBuilder.DEFAULT_CASSANDRA_PORT)
+            .servers(Host.from("localhost", ClusterBuilder.DEFAULT_CASSANDRA_PORT))
             .build();
 
         ConsistencyLevel consistencyLevel = cluster.getConfiguration()
diff --git a/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/init/SessionWithInitializedTablesFactoryTest.java b/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/init/SessionWithInitializedTablesFactoryTest.java
index 13a4f53..ea6fd49 100644
--- a/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/init/SessionWithInitializedTablesFactoryTest.java
+++ b/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/init/SessionWithInitializedTablesFactoryTest.java
@@ -123,9 +123,8 @@ class SessionWithInitializedTablesFactoryTest {
     private static Supplier<Session> createSession(DockerCassandraExtension.DockerCassandra cassandraServer) {
         Host host = cassandraServer.getHost();
         Cluster cluster = ClusterBuilder.builder()
-                .host(host.getHostName())
-                .port(host.getPort())
-                .build();
+            .servers(host)
+            .build();
         ClusterConfiguration clusterConfiguration = ClusterConfiguration.builder()
             .host(host)
             .keyspace(KEYSPACE)


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[james-project] 28/36: [REFACTORING] Clean protocols-pop3 javadoc

Posted by bt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit bf902d90e3e44f926936451cf7fd63b6aba48fce
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Thu Nov 7 11:52:42 2019 +0700

    [REFACTORING] Clean protocols-pop3 javadoc
    
     - Solve IntellijJ warnings related to javaDoc
     - Remove verbose, meaningless entries
---
 .../james/protocols/lmtp/LMTPConfiguration.java    |  3 ---
 .../james/protocols/lmtp/LMTPMultiResponse.java    |  5 ++---
 .../protocols/lmtp/LMTPProtocolHandlerChain.java   |  2 --
 .../lmtp/core/DataLineMessageHookHandler.java      |  2 --
 .../lmtp/core/ReceivedDataLineFilter.java          |  2 --
 .../protocols/lmtp/core/WelcomeMessageHandler.java |  2 --
 .../lmtp/hook/DeliverToRecipientHook.java          |  5 +----
 .../james/protocols/pop3/POP3Configuration.java    |  1 -
 .../apache/james/protocols/pop3/POP3Protocol.java  |  1 -
 .../protocols/pop3/POP3ProtocolHandlerChain.java   |  3 ---
 .../apache/james/protocols/pop3/POP3Response.java  |  2 --
 .../james/protocols/pop3/POP3StartTlsResponse.java |  2 --
 .../james/protocols/pop3/POP3StreamResponse.java   |  1 -
 .../pop3/core/AbstractApopCmdHandler.java          |  7 +------
 .../pop3/core/AbstractPassCmdHandler.java          | 14 +++----------
 .../james/protocols/pop3/core/CapaCapability.java  |  4 ----
 .../protocols/pop3/core/MessageMetaDataUtils.java  |  7 -------
 .../protocols/pop3/mailbox/AbstractMailbox.java    |  5 ++---
 .../james/protocols/pop3/mailbox/ImapMailbox.java  | 16 ---------------
 .../james/protocols/pop3/mailbox/Mailbox.java      | 24 ----------------------
 .../protocols/pop3/mailbox/MessageMetaData.java    |  8 --------
 21 files changed, 9 insertions(+), 107 deletions(-)

diff --git a/protocols/lmtp/src/main/java/org/apache/james/protocols/lmtp/LMTPConfiguration.java b/protocols/lmtp/src/main/java/org/apache/james/protocols/lmtp/LMTPConfiguration.java
index d397699..fa3f374 100644
--- a/protocols/lmtp/src/main/java/org/apache/james/protocols/lmtp/LMTPConfiguration.java
+++ b/protocols/lmtp/src/main/java/org/apache/james/protocols/lmtp/LMTPConfiguration.java
@@ -24,11 +24,8 @@ import org.apache.james.protocols.smtp.SMTPConfiguration;
 
 /**
  * A {@link ProtocolConfigurationImpl} which is used in the context of LMTP
- *
  */
 public abstract class LMTPConfiguration extends ProtocolConfigurationImpl implements SMTPConfiguration {
-
-
     
     @Override
     public boolean isRelayingAllowed(String remoteIP) {
diff --git a/protocols/lmtp/src/main/java/org/apache/james/protocols/lmtp/LMTPMultiResponse.java b/protocols/lmtp/src/main/java/org/apache/james/protocols/lmtp/LMTPMultiResponse.java
index 6c3f0c0..af212c9 100644
--- a/protocols/lmtp/src/main/java/org/apache/james/protocols/lmtp/LMTPMultiResponse.java
+++ b/protocols/lmtp/src/main/java/org/apache/james/protocols/lmtp/LMTPMultiResponse.java
@@ -25,9 +25,8 @@ import java.util.List;
 import org.apache.james.protocols.api.Response;
 
 /**
- * After the message message is submitted via the 'CRLF.CLRF' sequence the LMTP Server will return a response line for every recipient. This special {@link Response} can be used for this
- * 
- *
+ * After the message message is submitted via the 'CRLF.CLRF' sequence the LMTP Server will return a response line for
+ * every recipient. This special {@link Response} can be used for this
  */
 public class LMTPMultiResponse implements Response {
 
diff --git a/protocols/lmtp/src/main/java/org/apache/james/protocols/lmtp/LMTPProtocolHandlerChain.java b/protocols/lmtp/src/main/java/org/apache/james/protocols/lmtp/LMTPProtocolHandlerChain.java
index 5af64b8..7a21cca 100644
--- a/protocols/lmtp/src/main/java/org/apache/james/protocols/lmtp/LMTPProtocolHandlerChain.java
+++ b/protocols/lmtp/src/main/java/org/apache/james/protocols/lmtp/LMTPProtocolHandlerChain.java
@@ -48,8 +48,6 @@ import org.apache.james.protocols.smtp.hook.Hook;
 
 /**
  * Special {@link SMTPProtocolHandlerChain} sub-class which should be used to build the chain for LMTP.
- * 
- *
  */
 public class LMTPProtocolHandlerChain extends SMTPProtocolHandlerChain {
 
diff --git a/protocols/lmtp/src/main/java/org/apache/james/protocols/lmtp/core/DataLineMessageHookHandler.java b/protocols/lmtp/src/main/java/org/apache/james/protocols/lmtp/core/DataLineMessageHookHandler.java
index 75c9000..1e971cf 100644
--- a/protocols/lmtp/src/main/java/org/apache/james/protocols/lmtp/core/DataLineMessageHookHandler.java
+++ b/protocols/lmtp/src/main/java/org/apache/james/protocols/lmtp/core/DataLineMessageHookHandler.java
@@ -36,8 +36,6 @@ import org.apache.james.protocols.smtp.dsn.DSNStatus;
 
 /**
  * {@link DataLineMessageHookHandler} which will use the wired {@link DeliverToRecipientHook}'s to deliver the message to all the valid recipients.
- * 
- *
  */
 public class DataLineMessageHookHandler extends org.apache.james.protocols.smtp.core.DataLineMessageHookHandler {
 
diff --git a/protocols/lmtp/src/main/java/org/apache/james/protocols/lmtp/core/ReceivedDataLineFilter.java b/protocols/lmtp/src/main/java/org/apache/james/protocols/lmtp/core/ReceivedDataLineFilter.java
index bbaefbf..a7fe568 100644
--- a/protocols/lmtp/src/main/java/org/apache/james/protocols/lmtp/core/ReceivedDataLineFilter.java
+++ b/protocols/lmtp/src/main/java/org/apache/james/protocols/lmtp/core/ReceivedDataLineFilter.java
@@ -22,8 +22,6 @@ import org.apache.james.protocols.smtp.SMTPSession;
 
 /**
  * {@link ReceivedDataLineFilter} which will add the Received header to the message
- * 
- *
  */
 public class ReceivedDataLineFilter extends org.apache.james.protocols.smtp.core.ReceivedDataLineFilter {
 
diff --git a/protocols/lmtp/src/main/java/org/apache/james/protocols/lmtp/core/WelcomeMessageHandler.java b/protocols/lmtp/src/main/java/org/apache/james/protocols/lmtp/core/WelcomeMessageHandler.java
index c0ffb73..9ff612e 100644
--- a/protocols/lmtp/src/main/java/org/apache/james/protocols/lmtp/core/WelcomeMessageHandler.java
+++ b/protocols/lmtp/src/main/java/org/apache/james/protocols/lmtp/core/WelcomeMessageHandler.java
@@ -23,8 +23,6 @@ import org.apache.james.protocols.smtp.SMTPSession;
 
 /**
  * Returns the WELCOME response to the client after it established a connection
- * 
- *
  */
 public class WelcomeMessageHandler extends org.apache.james.protocols.smtp.core.WelcomeMessageHandler {
     
diff --git a/protocols/lmtp/src/main/java/org/apache/james/protocols/lmtp/hook/DeliverToRecipientHook.java b/protocols/lmtp/src/main/java/org/apache/james/protocols/lmtp/hook/DeliverToRecipientHook.java
index 7053cf8..2acc4a2 100644
--- a/protocols/lmtp/src/main/java/org/apache/james/protocols/lmtp/hook/DeliverToRecipientHook.java
+++ b/protocols/lmtp/src/main/java/org/apache/james/protocols/lmtp/hook/DeliverToRecipientHook.java
@@ -34,10 +34,7 @@ public interface DeliverToRecipientHook extends Hook {
 
     /**
      * Deliver the message to the recipient
-     * 
-     * @param session
-     * @param recipient
-     * @param envelope
+     *
      * @return response
      */
     HookResult deliver(SMTPSession session, MailAddress recipient, MailEnvelope envelope);
diff --git a/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/POP3Configuration.java b/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/POP3Configuration.java
index 7d5b5d5..b63a3a0 100644
--- a/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/POP3Configuration.java
+++ b/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/POP3Configuration.java
@@ -22,7 +22,6 @@ import org.apache.james.protocols.api.ProtocolConfigurationImpl;
 
 /**
  * {@link ProtocolConfigurationImpl} which adds some default configuration for POP3
- *
  */
 public class POP3Configuration extends ProtocolConfigurationImpl {
 
diff --git a/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/POP3Protocol.java b/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/POP3Protocol.java
index e25f90d..08f2e36 100644
--- a/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/POP3Protocol.java
+++ b/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/POP3Protocol.java
@@ -27,7 +27,6 @@ import org.apache.james.protocols.api.handler.ProtocolHandlerChain;
 
 /**
  * {@link ProtocolImpl} which implements the POP3 Protocol
- *
  */
 public class POP3Protocol extends ProtocolImpl {
     
diff --git a/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/POP3ProtocolHandlerChain.java b/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/POP3ProtocolHandlerChain.java
index d7e57c0..fc25553 100644
--- a/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/POP3ProtocolHandlerChain.java
+++ b/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/POP3ProtocolHandlerChain.java
@@ -58,9 +58,6 @@ public class POP3ProtocolHandlerChain extends ProtocolHandlerChainImpl {
     /**
      * The {@link AbstractPassCmdHandler}'s to use. If at least one {@link AbstractPassCmdHandler} is given, the {@link POP3ProtocolHandlerChain}
      * will add all default handlers
-     * 
-     * @param authHandlers
-     * @throws WiringException 
      */
     public POP3ProtocolHandlerChain(AbstractPassCmdHandler... authHandlers) throws WiringException {
         if (authHandlers != null && authHandlers.length > 0) {
diff --git a/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/POP3Response.java b/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/POP3Response.java
index 451161d..d4e73b2 100644
--- a/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/POP3Response.java
+++ b/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/POP3Response.java
@@ -80,8 +80,6 @@ public class POP3Response extends AbstractResponse {
 
     /**
      * Return a List of all responseLines stored in this POP3Response
-     * 
-     * @return all responseLines
      */
     @Override
     public List<CharSequence> getLines() {
diff --git a/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/POP3StartTlsResponse.java b/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/POP3StartTlsResponse.java
index 1c98cd0..cf5f65f 100644
--- a/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/POP3StartTlsResponse.java
+++ b/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/POP3StartTlsResponse.java
@@ -26,8 +26,6 @@ import org.apache.james.protocols.api.StartTlsResponse;
 
 /**
  * Special sub-type of {@link POP3Response} which will trigger the start of TLS after the response was written to the client
- * 
- *
  */
 public class POP3StartTlsResponse extends POP3Response implements StartTlsResponse {
 
diff --git a/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/POP3StreamResponse.java b/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/POP3StreamResponse.java
index 28745a2..e57dc01 100644
--- a/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/POP3StreamResponse.java
+++ b/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/POP3StreamResponse.java
@@ -28,7 +28,6 @@ import org.apache.james.protocols.api.StreamResponse;
 
 /**
  * {@link StreamResponse} implementation which allows to write back big-data to the client for POP3
- *
  */
 public class POP3StreamResponse extends POP3Response implements StreamResponse {
 
diff --git a/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/core/AbstractApopCmdHandler.java b/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/core/AbstractApopCmdHandler.java
index 50665aa..990562c 100644
--- a/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/core/AbstractApopCmdHandler.java
+++ b/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/core/AbstractApopCmdHandler.java
@@ -85,13 +85,8 @@ public abstract class AbstractApopCmdHandler extends AbstractPassCmdHandler {
 
     /**
      * Authenticate a {@link POP3Session} and returns the {@link Mailbox} for it. If it can not get authenticated it will return <code>null</code>.
-     * 
-     * @param session
-     * @param apopTimestamp
-     * @param user
-     * @param digest
+     *
      * @return mailbox
-     * @throws Exception
      */
     protected abstract Mailbox auth(POP3Session session, String apopTimestamp, String user, String digest) throws Exception;
 }
diff --git a/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/core/AbstractPassCmdHandler.java b/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/core/AbstractPassCmdHandler.java
index e099700..915b455 100644
--- a/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/core/AbstractPassCmdHandler.java
+++ b/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/core/AbstractPassCmdHandler.java
@@ -58,11 +58,6 @@ public abstract class AbstractPassCmdHandler extends RsetCmdHandler {
     
     /**
      * Authenticate a user and return the {@link Response}
-     * 
-     * @param session
-     * @param user
-     * @param pass
-     * @return response
      */
     protected final Response doAuth(POP3Session session, String user, String pass) {
         try {
@@ -94,13 +89,10 @@ public abstract class AbstractPassCmdHandler extends RsetCmdHandler {
     }
 
     /**
-     * Authenticate a {@link POP3Session} and returns the {@link Mailbox} for it. If it can not get authenticated it will return <code>null</code>.
-     * 
-     * @param session
-     * @param user
-     * @param password
+     * Authenticate a {@link POP3Session} and returns the {@link Mailbox} for it. If it can not get authenticated it
+     * will return <code>null</code>.
+     *
      * @return mailbox
-     * 
      */
     protected abstract Mailbox auth(POP3Session session, String username, String password) throws Exception;
 }
diff --git a/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/core/CapaCapability.java b/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/core/CapaCapability.java
index 5035182..725b506 100644
--- a/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/core/CapaCapability.java
+++ b/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/core/CapaCapability.java
@@ -23,7 +23,6 @@ import java.util.Set;
 
 import org.apache.james.protocols.pop3.POP3Session;
 
-
 /**
  * A handler which support the POP3 Extension Mechanism should implement this
  * interface
@@ -33,9 +32,6 @@ public interface CapaCapability {
     /**
      * Return a List of responses which should get returned when a client issue
      * the CAPA command
-     * 
-     * @param session
-     * @return list
      */
     Set<String> getImplementedCapabilities(POP3Session session);
 }
diff --git a/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/core/MessageMetaDataUtils.java b/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/core/MessageMetaDataUtils.java
index 9680eaa..477f5cf 100644
--- a/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/core/MessageMetaDataUtils.java
+++ b/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/core/MessageMetaDataUtils.java
@@ -31,10 +31,6 @@ public class MessageMetaDataUtils {
     /**
      * Returns the {@link MessageMetaData} for the given message number or <code>null</code> if it can not be 
      * found.
-     * 
-     * @param session
-     * @param number
-     * @return data
      */
     public static MessageMetaData getMetaData(POP3Session session, int number) {
         @SuppressWarnings("unchecked")
@@ -48,9 +44,6 @@ public class MessageMetaDataUtils {
 
     /**
      * Check whether POP3 UID is compatible with RFC1939
-     * 
-     * @param uid
-     * @return
      */
     public static boolean isRFC1939Compatible(String uid) {
         if (uid == null) {
diff --git a/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/mailbox/AbstractMailbox.java b/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/mailbox/AbstractMailbox.java
index 5e5b6ee..5b4bd5a 100644
--- a/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/mailbox/AbstractMailbox.java
+++ b/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/mailbox/AbstractMailbox.java
@@ -25,9 +25,8 @@ import java.io.InputStream;
 import org.apache.james.protocols.api.CombinedInputStream;
 
 /**
- * A {@link Mailbox} implementation which use a {@link CombinedInputStream} over {@link #getMessageHeaders(long)}  and {@link #getMessageBody(long)} to return the full message.
- * 
- *
+ * A {@link Mailbox} implementation which use a {@link CombinedInputStream} over {@link #getMessageHeaders(String)} (long)}
+ * and {@link #getMessageBody(String)} (long)} to return the full message.
  */
 public abstract class AbstractMailbox implements Mailbox {
 
diff --git a/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/mailbox/ImapMailbox.java b/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/mailbox/ImapMailbox.java
index 05af522..2c46dcd 100644
--- a/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/mailbox/ImapMailbox.java
+++ b/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/mailbox/ImapMailbox.java
@@ -24,8 +24,6 @@ import java.util.Arrays;
 
 /**
  * An IMAP Mailbox adapter which is used in POP3 to retrieve messages
- * 
- * 
  */
 @Deprecated
 public abstract class ImapMailbox implements Mailbox {
@@ -33,10 +31,6 @@ public abstract class ImapMailbox implements Mailbox {
     /**
      * Returns the message body as {@link InputStream} or <code>null</code> if
      * no message can be found for the given <code>uid</code>
-     * 
-     * @param uid
-     * @return body
-     * @throws IOException
      */
     public abstract InputStream getMessageBody(long uid) throws IOException;
 
@@ -48,10 +42,6 @@ public abstract class ImapMailbox implements Mailbox {
     /**
      * Returns the message headers as {@link InputStream} or <code>null</code>
      * if no message can be found for the given <code>uid</code>
-     * 
-     * @param uid
-     * @return headers
-     * @throws IOException
      */
     public abstract InputStream getMessageHeaders(long uid) throws IOException;
 
@@ -64,10 +54,6 @@ public abstract class ImapMailbox implements Mailbox {
      * Return the full message (headers + body) as {@link InputStream} or
      * <code>null</code> if no message can be found for the given
      * <code>uid</code>
-     * 
-     * @param uid
-     * @return message
-     * @throws IOException
      */
     public abstract InputStream getMessage(long uid) throws IOException;
 
@@ -78,8 +64,6 @@ public abstract class ImapMailbox implements Mailbox {
 
     /**
      * Remove the messages with the given uids
-     * 
-     * @param uids
      */
     public abstract void remove(long... uids) throws IOException;
 
diff --git a/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/mailbox/Mailbox.java b/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/mailbox/Mailbox.java
index ee96d5c..ec3b5ef 100644
--- a/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/mailbox/Mailbox.java
+++ b/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/mailbox/Mailbox.java
@@ -24,28 +24,18 @@ import java.util.List;
 
 /**
  * A Mailbox which is used in POP3 to retrieve messages
- * 
- * 
  */
 public interface Mailbox {
 
     /**
      * Returns the message body as {@link InputStream} or <code>null</code> if
      * no message can be found for the given <code>uid</code>
-     * 
-     * @param uid
-     * @return body
-     * @throws IOException
      */
     InputStream getMessageBody(String uid) throws IOException;
 
     /**
      * Returns the message headers as {@link InputStream} or <code>null</code>
      * if no message can be found for the given <code>uid</code>
-     * 
-     * @param uid
-     * @return headers
-     * @throws IOException
      */
     InputStream getMessageHeaders(String uid) throws IOException;
 
@@ -53,42 +43,28 @@ public interface Mailbox {
      * Return the full message (headers + body) as {@link InputStream} or
      * <code>null</code> if no message can be found for the given
      * <code>uid</code>
-     * 
-     * @param uid
-     * @return message
-     * @throws IOException
      */
     InputStream getMessage(String uid) throws IOException;
 
     /**
      * Return a immutable {@link List} which holds the {@link MessageMetaData}
      * for all messages in the {@link Mailbox}
-     * 
-     * @return messages
-     * @throws IOException
      */
     List<MessageMetaData> getMessages() throws IOException;
 
     /**
      * Remove the messages with the given uids
-     * 
-     * @param uids
      */
     void remove(String... uids) throws IOException;
 
     /**
      * Return the identifier for the mailbox. This MUST not change
-     * 
-     * @return identifer
-     * @throws IOException
      */
     String getIdentifier() throws IOException;
 
     /**
      * Close the mailbox, Any futher attempt to access or change the
      * {@link Mailbox}'s content will fail
-     * 
-     * @throws IOException
      */
     void close() throws IOException;
 
diff --git a/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/mailbox/MessageMetaData.java b/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/mailbox/MessageMetaData.java
index c087373..ab4ad90 100644
--- a/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/mailbox/MessageMetaData.java
+++ b/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/mailbox/MessageMetaData.java
@@ -39,8 +39,6 @@ public class MessageMetaData {
 
     /**
      * Return the uid of the message
-     * 
-     * @return uid
      */
     public String getUid() {
         return uid;
@@ -49,10 +47,6 @@ public class MessageMetaData {
     /**
      * Return the uid of the message. This method uses extra Mailbox ID argument to make
      * UID unique when it is not globally unique. By default assuming UID globally unique.
-     *
-     * @param mailboxId
-     *            Mailbox ID
-     * @return
      */
     public String getUid(String mailboxId) {
         return uid;
@@ -60,8 +54,6 @@ public class MessageMetaData {
 
     /**
      * Return the size of a message
-     * 
-     * @return size
      */
     public long getSize() {
         return size;


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[james-project] 36/36: [REFACTORING] Move used class of package protocols.imap in their right imap counterpart

Posted by bt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit ebea6a8a98a0f132a36257b44d7b8c3fa8c229a0
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Thu Nov 7 12:22:56 2019 +0700

    [REFACTORING] Move used class of package protocols.imap in their right imap counterpart
---
 .../james/{protocols/imap/utils => imap/decode}/DecoderUtils.java   | 3 +--
 .../james/{protocols/imap => imap/decode}/DecodingException.java    | 2 +-
 .../java/org/apache/james/imap/decode/FetchPartPathDecoder.java     | 1 -
 .../java/org/apache/james/imap/decode/ImapRequestLineReader.java    | 4 +---
 .../org/apache/james/imap/decode/ImapRequestStreamLineReader.java   | 5 ++---
 .../apache/james/imap/decode/base/AbstractImapCommandParser.java    | 2 +-
 .../java/org/apache/james/imap/decode/main/DefaultImapDecoder.java  | 2 +-
 .../org/apache/james/imap/decode/main/ImapRequestStreamHandler.java | 2 +-
 .../james/imap/decode/parser/AbstractMessageRangeCommandParser.java | 2 +-
 .../james/imap/decode/parser/AbstractSelectionCommandParser.java    | 2 +-
 .../apache/james/imap/decode/parser/AbstractUidCommandParser.java   | 2 +-
 .../org/apache/james/imap/decode/parser/AppendCommandParser.java    | 2 +-
 .../apache/james/imap/decode/parser/AuthenticateCommandParser.java  | 2 +-
 .../apache/james/imap/decode/parser/CapabilityCommandParser.java    | 2 +-
 .../org/apache/james/imap/decode/parser/CheckCommandParser.java     | 2 +-
 .../org/apache/james/imap/decode/parser/CloseCommandParser.java     | 2 +-
 .../org/apache/james/imap/decode/parser/CompressCommandParser.java  | 2 +-
 .../org/apache/james/imap/decode/parser/CreateCommandParser.java    | 2 +-
 .../org/apache/james/imap/decode/parser/DeleteACLCommandParser.java | 2 +-
 .../org/apache/james/imap/decode/parser/DeleteCommandParser.java    | 2 +-
 .../org/apache/james/imap/decode/parser/EnableCommandParser.java    | 2 +-
 .../org/apache/james/imap/decode/parser/ExpungeCommandParser.java   | 2 +-
 .../org/apache/james/imap/decode/parser/FetchCommandParser.java     | 2 +-
 .../org/apache/james/imap/decode/parser/GetACLCommandParser.java    | 2 +-
 .../apache/james/imap/decode/parser/GetAnnotationCommandParser.java | 2 +-
 .../org/apache/james/imap/decode/parser/GetQuotaCommandParser.java  | 2 +-
 .../apache/james/imap/decode/parser/GetQuotaRootCommandParser.java  | 2 +-
 .../java/org/apache/james/imap/decode/parser/IdleCommandParser.java | 2 +-
 .../java/org/apache/james/imap/decode/parser/ListCommandParser.java | 2 +-
 .../apache/james/imap/decode/parser/ListRightsCommandParser.java    | 2 +-
 .../org/apache/james/imap/decode/parser/LoginCommandParser.java     | 2 +-
 .../org/apache/james/imap/decode/parser/LogoutCommandParser.java    | 2 +-
 .../org/apache/james/imap/decode/parser/MyRightsCommandParser.java  | 2 +-
 .../org/apache/james/imap/decode/parser/NamespaceCommandParser.java | 2 +-
 .../java/org/apache/james/imap/decode/parser/NoopCommandParser.java | 2 +-
 .../org/apache/james/imap/decode/parser/RenameCommandParser.java    | 2 +-
 .../org/apache/james/imap/decode/parser/SearchCommandParser.java    | 2 +-
 .../org/apache/james/imap/decode/parser/SetACLCommandParser.java    | 2 +-
 .../apache/james/imap/decode/parser/SetAnnotationCommandParser.java | 2 +-
 .../org/apache/james/imap/decode/parser/SetQuotaCommandParser.java  | 2 +-
 .../org/apache/james/imap/decode/parser/StartTLSCommandParser.java  | 2 +-
 .../org/apache/james/imap/decode/parser/StatusCommandParser.java    | 2 +-
 .../org/apache/james/imap/decode/parser/StoreCommandParser.java     | 2 +-
 .../org/apache/james/imap/decode/parser/SubscribeCommandParser.java | 2 +-
 .../java/org/apache/james/imap/decode/parser/UidCommandParser.java  | 2 +-
 .../org/apache/james/imap/decode/parser/UnselectCommandParser.java  | 2 +-
 .../apache/james/imap/decode/parser/UnsubscribeCommandParser.java   | 2 +-
 .../org/apache/james/imap/encode/base/ImapResponseComposerImpl.java | 2 +-
 .../org/apache/james/{protocols => }/imap/utils/EolInputStream.java | 2 +-
 .../james/{protocols => }/imap/utils/FastByteArrayOutputStream.java | 2 +-
 .../james/{protocols => }/imap/utils/FixedLengthInputStream.java    | 2 +-
 .../imap/utils => imap/decode}/DecoderUtilsLocaleDateTest.java      | 2 +-
 .../{protocols/imap/utils => imap/decode}/DecoderUtilsTest.java     | 3 +--
 .../java/org/apache/james/imap/decode/FetchPartPathDecoderTest.java | 1 -
 .../org/apache/james/imap/decode/ImapRequestLineReaderTest.java     | 1 -
 .../java/org/apache/james/imap/decode/main/IdRangeParseTest.java    | 2 +-
 .../java/org/apache/james/imap/decode/parser/CopyParserTest.java    | 2 +-
 .../apache/james/imap/decode/parser/CreateCommandParserTest.java    | 2 +-
 .../imap/decode/parser/FetchCommandParserPartialFetchTest.java      | 2 +-
 .../james/imap/decode/parser/GetAnnotationCommandParserTest.java    | 2 +-
 .../org/apache/james/imap/decode/parser/GetQuotaParserTest.java     | 2 +-
 .../org/apache/james/imap/decode/parser/GetQuotaRootParserTest.java | 2 +-
 .../java/org/apache/james/imap/decode/parser/MoveParserTest.java    | 2 +-
 .../imap/decode/parser/SearchCommandParserAndParenthesesTest.java   | 2 +-
 .../imap/decode/parser/SearchCommandParserQuotedCharsetTest.java    | 2 +-
 .../james/imap/decode/parser/SearchCommandParserSearchKeyTest.java  | 2 +-
 .../imap/decode/parser/SearchCommandParserTopLevelAndTest.java      | 2 +-
 .../james/imap/decode/parser/SetAnnotationCommandParserTest.java    | 2 +-
 .../apache/james/imap/decode/parser/SetQuotaCommandParserTest.java  | 2 +-
 .../james/imapserver/netty/AbstractNettyImapRequestLineReader.java  | 2 +-
 .../apache/james/imapserver/netty/NettyImapRequestLineReader.java   | 4 ++--
 .../james/imapserver/netty/NettyStreamImapRequestLineReader.java    | 6 +++---
 72 files changed, 73 insertions(+), 81 deletions(-)

diff --git a/protocols/imap/src/main/java/org/apache/james/protocols/imap/utils/DecoderUtils.java b/protocols/imap/src/main/java/org/apache/james/imap/decode/DecoderUtils.java
similarity index 99%
rename from protocols/imap/src/main/java/org/apache/james/protocols/imap/utils/DecoderUtils.java
rename to protocols/imap/src/main/java/org/apache/james/imap/decode/DecoderUtils.java
index e819816..3ce137c 100644
--- a/protocols/imap/src/main/java/org/apache/james/protocols/imap/utils/DecoderUtils.java
+++ b/protocols/imap/src/main/java/org/apache/james/imap/decode/DecoderUtils.java
@@ -17,7 +17,7 @@
  * under the License.                                           *
  ****************************************************************/
 
-package org.apache.james.protocols.imap.utils;
+package org.apache.james.imap.decode;
 
 import java.util.Calendar;
 import java.util.Date;
@@ -29,7 +29,6 @@ import javax.mail.Flags;
 
 import org.apache.james.imap.api.display.HumanReadableText;
 import org.apache.james.imap.api.message.MessageFlags;
-import org.apache.james.protocols.imap.DecodingException;
 
 /**
  * Utility procedures.
diff --git a/protocols/imap/src/main/java/org/apache/james/protocols/imap/DecodingException.java b/protocols/imap/src/main/java/org/apache/james/imap/decode/DecodingException.java
similarity index 98%
rename from protocols/imap/src/main/java/org/apache/james/protocols/imap/DecodingException.java
rename to protocols/imap/src/main/java/org/apache/james/imap/decode/DecodingException.java
index 7abd964..db323ff 100644
--- a/protocols/imap/src/main/java/org/apache/james/protocols/imap/DecodingException.java
+++ b/protocols/imap/src/main/java/org/apache/james/imap/decode/DecodingException.java
@@ -17,7 +17,7 @@
  * under the License.                                           *
  ****************************************************************/
 
-package org.apache.james.protocols.imap;
+package org.apache.james.imap.decode;
 
 import java.io.IOException;
 
diff --git a/protocols/imap/src/main/java/org/apache/james/imap/decode/FetchPartPathDecoder.java b/protocols/imap/src/main/java/org/apache/james/imap/decode/FetchPartPathDecoder.java
index 3cbac01..ebc8099 100644
--- a/protocols/imap/src/main/java/org/apache/james/imap/decode/FetchPartPathDecoder.java
+++ b/protocols/imap/src/main/java/org/apache/james/imap/decode/FetchPartPathDecoder.java
@@ -23,7 +23,6 @@ import java.util.ArrayList;
 import java.util.List;
 
 import org.apache.james.imap.api.display.HumanReadableText;
-import org.apache.james.protocols.imap.DecodingException;
 
 public class FetchPartPathDecoder {
 
diff --git a/protocols/imap/src/main/java/org/apache/james/imap/decode/ImapRequestLineReader.java b/protocols/imap/src/main/java/org/apache/james/imap/decode/ImapRequestLineReader.java
index 121ec3b..233d450 100644
--- a/protocols/imap/src/main/java/org/apache/james/imap/decode/ImapRequestLineReader.java
+++ b/protocols/imap/src/main/java/org/apache/james/imap/decode/ImapRequestLineReader.java
@@ -42,10 +42,8 @@ import org.apache.james.imap.api.message.UidRange;
 import org.apache.james.imap.api.message.request.DayMonthYear;
 import org.apache.james.imap.api.process.ImapSession;
 import org.apache.james.imap.api.process.SearchResUtil;
+import org.apache.james.imap.utils.FastByteArrayOutputStream;
 import org.apache.james.mailbox.MessageUid;
-import org.apache.james.protocols.imap.DecodingException;
-import org.apache.james.protocols.imap.utils.DecoderUtils;
-import org.apache.james.protocols.imap.utils.FastByteArrayOutputStream;
 
 /**
  * Wraps the client input reader with a bunch of convenience methods, allowing
diff --git a/protocols/imap/src/main/java/org/apache/james/imap/decode/ImapRequestStreamLineReader.java b/protocols/imap/src/main/java/org/apache/james/imap/decode/ImapRequestStreamLineReader.java
index c00aae1..1b1114b 100644
--- a/protocols/imap/src/main/java/org/apache/james/imap/decode/ImapRequestStreamLineReader.java
+++ b/protocols/imap/src/main/java/org/apache/james/imap/decode/ImapRequestStreamLineReader.java
@@ -24,9 +24,8 @@ import java.io.InputStream;
 import java.io.OutputStream;
 
 import org.apache.james.imap.api.display.HumanReadableText;
-import org.apache.james.protocols.imap.DecodingException;
-import org.apache.james.protocols.imap.utils.EolInputStream;
-import org.apache.james.protocols.imap.utils.FixedLengthInputStream;
+import org.apache.james.imap.utils.EolInputStream;
+import org.apache.james.imap.utils.FixedLengthInputStream;
 
 /**
  * {@link ImapRequestLineReader} which use normal IO Streaming
diff --git a/protocols/imap/src/main/java/org/apache/james/imap/decode/base/AbstractImapCommandParser.java b/protocols/imap/src/main/java/org/apache/james/imap/decode/base/AbstractImapCommandParser.java
index babb6dc..a89f023 100644
--- a/protocols/imap/src/main/java/org/apache/james/imap/decode/base/AbstractImapCommandParser.java
+++ b/protocols/imap/src/main/java/org/apache/james/imap/decode/base/AbstractImapCommandParser.java
@@ -24,9 +24,9 @@ import org.apache.james.imap.api.ImapMessage;
 import org.apache.james.imap.api.display.HumanReadableText;
 import org.apache.james.imap.api.message.response.StatusResponseFactory;
 import org.apache.james.imap.api.process.ImapSession;
+import org.apache.james.imap.decode.DecodingException;
 import org.apache.james.imap.decode.ImapRequestLineReader;
 import org.apache.james.imap.decode.MessagingImapCommandParser;
-import org.apache.james.protocols.imap.DecodingException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
diff --git a/protocols/imap/src/main/java/org/apache/james/imap/decode/main/DefaultImapDecoder.java b/protocols/imap/src/main/java/org/apache/james/imap/decode/main/DefaultImapDecoder.java
index a89b2b9..b8095d7 100644
--- a/protocols/imap/src/main/java/org/apache/james/imap/decode/main/DefaultImapDecoder.java
+++ b/protocols/imap/src/main/java/org/apache/james/imap/decode/main/DefaultImapDecoder.java
@@ -23,11 +23,11 @@ import org.apache.james.imap.api.ImapSessionState;
 import org.apache.james.imap.api.display.HumanReadableText;
 import org.apache.james.imap.api.message.response.StatusResponseFactory;
 import org.apache.james.imap.api.process.ImapSession;
+import org.apache.james.imap.decode.DecodingException;
 import org.apache.james.imap.decode.ImapCommandParser;
 import org.apache.james.imap.decode.ImapCommandParserFactory;
 import org.apache.james.imap.decode.ImapDecoder;
 import org.apache.james.imap.decode.ImapRequestLineReader;
-import org.apache.james.protocols.imap.DecodingException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
diff --git a/protocols/imap/src/main/java/org/apache/james/imap/decode/main/ImapRequestStreamHandler.java b/protocols/imap/src/main/java/org/apache/james/imap/decode/main/ImapRequestStreamHandler.java
index f720a6a..ce8567b 100644
--- a/protocols/imap/src/main/java/org/apache/james/imap/decode/main/ImapRequestStreamHandler.java
+++ b/protocols/imap/src/main/java/org/apache/james/imap/decode/main/ImapRequestStreamHandler.java
@@ -26,6 +26,7 @@ import java.io.OutputStream;
 import org.apache.james.imap.api.ImapSessionState;
 import org.apache.james.imap.api.process.ImapProcessor;
 import org.apache.james.imap.api.process.ImapSession;
+import org.apache.james.imap.decode.DecodingException;
 import org.apache.james.imap.decode.ImapDecoder;
 import org.apache.james.imap.decode.ImapRequestLineReader;
 import org.apache.james.imap.decode.ImapRequestStreamLineReader;
@@ -33,7 +34,6 @@ import org.apache.james.imap.encode.ImapEncoder;
 import org.apache.james.imap.encode.base.ImapResponseComposerImpl;
 import org.apache.james.imap.main.AbstractImapRequestHandler;
 import org.apache.james.imap.message.request.SystemMessage;
-import org.apache.james.protocols.imap.DecodingException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
diff --git a/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/AbstractMessageRangeCommandParser.java b/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/AbstractMessageRangeCommandParser.java
index 0970406..11642c8 100644
--- a/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/AbstractMessageRangeCommandParser.java
+++ b/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/AbstractMessageRangeCommandParser.java
@@ -23,9 +23,9 @@ import org.apache.james.imap.api.ImapCommand;
 import org.apache.james.imap.api.ImapMessage;
 import org.apache.james.imap.api.message.IdRange;
 import org.apache.james.imap.api.process.ImapSession;
+import org.apache.james.imap.decode.DecodingException;
 import org.apache.james.imap.decode.ImapRequestLineReader;
 import org.apache.james.imap.message.request.AbstractMessageRangeRequest;
-import org.apache.james.protocols.imap.DecodingException;
 
 public abstract class AbstractMessageRangeCommandParser extends AbstractUidCommandParser {
 
diff --git a/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/AbstractSelectionCommandParser.java b/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/AbstractSelectionCommandParser.java
index d83a855..59bf7aa 100644
--- a/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/AbstractSelectionCommandParser.java
+++ b/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/AbstractSelectionCommandParser.java
@@ -25,12 +25,12 @@ import org.apache.james.imap.api.display.HumanReadableText;
 import org.apache.james.imap.api.message.IdRange;
 import org.apache.james.imap.api.message.UidRange;
 import org.apache.james.imap.api.process.ImapSession;
+import org.apache.james.imap.decode.DecodingException;
 import org.apache.james.imap.decode.ImapRequestLineReader;
 import org.apache.james.imap.decode.ImapRequestLineReader.CharacterValidator;
 import org.apache.james.imap.decode.base.AbstractImapCommandParser;
 import org.apache.james.imap.message.request.AbstractMailboxSelectionRequest;
 import org.apache.james.mailbox.MessageUid;
-import org.apache.james.protocols.imap.DecodingException;
 
 public abstract class AbstractSelectionCommandParser extends AbstractImapCommandParser {
     private static final byte[] CONDSTORE = ImapConstants.SUPPORTS_CONDSTORE.getBytes();
diff --git a/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/AbstractUidCommandParser.java b/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/AbstractUidCommandParser.java
index e845d66..cf48876 100644
--- a/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/AbstractUidCommandParser.java
+++ b/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/AbstractUidCommandParser.java
@@ -22,9 +22,9 @@ package org.apache.james.imap.decode.parser;
 import org.apache.james.imap.api.ImapCommand;
 import org.apache.james.imap.api.ImapMessage;
 import org.apache.james.imap.api.process.ImapSession;
+import org.apache.james.imap.decode.DecodingException;
 import org.apache.james.imap.decode.ImapRequestLineReader;
 import org.apache.james.imap.decode.base.AbstractImapCommandParser;
-import org.apache.james.protocols.imap.DecodingException;
 
 abstract class AbstractUidCommandParser extends AbstractImapCommandParser {
 
diff --git a/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/AppendCommandParser.java b/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/AppendCommandParser.java
index c15b307..52a09c2 100644
--- a/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/AppendCommandParser.java
+++ b/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/AppendCommandParser.java
@@ -26,10 +26,10 @@ import org.apache.james.imap.api.ImapCommand;
 import org.apache.james.imap.api.ImapConstants;
 import org.apache.james.imap.api.ImapMessage;
 import org.apache.james.imap.api.process.ImapSession;
+import org.apache.james.imap.decode.DecodingException;
 import org.apache.james.imap.decode.ImapRequestLineReader;
 import org.apache.james.imap.decode.base.AbstractImapCommandParser;
 import org.apache.james.imap.message.request.AppendRequest;
-import org.apache.james.protocols.imap.DecodingException;
 
 /**
  * Parses APPEND command
diff --git a/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/AuthenticateCommandParser.java b/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/AuthenticateCommandParser.java
index a7058ce..dcaa3ca 100644
--- a/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/AuthenticateCommandParser.java
+++ b/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/AuthenticateCommandParser.java
@@ -22,11 +22,11 @@ import org.apache.james.imap.api.ImapCommand;
 import org.apache.james.imap.api.ImapConstants;
 import org.apache.james.imap.api.ImapMessage;
 import org.apache.james.imap.api.process.ImapSession;
+import org.apache.james.imap.decode.DecodingException;
 import org.apache.james.imap.decode.ImapRequestLineReader;
 import org.apache.james.imap.decode.base.AbstractImapCommandParser;
 import org.apache.james.imap.message.request.AuthenticateRequest;
 import org.apache.james.imap.message.request.IRAuthenticateRequest;
-import org.apache.james.protocols.imap.DecodingException;
 
 /**
  * Parses AUTHENTICATE commands and also support SASL-IR (RFC4959)
diff --git a/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/CapabilityCommandParser.java b/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/CapabilityCommandParser.java
index efc667d..69f9378 100644
--- a/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/CapabilityCommandParser.java
+++ b/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/CapabilityCommandParser.java
@@ -22,10 +22,10 @@ import org.apache.james.imap.api.ImapCommand;
 import org.apache.james.imap.api.ImapConstants;
 import org.apache.james.imap.api.ImapMessage;
 import org.apache.james.imap.api.process.ImapSession;
+import org.apache.james.imap.decode.DecodingException;
 import org.apache.james.imap.decode.ImapRequestLineReader;
 import org.apache.james.imap.decode.base.AbstractImapCommandParser;
 import org.apache.james.imap.message.request.CapabilityRequest;
-import org.apache.james.protocols.imap.DecodingException;
 
 /**
  * Parses CAPABILITY commands
diff --git a/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/CheckCommandParser.java b/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/CheckCommandParser.java
index af447f7..3b249b4 100644
--- a/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/CheckCommandParser.java
+++ b/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/CheckCommandParser.java
@@ -22,10 +22,10 @@ import org.apache.james.imap.api.ImapCommand;
 import org.apache.james.imap.api.ImapConstants;
 import org.apache.james.imap.api.ImapMessage;
 import org.apache.james.imap.api.process.ImapSession;
+import org.apache.james.imap.decode.DecodingException;
 import org.apache.james.imap.decode.ImapRequestLineReader;
 import org.apache.james.imap.decode.base.AbstractImapCommandParser;
 import org.apache.james.imap.message.request.CheckRequest;
-import org.apache.james.protocols.imap.DecodingException;
 
 /**
  * Parses CHECK commands
diff --git a/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/CloseCommandParser.java b/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/CloseCommandParser.java
index 585db77..a130a23 100644
--- a/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/CloseCommandParser.java
+++ b/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/CloseCommandParser.java
@@ -22,10 +22,10 @@ import org.apache.james.imap.api.ImapCommand;
 import org.apache.james.imap.api.ImapConstants;
 import org.apache.james.imap.api.ImapMessage;
 import org.apache.james.imap.api.process.ImapSession;
+import org.apache.james.imap.decode.DecodingException;
 import org.apache.james.imap.decode.ImapRequestLineReader;
 import org.apache.james.imap.decode.base.AbstractImapCommandParser;
 import org.apache.james.imap.message.request.CloseRequest;
-import org.apache.james.protocols.imap.DecodingException;
 
 /**
  * Parse CLOSE commands
diff --git a/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/CompressCommandParser.java b/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/CompressCommandParser.java
index 15f5f94..c9681f3 100644
--- a/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/CompressCommandParser.java
+++ b/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/CompressCommandParser.java
@@ -22,10 +22,10 @@ import org.apache.james.imap.api.ImapCommand;
 import org.apache.james.imap.api.ImapConstants;
 import org.apache.james.imap.api.ImapMessage;
 import org.apache.james.imap.api.process.ImapSession;
+import org.apache.james.imap.decode.DecodingException;
 import org.apache.james.imap.decode.ImapRequestLineReader;
 import org.apache.james.imap.decode.base.AbstractImapCommandParser;
 import org.apache.james.imap.message.request.CompressRequest;
-import org.apache.james.protocols.imap.DecodingException;
 
 public class CompressCommandParser extends AbstractImapCommandParser {
 
diff --git a/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/CreateCommandParser.java b/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/CreateCommandParser.java
index 55ca7c6..9752423 100644
--- a/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/CreateCommandParser.java
+++ b/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/CreateCommandParser.java
@@ -24,11 +24,11 @@ import org.apache.james.imap.api.ImapMessage;
 import org.apache.james.imap.api.ImapSessionUtils;
 import org.apache.james.imap.api.display.HumanReadableText;
 import org.apache.james.imap.api.process.ImapSession;
+import org.apache.james.imap.decode.DecodingException;
 import org.apache.james.imap.decode.ImapRequestLineReader;
 import org.apache.james.imap.decode.base.AbstractImapCommandParser;
 import org.apache.james.imap.message.request.CreateRequest;
 import org.apache.james.mailbox.MailboxSession;
-import org.apache.james.protocols.imap.DecodingException;
 
 import com.google.common.base.Splitter;
 import com.google.common.base.Strings;
diff --git a/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/DeleteACLCommandParser.java b/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/DeleteACLCommandParser.java
index 61bb63c..f5fa22e 100644
--- a/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/DeleteACLCommandParser.java
+++ b/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/DeleteACLCommandParser.java
@@ -23,10 +23,10 @@ import org.apache.james.imap.api.ImapCommand;
 import org.apache.james.imap.api.ImapConstants;
 import org.apache.james.imap.api.ImapMessage;
 import org.apache.james.imap.api.process.ImapSession;
+import org.apache.james.imap.decode.DecodingException;
 import org.apache.james.imap.decode.ImapRequestLineReader;
 import org.apache.james.imap.decode.base.AbstractImapCommandParser;
 import org.apache.james.imap.message.request.DeleteACLRequest;
-import org.apache.james.protocols.imap.DecodingException;
 
 /**
  * DELETEACL Parser
diff --git a/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/DeleteCommandParser.java b/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/DeleteCommandParser.java
index 5e3e75f..a0a99cd 100644
--- a/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/DeleteCommandParser.java
+++ b/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/DeleteCommandParser.java
@@ -22,10 +22,10 @@ import org.apache.james.imap.api.ImapCommand;
 import org.apache.james.imap.api.ImapConstants;
 import org.apache.james.imap.api.ImapMessage;
 import org.apache.james.imap.api.process.ImapSession;
+import org.apache.james.imap.decode.DecodingException;
 import org.apache.james.imap.decode.ImapRequestLineReader;
 import org.apache.james.imap.decode.base.AbstractImapCommandParser;
 import org.apache.james.imap.message.request.DeleteRequest;
-import org.apache.james.protocols.imap.DecodingException;
 
 /**
  * Parse DELETE commands
diff --git a/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/EnableCommandParser.java b/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/EnableCommandParser.java
index 7b747af..dca83f3 100644
--- a/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/EnableCommandParser.java
+++ b/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/EnableCommandParser.java
@@ -26,10 +26,10 @@ import org.apache.james.imap.api.ImapCommand;
 import org.apache.james.imap.api.ImapConstants;
 import org.apache.james.imap.api.ImapMessage;
 import org.apache.james.imap.api.process.ImapSession;
+import org.apache.james.imap.decode.DecodingException;
 import org.apache.james.imap.decode.ImapRequestLineReader;
 import org.apache.james.imap.decode.base.AbstractImapCommandParser;
 import org.apache.james.imap.message.request.EnableRequest;
-import org.apache.james.protocols.imap.DecodingException;
 
 public class EnableCommandParser extends AbstractImapCommandParser {
     
diff --git a/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/ExpungeCommandParser.java b/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/ExpungeCommandParser.java
index a004646..afbc48c 100644
--- a/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/ExpungeCommandParser.java
+++ b/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/ExpungeCommandParser.java
@@ -23,9 +23,9 @@ import org.apache.james.imap.api.ImapConstants;
 import org.apache.james.imap.api.ImapMessage;
 import org.apache.james.imap.api.message.IdRange;
 import org.apache.james.imap.api.process.ImapSession;
+import org.apache.james.imap.decode.DecodingException;
 import org.apache.james.imap.decode.ImapRequestLineReader;
 import org.apache.james.imap.message.request.ExpungeRequest;
-import org.apache.james.protocols.imap.DecodingException;
 
 /**
  * Parse EXPUNGE commands
diff --git a/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/FetchCommandParser.java b/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/FetchCommandParser.java
index a061d7f..65c5929 100644
--- a/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/FetchCommandParser.java
+++ b/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/FetchCommandParser.java
@@ -28,11 +28,11 @@ import org.apache.james.imap.api.message.BodyFetchElement;
 import org.apache.james.imap.api.message.FetchData;
 import org.apache.james.imap.api.message.IdRange;
 import org.apache.james.imap.api.process.ImapSession;
+import org.apache.james.imap.decode.DecodingException;
 import org.apache.james.imap.decode.FetchPartPathDecoder;
 import org.apache.james.imap.decode.ImapRequestLineReader;
 import org.apache.james.imap.decode.ImapRequestLineReader.CharacterValidator;
 import org.apache.james.imap.message.request.FetchRequest;
-import org.apache.james.protocols.imap.DecodingException;
 
 /**
  * Parse FETCH commands
diff --git a/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/GetACLCommandParser.java b/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/GetACLCommandParser.java
index 7f6b168..da5e3f1 100644
--- a/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/GetACLCommandParser.java
+++ b/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/GetACLCommandParser.java
@@ -23,10 +23,10 @@ import org.apache.james.imap.api.ImapCommand;
 import org.apache.james.imap.api.ImapConstants;
 import org.apache.james.imap.api.ImapMessage;
 import org.apache.james.imap.api.process.ImapSession;
+import org.apache.james.imap.decode.DecodingException;
 import org.apache.james.imap.decode.ImapRequestLineReader;
 import org.apache.james.imap.decode.base.AbstractImapCommandParser;
 import org.apache.james.imap.message.request.GetACLRequest;
-import org.apache.james.protocols.imap.DecodingException;
 
 /**
  * GETACL Parser
diff --git a/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/GetAnnotationCommandParser.java b/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/GetAnnotationCommandParser.java
index 1e32fac..153b7a3 100644
--- a/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/GetAnnotationCommandParser.java
+++ b/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/GetAnnotationCommandParser.java
@@ -26,12 +26,12 @@ import org.apache.james.imap.api.ImapConstants;
 import org.apache.james.imap.api.ImapMessage;
 import org.apache.james.imap.api.display.HumanReadableText;
 import org.apache.james.imap.api.process.ImapSession;
+import org.apache.james.imap.decode.DecodingException;
 import org.apache.james.imap.decode.ImapRequestLineReader;
 import org.apache.james.imap.decode.base.AbstractImapCommandParser;
 import org.apache.james.imap.message.request.GetAnnotationRequest;
 import org.apache.james.imap.message.request.GetAnnotationRequest.Depth;
 import org.apache.james.mailbox.model.MailboxAnnotationKey;
-import org.apache.james.protocols.imap.DecodingException;
 
 import com.google.common.base.CharMatcher;
 import com.google.common.collect.ImmutableSet;
diff --git a/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/GetQuotaCommandParser.java b/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/GetQuotaCommandParser.java
index 76980c5..a216561 100644
--- a/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/GetQuotaCommandParser.java
+++ b/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/GetQuotaCommandParser.java
@@ -23,10 +23,10 @@ import org.apache.james.imap.api.ImapCommand;
 import org.apache.james.imap.api.ImapConstants;
 import org.apache.james.imap.api.ImapMessage;
 import org.apache.james.imap.api.process.ImapSession;
+import org.apache.james.imap.decode.DecodingException;
 import org.apache.james.imap.decode.ImapRequestLineReader;
 import org.apache.james.imap.decode.base.AbstractImapCommandParser;
 import org.apache.james.imap.message.request.GetQuotaRequest;
-import org.apache.james.protocols.imap.DecodingException;
 
 /**
  * GETQUOTA command parser
diff --git a/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/GetQuotaRootCommandParser.java b/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/GetQuotaRootCommandParser.java
index 5737290..9c051ca 100644
--- a/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/GetQuotaRootCommandParser.java
+++ b/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/GetQuotaRootCommandParser.java
@@ -23,10 +23,10 @@ import org.apache.james.imap.api.ImapCommand;
 import org.apache.james.imap.api.ImapConstants;
 import org.apache.james.imap.api.ImapMessage;
 import org.apache.james.imap.api.process.ImapSession;
+import org.apache.james.imap.decode.DecodingException;
 import org.apache.james.imap.decode.ImapRequestLineReader;
 import org.apache.james.imap.decode.base.AbstractImapCommandParser;
 import org.apache.james.imap.message.request.GetQuotaRootRequest;
-import org.apache.james.protocols.imap.DecodingException;
 
 /**
  * Get Quota root command parser
diff --git a/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/IdleCommandParser.java b/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/IdleCommandParser.java
index ecf43bd..91d33c8 100644
--- a/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/IdleCommandParser.java
+++ b/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/IdleCommandParser.java
@@ -22,10 +22,10 @@ import org.apache.james.imap.api.ImapCommand;
 import org.apache.james.imap.api.ImapConstants;
 import org.apache.james.imap.api.ImapMessage;
 import org.apache.james.imap.api.process.ImapSession;
+import org.apache.james.imap.decode.DecodingException;
 import org.apache.james.imap.decode.ImapRequestLineReader;
 import org.apache.james.imap.decode.base.AbstractImapCommandParser;
 import org.apache.james.imap.message.request.IdleRequest;
-import org.apache.james.protocols.imap.DecodingException;
 
 /**
  * Parses IDLE commands
diff --git a/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/ListCommandParser.java b/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/ListCommandParser.java
index b5f7f9a..569a815 100644
--- a/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/ListCommandParser.java
+++ b/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/ListCommandParser.java
@@ -22,10 +22,10 @@ import org.apache.james.imap.api.ImapCommand;
 import org.apache.james.imap.api.ImapConstants;
 import org.apache.james.imap.api.ImapMessage;
 import org.apache.james.imap.api.process.ImapSession;
+import org.apache.james.imap.decode.DecodingException;
 import org.apache.james.imap.decode.ImapRequestLineReader;
 import org.apache.james.imap.decode.ImapRequestLineReader.AtomCharValidator;
 import org.apache.james.imap.message.request.ListRequest;
-import org.apache.james.protocols.imap.DecodingException;
 
 /**
  * Parse LIST commands
diff --git a/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/ListRightsCommandParser.java b/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/ListRightsCommandParser.java
index 2fa89d5..ef1437b 100644
--- a/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/ListRightsCommandParser.java
+++ b/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/ListRightsCommandParser.java
@@ -23,10 +23,10 @@ import org.apache.james.imap.api.ImapCommand;
 import org.apache.james.imap.api.ImapConstants;
 import org.apache.james.imap.api.ImapMessage;
 import org.apache.james.imap.api.process.ImapSession;
+import org.apache.james.imap.decode.DecodingException;
 import org.apache.james.imap.decode.ImapRequestLineReader;
 import org.apache.james.imap.decode.base.AbstractImapCommandParser;
 import org.apache.james.imap.message.request.ListRightsRequest;
-import org.apache.james.protocols.imap.DecodingException;
 
 /**
  * LISTRIGHTS Parser
diff --git a/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/LoginCommandParser.java b/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/LoginCommandParser.java
index dc02f54..fd9de6d 100644
--- a/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/LoginCommandParser.java
+++ b/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/LoginCommandParser.java
@@ -22,10 +22,10 @@ import org.apache.james.imap.api.ImapCommand;
 import org.apache.james.imap.api.ImapConstants;
 import org.apache.james.imap.api.ImapMessage;
 import org.apache.james.imap.api.process.ImapSession;
+import org.apache.james.imap.decode.DecodingException;
 import org.apache.james.imap.decode.ImapRequestLineReader;
 import org.apache.james.imap.decode.base.AbstractImapCommandParser;
 import org.apache.james.imap.message.request.LoginRequest;
-import org.apache.james.protocols.imap.DecodingException;
 
 /**
  * Parse LOGIN commands
diff --git a/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/LogoutCommandParser.java b/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/LogoutCommandParser.java
index 8cf0705..23b94fd 100644
--- a/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/LogoutCommandParser.java
+++ b/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/LogoutCommandParser.java
@@ -22,10 +22,10 @@ import org.apache.james.imap.api.ImapCommand;
 import org.apache.james.imap.api.ImapConstants;
 import org.apache.james.imap.api.ImapMessage;
 import org.apache.james.imap.api.process.ImapSession;
+import org.apache.james.imap.decode.DecodingException;
 import org.apache.james.imap.decode.ImapRequestLineReader;
 import org.apache.james.imap.decode.base.AbstractImapCommandParser;
 import org.apache.james.imap.message.request.LogoutRequest;
-import org.apache.james.protocols.imap.DecodingException;
 
 /**
  * Parse LOGOUT commands
diff --git a/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/MyRightsCommandParser.java b/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/MyRightsCommandParser.java
index e289f80..c52ebfe 100644
--- a/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/MyRightsCommandParser.java
+++ b/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/MyRightsCommandParser.java
@@ -23,10 +23,10 @@ import org.apache.james.imap.api.ImapCommand;
 import org.apache.james.imap.api.ImapConstants;
 import org.apache.james.imap.api.ImapMessage;
 import org.apache.james.imap.api.process.ImapSession;
+import org.apache.james.imap.decode.DecodingException;
 import org.apache.james.imap.decode.ImapRequestLineReader;
 import org.apache.james.imap.decode.base.AbstractImapCommandParser;
 import org.apache.james.imap.message.request.MyRightsRequest;
-import org.apache.james.protocols.imap.DecodingException;
 
 /**
  * MYRIGHTS Parser
diff --git a/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/NamespaceCommandParser.java b/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/NamespaceCommandParser.java
index a3aeb52..2901173 100644
--- a/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/NamespaceCommandParser.java
+++ b/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/NamespaceCommandParser.java
@@ -22,10 +22,10 @@ import org.apache.james.imap.api.ImapCommand;
 import org.apache.james.imap.api.ImapConstants;
 import org.apache.james.imap.api.ImapMessage;
 import org.apache.james.imap.api.process.ImapSession;
+import org.apache.james.imap.decode.DecodingException;
 import org.apache.james.imap.decode.ImapRequestLineReader;
 import org.apache.james.imap.decode.base.AbstractImapCommandParser;
 import org.apache.james.imap.message.request.NamespaceRequest;
-import org.apache.james.protocols.imap.DecodingException;
 
 /**
  * Parse NAMESPACE commands
diff --git a/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/NoopCommandParser.java b/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/NoopCommandParser.java
index 6632089..d79cded 100644
--- a/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/NoopCommandParser.java
+++ b/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/NoopCommandParser.java
@@ -22,10 +22,10 @@ import org.apache.james.imap.api.ImapCommand;
 import org.apache.james.imap.api.ImapConstants;
 import org.apache.james.imap.api.ImapMessage;
 import org.apache.james.imap.api.process.ImapSession;
+import org.apache.james.imap.decode.DecodingException;
 import org.apache.james.imap.decode.ImapRequestLineReader;
 import org.apache.james.imap.decode.base.AbstractImapCommandParser;
 import org.apache.james.imap.message.request.NoopRequest;
-import org.apache.james.protocols.imap.DecodingException;
 
 /**
  * Parses NOOP commands
diff --git a/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/RenameCommandParser.java b/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/RenameCommandParser.java
index 692e040..39cba01 100644
--- a/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/RenameCommandParser.java
+++ b/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/RenameCommandParser.java
@@ -22,10 +22,10 @@ import org.apache.james.imap.api.ImapCommand;
 import org.apache.james.imap.api.ImapConstants;
 import org.apache.james.imap.api.ImapMessage;
 import org.apache.james.imap.api.process.ImapSession;
+import org.apache.james.imap.decode.DecodingException;
 import org.apache.james.imap.decode.ImapRequestLineReader;
 import org.apache.james.imap.decode.base.AbstractImapCommandParser;
 import org.apache.james.imap.message.request.RenameRequest;
-import org.apache.james.protocols.imap.DecodingException;
 
 /**
  * Parses RENAME command
diff --git a/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/SearchCommandParser.java b/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/SearchCommandParser.java
index 1724e73..22dc639 100644
--- a/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/SearchCommandParser.java
+++ b/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/SearchCommandParser.java
@@ -40,9 +40,9 @@ import org.apache.james.imap.api.message.response.StatusResponse;
 import org.apache.james.imap.api.message.response.StatusResponse.ResponseCode;
 import org.apache.james.imap.api.message.response.StatusResponseFactory;
 import org.apache.james.imap.api.process.ImapSession;
+import org.apache.james.imap.decode.DecodingException;
 import org.apache.james.imap.decode.ImapRequestLineReader;
 import org.apache.james.imap.message.request.SearchRequest;
-import org.apache.james.protocols.imap.DecodingException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
diff --git a/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/SetACLCommandParser.java b/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/SetACLCommandParser.java
index bcbdc94..bb692cf 100644
--- a/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/SetACLCommandParser.java
+++ b/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/SetACLCommandParser.java
@@ -23,10 +23,10 @@ import org.apache.james.imap.api.ImapCommand;
 import org.apache.james.imap.api.ImapConstants;
 import org.apache.james.imap.api.ImapMessage;
 import org.apache.james.imap.api.process.ImapSession;
+import org.apache.james.imap.decode.DecodingException;
 import org.apache.james.imap.decode.ImapRequestLineReader;
 import org.apache.james.imap.decode.base.AbstractImapCommandParser;
 import org.apache.james.imap.message.request.SetACLRequest;
-import org.apache.james.protocols.imap.DecodingException;
 
 /**
  * SETACL Parser
diff --git a/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/SetAnnotationCommandParser.java b/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/SetAnnotationCommandParser.java
index b7ea830..1de124d 100644
--- a/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/SetAnnotationCommandParser.java
+++ b/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/SetAnnotationCommandParser.java
@@ -27,12 +27,12 @@ import org.apache.james.imap.api.ImapConstants;
 import org.apache.james.imap.api.ImapMessage;
 import org.apache.james.imap.api.display.HumanReadableText;
 import org.apache.james.imap.api.process.ImapSession;
+import org.apache.james.imap.decode.DecodingException;
 import org.apache.james.imap.decode.ImapRequestLineReader;
 import org.apache.james.imap.decode.base.AbstractImapCommandParser;
 import org.apache.james.imap.message.request.SetAnnotationRequest;
 import org.apache.james.mailbox.model.MailboxAnnotation;
 import org.apache.james.mailbox.model.MailboxAnnotationKey;
-import org.apache.james.protocols.imap.DecodingException;
 
 import com.google.common.collect.ImmutableList;
 
diff --git a/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/SetQuotaCommandParser.java b/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/SetQuotaCommandParser.java
index ee081d4..42f5e6a 100644
--- a/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/SetQuotaCommandParser.java
+++ b/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/SetQuotaCommandParser.java
@@ -23,10 +23,10 @@ import org.apache.james.imap.api.ImapCommand;
 import org.apache.james.imap.api.ImapConstants;
 import org.apache.james.imap.api.ImapMessage;
 import org.apache.james.imap.api.process.ImapSession;
+import org.apache.james.imap.decode.DecodingException;
 import org.apache.james.imap.decode.ImapRequestLineReader;
 import org.apache.james.imap.decode.base.AbstractImapCommandParser;
 import org.apache.james.imap.message.request.SetQuotaRequest;
-import org.apache.james.protocols.imap.DecodingException;
 
 /**
  * SETQUOTA command parser
diff --git a/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/StartTLSCommandParser.java b/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/StartTLSCommandParser.java
index 8cd9e74..990ac5b 100644
--- a/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/StartTLSCommandParser.java
+++ b/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/StartTLSCommandParser.java
@@ -22,10 +22,10 @@ import org.apache.james.imap.api.ImapCommand;
 import org.apache.james.imap.api.ImapConstants;
 import org.apache.james.imap.api.ImapMessage;
 import org.apache.james.imap.api.process.ImapSession;
+import org.apache.james.imap.decode.DecodingException;
 import org.apache.james.imap.decode.ImapRequestLineReader;
 import org.apache.james.imap.decode.base.AbstractImapCommandParser;
 import org.apache.james.imap.message.request.StartTLSRequest;
-import org.apache.james.protocols.imap.DecodingException;
 
 /**
  * Parse STARTTLS commands
diff --git a/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/StatusCommandParser.java b/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/StatusCommandParser.java
index 33e1b85..6157c97 100644
--- a/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/StatusCommandParser.java
+++ b/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/StatusCommandParser.java
@@ -24,11 +24,11 @@ import org.apache.james.imap.api.ImapMessage;
 import org.apache.james.imap.api.display.HumanReadableText;
 import org.apache.james.imap.api.message.StatusDataItems;
 import org.apache.james.imap.api.process.ImapSession;
+import org.apache.james.imap.decode.DecodingException;
 import org.apache.james.imap.decode.ImapRequestLineReader;
 import org.apache.james.imap.decode.ImapRequestLineReader.CharacterValidator;
 import org.apache.james.imap.decode.base.AbstractImapCommandParser;
 import org.apache.james.imap.message.request.StatusRequest;
-import org.apache.james.protocols.imap.DecodingException;
 
 /**
  * Parse STATUS commands
diff --git a/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/StoreCommandParser.java b/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/StoreCommandParser.java
index 1e320f0..b5c7460 100644
--- a/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/StoreCommandParser.java
+++ b/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/StoreCommandParser.java
@@ -26,10 +26,10 @@ import org.apache.james.imap.api.ImapMessage;
 import org.apache.james.imap.api.display.HumanReadableText;
 import org.apache.james.imap.api.message.IdRange;
 import org.apache.james.imap.api.process.ImapSession;
+import org.apache.james.imap.decode.DecodingException;
 import org.apache.james.imap.decode.ImapRequestLineReader;
 import org.apache.james.imap.decode.ImapRequestLineReader.CharacterValidator;
 import org.apache.james.imap.message.request.StoreRequest;
-import org.apache.james.protocols.imap.DecodingException;
 
 /**
  * Parse STORE commands
diff --git a/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/SubscribeCommandParser.java b/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/SubscribeCommandParser.java
index 4b5573c..f3829de 100644
--- a/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/SubscribeCommandParser.java
+++ b/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/SubscribeCommandParser.java
@@ -22,10 +22,10 @@ import org.apache.james.imap.api.ImapCommand;
 import org.apache.james.imap.api.ImapConstants;
 import org.apache.james.imap.api.ImapMessage;
 import org.apache.james.imap.api.process.ImapSession;
+import org.apache.james.imap.decode.DecodingException;
 import org.apache.james.imap.decode.ImapRequestLineReader;
 import org.apache.james.imap.decode.base.AbstractImapCommandParser;
 import org.apache.james.imap.message.request.SubscribeRequest;
-import org.apache.james.protocols.imap.DecodingException;
 
 /**
  * Parse SUBSCRIBE commands
diff --git a/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/UidCommandParser.java b/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/UidCommandParser.java
index aad0faa..8865bf5 100644
--- a/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/UidCommandParser.java
+++ b/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/UidCommandParser.java
@@ -23,12 +23,12 @@ import org.apache.james.imap.api.ImapConstants;
 import org.apache.james.imap.api.ImapMessage;
 import org.apache.james.imap.api.display.HumanReadableText;
 import org.apache.james.imap.api.process.ImapSession;
+import org.apache.james.imap.decode.DecodingException;
 import org.apache.james.imap.decode.DelegatingImapCommandParser;
 import org.apache.james.imap.decode.ImapCommandParser;
 import org.apache.james.imap.decode.ImapCommandParserFactory;
 import org.apache.james.imap.decode.ImapRequestLineReader;
 import org.apache.james.imap.decode.base.AbstractImapCommandParser;
-import org.apache.james.protocols.imap.DecodingException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
diff --git a/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/UnselectCommandParser.java b/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/UnselectCommandParser.java
index 78481e3..b0dcc7f 100644
--- a/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/UnselectCommandParser.java
+++ b/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/UnselectCommandParser.java
@@ -22,10 +22,10 @@ import org.apache.james.imap.api.ImapCommand;
 import org.apache.james.imap.api.ImapConstants;
 import org.apache.james.imap.api.ImapMessage;
 import org.apache.james.imap.api.process.ImapSession;
+import org.apache.james.imap.decode.DecodingException;
 import org.apache.james.imap.decode.ImapRequestLineReader;
 import org.apache.james.imap.decode.base.AbstractImapCommandParser;
 import org.apache.james.imap.message.request.UnselectRequest;
-import org.apache.james.protocols.imap.DecodingException;
 
 /**
  * Parse UNSELECT commands
diff --git a/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/UnsubscribeCommandParser.java b/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/UnsubscribeCommandParser.java
index eed5bdf..7f69bbd 100644
--- a/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/UnsubscribeCommandParser.java
+++ b/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/UnsubscribeCommandParser.java
@@ -22,10 +22,10 @@ import org.apache.james.imap.api.ImapCommand;
 import org.apache.james.imap.api.ImapConstants;
 import org.apache.james.imap.api.ImapMessage;
 import org.apache.james.imap.api.process.ImapSession;
+import org.apache.james.imap.decode.DecodingException;
 import org.apache.james.imap.decode.ImapRequestLineReader;
 import org.apache.james.imap.decode.base.AbstractImapCommandParser;
 import org.apache.james.imap.message.request.UnsubscribeRequest;
-import org.apache.james.protocols.imap.DecodingException;
 
 /**
  * Parse UNSUBSCRIBE commands
diff --git a/protocols/imap/src/main/java/org/apache/james/imap/encode/base/ImapResponseComposerImpl.java b/protocols/imap/src/main/java/org/apache/james/imap/encode/base/ImapResponseComposerImpl.java
index 5707af5..ce7e575 100644
--- a/protocols/imap/src/main/java/org/apache/james/imap/encode/base/ImapResponseComposerImpl.java
+++ b/protocols/imap/src/main/java/org/apache/james/imap/encode/base/ImapResponseComposerImpl.java
@@ -32,7 +32,7 @@ import org.apache.james.imap.api.message.UidRange;
 import org.apache.james.imap.encode.ImapResponseComposer;
 import org.apache.james.imap.encode.ImapResponseWriter;
 import org.apache.james.imap.message.response.Literal;
-import org.apache.james.protocols.imap.utils.FastByteArrayOutputStream;
+import org.apache.james.imap.utils.FastByteArrayOutputStream;
 
 /**
  * Class providing methods to send response messages from the server to the
diff --git a/protocols/imap/src/main/java/org/apache/james/protocols/imap/utils/EolInputStream.java b/protocols/imap/src/main/java/org/apache/james/imap/utils/EolInputStream.java
similarity index 98%
rename from protocols/imap/src/main/java/org/apache/james/protocols/imap/utils/EolInputStream.java
rename to protocols/imap/src/main/java/org/apache/james/imap/utils/EolInputStream.java
index 53b8134..a7cc6db 100644
--- a/protocols/imap/src/main/java/org/apache/james/protocols/imap/utils/EolInputStream.java
+++ b/protocols/imap/src/main/java/org/apache/james/imap/utils/EolInputStream.java
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations      *
  * under the License.                                           *
  ****************************************************************/
-package org.apache.james.protocols.imap.utils;
+package org.apache.james.imap.utils;
 
 import java.io.FileInputStream;
 import java.io.FilterInputStream;
diff --git a/protocols/imap/src/main/java/org/apache/james/protocols/imap/utils/FastByteArrayOutputStream.java b/protocols/imap/src/main/java/org/apache/james/imap/utils/FastByteArrayOutputStream.java
similarity index 99%
rename from protocols/imap/src/main/java/org/apache/james/protocols/imap/utils/FastByteArrayOutputStream.java
rename to protocols/imap/src/main/java/org/apache/james/imap/utils/FastByteArrayOutputStream.java
index 1a06738..9df9496 100644
--- a/protocols/imap/src/main/java/org/apache/james/protocols/imap/utils/FastByteArrayOutputStream.java
+++ b/protocols/imap/src/main/java/org/apache/james/imap/utils/FastByteArrayOutputStream.java
@@ -1,4 +1,4 @@
-package org.apache.james.protocols.imap.utils;
+package org.apache.james.imap.utils;
 
 /**
  *  Licensed to the Apache Software Foundation (ASF) under one or more
diff --git a/protocols/imap/src/main/java/org/apache/james/protocols/imap/utils/FixedLengthInputStream.java b/protocols/imap/src/main/java/org/apache/james/imap/utils/FixedLengthInputStream.java
similarity index 98%
rename from protocols/imap/src/main/java/org/apache/james/protocols/imap/utils/FixedLengthInputStream.java
rename to protocols/imap/src/main/java/org/apache/james/imap/utils/FixedLengthInputStream.java
index 8950823..fda5184 100644
--- a/protocols/imap/src/main/java/org/apache/james/protocols/imap/utils/FixedLengthInputStream.java
+++ b/protocols/imap/src/main/java/org/apache/james/imap/utils/FixedLengthInputStream.java
@@ -17,7 +17,7 @@
  * under the License.                                           *
  ****************************************************************/
 
-package org.apache.james.protocols.imap.utils;
+package org.apache.james.imap.utils;
 
 import java.io.FilterInputStream;
 import java.io.IOException;
diff --git a/protocols/imap/src/test/java/org/apache/james/protocols/imap/utils/DecoderUtilsLocaleDateTest.java b/protocols/imap/src/test/java/org/apache/james/imap/decode/DecoderUtilsLocaleDateTest.java
similarity index 99%
rename from protocols/imap/src/test/java/org/apache/james/protocols/imap/utils/DecoderUtilsLocaleDateTest.java
rename to protocols/imap/src/test/java/org/apache/james/imap/decode/DecoderUtilsLocaleDateTest.java
index 91bde58..dea3c1b 100644
--- a/protocols/imap/src/test/java/org/apache/james/protocols/imap/utils/DecoderUtilsLocaleDateTest.java
+++ b/protocols/imap/src/test/java/org/apache/james/imap/decode/DecoderUtilsLocaleDateTest.java
@@ -17,7 +17,7 @@
  * under the License.                                           *
  ****************************************************************/
 
-package org.apache.james.protocols.imap.utils;
+package org.apache.james.imap.decode;
 
 import static org.assertj.core.api.Assertions.assertThat;
 
diff --git a/protocols/imap/src/test/java/org/apache/james/protocols/imap/utils/DecoderUtilsTest.java b/protocols/imap/src/test/java/org/apache/james/imap/decode/DecoderUtilsTest.java
similarity index 99%
rename from protocols/imap/src/test/java/org/apache/james/protocols/imap/utils/DecoderUtilsTest.java
rename to protocols/imap/src/test/java/org/apache/james/imap/decode/DecoderUtilsTest.java
index 70fb2ab..677f44c 100644
--- a/protocols/imap/src/test/java/org/apache/james/protocols/imap/utils/DecoderUtilsTest.java
+++ b/protocols/imap/src/test/java/org/apache/james/imap/decode/DecoderUtilsTest.java
@@ -17,7 +17,7 @@
  * under the License.                                           *
  ****************************************************************/
 
-package org.apache.james.protocols.imap.utils;
+package org.apache.james.imap.decode;
 
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Fail.fail;
@@ -30,7 +30,6 @@ import java.util.TimeZone;
 import javax.mail.Flags;
 
 import org.apache.commons.lang3.time.FastDateFormat;
-import org.apache.james.protocols.imap.DecodingException;
 import org.junit.Test;
 
 public class DecoderUtilsTest {
diff --git a/protocols/imap/src/test/java/org/apache/james/imap/decode/FetchPartPathDecoderTest.java b/protocols/imap/src/test/java/org/apache/james/imap/decode/FetchPartPathDecoderTest.java
index 569f5ba..7f78757 100644
--- a/protocols/imap/src/test/java/org/apache/james/imap/decode/FetchPartPathDecoderTest.java
+++ b/protocols/imap/src/test/java/org/apache/james/imap/decode/FetchPartPathDecoderTest.java
@@ -25,7 +25,6 @@ import static org.assertj.core.api.Fail.fail;
 import java.util.Collection;
 import java.util.Iterator;
 
-import org.apache.james.protocols.imap.DecodingException;
 import org.junit.Before;
 import org.junit.Test;
 
diff --git a/protocols/imap/src/test/java/org/apache/james/imap/decode/ImapRequestLineReaderTest.java b/protocols/imap/src/test/java/org/apache/james/imap/decode/ImapRequestLineReaderTest.java
index 0c0fc5f..6628bb6 100644
--- a/protocols/imap/src/test/java/org/apache/james/imap/decode/ImapRequestLineReaderTest.java
+++ b/protocols/imap/src/test/java/org/apache/james/imap/decode/ImapRequestLineReaderTest.java
@@ -26,7 +26,6 @@ import java.io.InputStream;
 import java.io.OutputStream;
 import java.nio.charset.StandardCharsets;
 
-import org.apache.james.protocols.imap.DecodingException;
 import org.junit.Test;
 
 public class ImapRequestLineReaderTest {
diff --git a/protocols/imap/src/test/java/org/apache/james/imap/decode/main/IdRangeParseTest.java b/protocols/imap/src/test/java/org/apache/james/imap/decode/main/IdRangeParseTest.java
index 6f302b6..0d1dc1f 100644
--- a/protocols/imap/src/test/java/org/apache/james/imap/decode/main/IdRangeParseTest.java
+++ b/protocols/imap/src/test/java/org/apache/james/imap/decode/main/IdRangeParseTest.java
@@ -26,9 +26,9 @@ import java.io.ByteArrayOutputStream;
 
 import org.apache.james.imap.api.ImapConstants;
 import org.apache.james.imap.api.message.IdRange;
+import org.apache.james.imap.decode.DecodingException;
 import org.apache.james.imap.decode.ImapRequestLineReader;
 import org.apache.james.imap.decode.ImapRequestStreamLineReader;
-import org.apache.james.protocols.imap.DecodingException;
 import org.junit.Test;
 
 public class IdRangeParseTest  {
diff --git a/protocols/imap/src/test/java/org/apache/james/imap/decode/parser/CopyParserTest.java b/protocols/imap/src/test/java/org/apache/james/imap/decode/parser/CopyParserTest.java
index 05a5bfc..79b08fd 100644
--- a/protocols/imap/src/test/java/org/apache/james/imap/decode/parser/CopyParserTest.java
+++ b/protocols/imap/src/test/java/org/apache/james/imap/decode/parser/CopyParserTest.java
@@ -26,9 +26,9 @@ import java.io.InputStream;
 
 import org.apache.james.imap.api.ImapCommand;
 import org.apache.james.imap.api.message.IdRange;
+import org.apache.james.imap.decode.DecodingException;
 import org.apache.james.imap.decode.ImapRequestStreamLineReader;
 import org.apache.james.imap.message.request.CopyRequest;
-import org.apache.james.protocols.imap.DecodingException;
 import org.junit.Test;
 
 public class CopyParserTest {
diff --git a/protocols/imap/src/test/java/org/apache/james/imap/decode/parser/CreateCommandParserTest.java b/protocols/imap/src/test/java/org/apache/james/imap/decode/parser/CreateCommandParserTest.java
index 852dc16..9305a89 100644
--- a/protocols/imap/src/test/java/org/apache/james/imap/decode/parser/CreateCommandParserTest.java
+++ b/protocols/imap/src/test/java/org/apache/james/imap/decode/parser/CreateCommandParserTest.java
@@ -32,11 +32,11 @@ import java.nio.charset.StandardCharsets;
 import org.apache.james.imap.api.ImapCommand;
 import org.apache.james.imap.api.ImapSessionUtils;
 import org.apache.james.imap.api.process.ImapSession;
+import org.apache.james.imap.decode.DecodingException;
 import org.apache.james.imap.decode.ImapRequestStreamLineReader;
 import org.apache.james.imap.message.request.CreateRequest;
 import org.apache.james.mailbox.MailboxSession;
 import org.apache.james.mailbox.MailboxSessionUtil;
-import org.apache.james.protocols.imap.DecodingException;
 import org.junit.Before;
 import org.junit.Test;
 
diff --git a/protocols/imap/src/test/java/org/apache/james/imap/decode/parser/FetchCommandParserPartialFetchTest.java b/protocols/imap/src/test/java/org/apache/james/imap/decode/parser/FetchCommandParserPartialFetchTest.java
index 197efd2..ebc079d 100644
--- a/protocols/imap/src/test/java/org/apache/james/imap/decode/parser/FetchCommandParserPartialFetchTest.java
+++ b/protocols/imap/src/test/java/org/apache/james/imap/decode/parser/FetchCommandParserPartialFetchTest.java
@@ -30,9 +30,9 @@ import org.apache.james.imap.api.message.BodyFetchElement;
 import org.apache.james.imap.api.message.FetchData;
 import org.apache.james.imap.api.message.IdRange;
 import org.apache.james.imap.api.process.ImapSession;
+import org.apache.james.imap.decode.DecodingException;
 import org.apache.james.imap.decode.ImapRequestLineReader;
 import org.apache.james.imap.decode.ImapRequestStreamLineReader;
-import org.apache.james.protocols.imap.DecodingException;
 import org.junit.Before;
 import org.junit.Test;
 
diff --git a/protocols/imap/src/test/java/org/apache/james/imap/decode/parser/GetAnnotationCommandParserTest.java b/protocols/imap/src/test/java/org/apache/james/imap/decode/parser/GetAnnotationCommandParserTest.java
index 6f7d729..e14b816 100644
--- a/protocols/imap/src/test/java/org/apache/james/imap/decode/parser/GetAnnotationCommandParserTest.java
+++ b/protocols/imap/src/test/java/org/apache/james/imap/decode/parser/GetAnnotationCommandParserTest.java
@@ -28,11 +28,11 @@ import java.nio.charset.StandardCharsets;
 
 import org.apache.james.imap.api.ImapCommand;
 import org.apache.james.imap.api.process.ImapSession;
+import org.apache.james.imap.decode.DecodingException;
 import org.apache.james.imap.decode.ImapRequestStreamLineReader;
 import org.apache.james.imap.message.request.GetAnnotationRequest;
 import org.apache.james.imap.message.request.GetAnnotationRequest.Depth;
 import org.apache.james.mailbox.model.MailboxAnnotationKey;
-import org.apache.james.protocols.imap.DecodingException;
 import org.junit.Before;
 import org.junit.Test;
 
diff --git a/protocols/imap/src/test/java/org/apache/james/imap/decode/parser/GetQuotaParserTest.java b/protocols/imap/src/test/java/org/apache/james/imap/decode/parser/GetQuotaParserTest.java
index 409e4ac..fb3bf35 100644
--- a/protocols/imap/src/test/java/org/apache/james/imap/decode/parser/GetQuotaParserTest.java
+++ b/protocols/imap/src/test/java/org/apache/james/imap/decode/parser/GetQuotaParserTest.java
@@ -25,9 +25,9 @@ import java.io.ByteArrayInputStream;
 import java.io.InputStream;
 
 import org.apache.james.imap.api.ImapCommand;
+import org.apache.james.imap.decode.DecodingException;
 import org.apache.james.imap.decode.ImapRequestStreamLineReader;
 import org.apache.james.imap.message.request.GetQuotaRequest;
-import org.apache.james.protocols.imap.DecodingException;
 import org.junit.Test;
 
 /**
diff --git a/protocols/imap/src/test/java/org/apache/james/imap/decode/parser/GetQuotaRootParserTest.java b/protocols/imap/src/test/java/org/apache/james/imap/decode/parser/GetQuotaRootParserTest.java
index 90a07aa..56d2db0 100644
--- a/protocols/imap/src/test/java/org/apache/james/imap/decode/parser/GetQuotaRootParserTest.java
+++ b/protocols/imap/src/test/java/org/apache/james/imap/decode/parser/GetQuotaRootParserTest.java
@@ -25,9 +25,9 @@ import java.io.ByteArrayInputStream;
 import java.io.InputStream;
 
 import org.apache.james.imap.api.ImapCommand;
+import org.apache.james.imap.decode.DecodingException;
 import org.apache.james.imap.decode.ImapRequestStreamLineReader;
 import org.apache.james.imap.message.request.GetQuotaRootRequest;
-import org.apache.james.protocols.imap.DecodingException;
 import org.junit.Test;
 
 /**
diff --git a/protocols/imap/src/test/java/org/apache/james/imap/decode/parser/MoveParserTest.java b/protocols/imap/src/test/java/org/apache/james/imap/decode/parser/MoveParserTest.java
index c17b379..3157314 100644
--- a/protocols/imap/src/test/java/org/apache/james/imap/decode/parser/MoveParserTest.java
+++ b/protocols/imap/src/test/java/org/apache/james/imap/decode/parser/MoveParserTest.java
@@ -26,9 +26,9 @@ import java.io.InputStream;
 
 import org.apache.james.imap.api.ImapCommand;
 import org.apache.james.imap.api.message.IdRange;
+import org.apache.james.imap.decode.DecodingException;
 import org.apache.james.imap.decode.ImapRequestStreamLineReader;
 import org.apache.james.imap.message.request.MoveRequest;
-import org.apache.james.protocols.imap.DecodingException;
 import org.junit.Test;
 
 public class MoveParserTest {
diff --git a/protocols/imap/src/test/java/org/apache/james/imap/decode/parser/SearchCommandParserAndParenthesesTest.java b/protocols/imap/src/test/java/org/apache/james/imap/decode/parser/SearchCommandParserAndParenthesesTest.java
index 64a8937..0e81a16 100644
--- a/protocols/imap/src/test/java/org/apache/james/imap/decode/parser/SearchCommandParserAndParenthesesTest.java
+++ b/protocols/imap/src/test/java/org/apache/james/imap/decode/parser/SearchCommandParserAndParenthesesTest.java
@@ -33,10 +33,10 @@ import org.apache.james.imap.api.message.IdRange;
 import org.apache.james.imap.api.message.UidRange;
 import org.apache.james.imap.api.message.request.DayMonthYear;
 import org.apache.james.imap.api.message.request.SearchKey;
+import org.apache.james.imap.decode.DecodingException;
 import org.apache.james.imap.decode.ImapRequestLineReader;
 import org.apache.james.imap.decode.ImapRequestStreamLineReader;
 import org.apache.james.mailbox.MessageUid;
-import org.apache.james.protocols.imap.DecodingException;
 import org.junit.Before;
 import org.junit.Test;
 
diff --git a/protocols/imap/src/test/java/org/apache/james/imap/decode/parser/SearchCommandParserQuotedCharsetTest.java b/protocols/imap/src/test/java/org/apache/james/imap/decode/parser/SearchCommandParserQuotedCharsetTest.java
index 4efb78e..1fe6191 100644
--- a/protocols/imap/src/test/java/org/apache/james/imap/decode/parser/SearchCommandParserQuotedCharsetTest.java
+++ b/protocols/imap/src/test/java/org/apache/james/imap/decode/parser/SearchCommandParserQuotedCharsetTest.java
@@ -40,9 +40,9 @@ import org.apache.james.imap.api.message.request.SearchKey;
 import org.apache.james.imap.api.message.response.StatusResponse;
 import org.apache.james.imap.api.message.response.StatusResponseFactory;
 import org.apache.james.imap.api.process.ImapSession;
+import org.apache.james.imap.decode.DecodingException;
 import org.apache.james.imap.decode.ImapRequestLineReader;
 import org.apache.james.imap.decode.ImapRequestStreamLineReader;
-import org.apache.james.protocols.imap.DecodingException;
 import org.junit.Before;
 import org.junit.Test;
 
diff --git a/protocols/imap/src/test/java/org/apache/james/imap/decode/parser/SearchCommandParserSearchKeyTest.java b/protocols/imap/src/test/java/org/apache/james/imap/decode/parser/SearchCommandParserSearchKeyTest.java
index 2efee6a..774914c 100644
--- a/protocols/imap/src/test/java/org/apache/james/imap/decode/parser/SearchCommandParserSearchKeyTest.java
+++ b/protocols/imap/src/test/java/org/apache/james/imap/decode/parser/SearchCommandParserSearchKeyTest.java
@@ -31,10 +31,10 @@ import org.apache.james.imap.api.message.IdRange;
 import org.apache.james.imap.api.message.UidRange;
 import org.apache.james.imap.api.message.request.DayMonthYear;
 import org.apache.james.imap.api.message.request.SearchKey;
+import org.apache.james.imap.decode.DecodingException;
 import org.apache.james.imap.decode.ImapRequestLineReader;
 import org.apache.james.imap.decode.ImapRequestStreamLineReader;
 import org.apache.james.mailbox.MessageUid;
-import org.apache.james.protocols.imap.DecodingException;
 import org.junit.Before;
 import org.junit.Test;
 
diff --git a/protocols/imap/src/test/java/org/apache/james/imap/decode/parser/SearchCommandParserTopLevelAndTest.java b/protocols/imap/src/test/java/org/apache/james/imap/decode/parser/SearchCommandParserTopLevelAndTest.java
index 0457fcd..4417f38 100644
--- a/protocols/imap/src/test/java/org/apache/james/imap/decode/parser/SearchCommandParserTopLevelAndTest.java
+++ b/protocols/imap/src/test/java/org/apache/james/imap/decode/parser/SearchCommandParserTopLevelAndTest.java
@@ -33,10 +33,10 @@ import org.apache.james.imap.api.message.IdRange;
 import org.apache.james.imap.api.message.UidRange;
 import org.apache.james.imap.api.message.request.DayMonthYear;
 import org.apache.james.imap.api.message.request.SearchKey;
+import org.apache.james.imap.decode.DecodingException;
 import org.apache.james.imap.decode.ImapRequestLineReader;
 import org.apache.james.imap.decode.ImapRequestStreamLineReader;
 import org.apache.james.mailbox.MessageUid;
-import org.apache.james.protocols.imap.DecodingException;
 import org.junit.Before;
 import org.junit.Test;
 
diff --git a/protocols/imap/src/test/java/org/apache/james/imap/decode/parser/SetAnnotationCommandParserTest.java b/protocols/imap/src/test/java/org/apache/james/imap/decode/parser/SetAnnotationCommandParserTest.java
index 5d40072..c6e6e7c 100644
--- a/protocols/imap/src/test/java/org/apache/james/imap/decode/parser/SetAnnotationCommandParserTest.java
+++ b/protocols/imap/src/test/java/org/apache/james/imap/decode/parser/SetAnnotationCommandParserTest.java
@@ -26,11 +26,11 @@ import java.io.ByteArrayOutputStream;
 import java.io.InputStream;
 
 import org.apache.james.imap.api.ImapCommand;
+import org.apache.james.imap.decode.DecodingException;
 import org.apache.james.imap.decode.ImapRequestStreamLineReader;
 import org.apache.james.imap.message.request.SetAnnotationRequest;
 import org.apache.james.mailbox.model.MailboxAnnotation;
 import org.apache.james.mailbox.model.MailboxAnnotationKey;
-import org.apache.james.protocols.imap.DecodingException;
 import org.junit.Test;
 
 public class SetAnnotationCommandParserTest {
diff --git a/protocols/imap/src/test/java/org/apache/james/imap/decode/parser/SetQuotaCommandParserTest.java b/protocols/imap/src/test/java/org/apache/james/imap/decode/parser/SetQuotaCommandParserTest.java
index 095badc..2d2adaa 100644
--- a/protocols/imap/src/test/java/org/apache/james/imap/decode/parser/SetQuotaCommandParserTest.java
+++ b/protocols/imap/src/test/java/org/apache/james/imap/decode/parser/SetQuotaCommandParserTest.java
@@ -26,9 +26,9 @@ import java.io.InputStream;
 import java.util.List;
 
 import org.apache.james.imap.api.ImapCommand;
+import org.apache.james.imap.decode.DecodingException;
 import org.apache.james.imap.decode.ImapRequestStreamLineReader;
 import org.apache.james.imap.message.request.SetQuotaRequest;
-import org.apache.james.protocols.imap.DecodingException;
 import org.junit.Test;
 
 /**
diff --git a/server/protocols/protocols-imap4/src/main/java/org/apache/james/imapserver/netty/AbstractNettyImapRequestLineReader.java b/server/protocols/protocols-imap4/src/main/java/org/apache/james/imapserver/netty/AbstractNettyImapRequestLineReader.java
index 60a5f38..d489d44 100644
--- a/server/protocols/protocols-imap4/src/main/java/org/apache/james/imapserver/netty/AbstractNettyImapRequestLineReader.java
+++ b/server/protocols/protocols-imap4/src/main/java/org/apache/james/imapserver/netty/AbstractNettyImapRequestLineReader.java
@@ -18,8 +18,8 @@
  ****************************************************************/
 package org.apache.james.imapserver.netty;
 
+import org.apache.james.imap.decode.DecodingException;
 import org.apache.james.imap.decode.ImapRequestLineReader;
-import org.apache.james.protocols.imap.DecodingException;
 import org.jboss.netty.buffer.ChannelBuffer;
 import org.jboss.netty.buffer.ChannelBuffers;
 import org.jboss.netty.channel.Channel;
diff --git a/server/protocols/protocols-imap4/src/main/java/org/apache/james/imapserver/netty/NettyImapRequestLineReader.java b/server/protocols/protocols-imap4/src/main/java/org/apache/james/imapserver/netty/NettyImapRequestLineReader.java
index c090da0..2513d6a 100644
--- a/server/protocols/protocols-imap4/src/main/java/org/apache/james/imapserver/netty/NettyImapRequestLineReader.java
+++ b/server/protocols/protocols-imap4/src/main/java/org/apache/james/imapserver/netty/NettyImapRequestLineReader.java
@@ -23,9 +23,9 @@ import java.io.InputStream;
 
 import org.apache.commons.io.input.BoundedInputStream;
 import org.apache.james.imap.api.display.HumanReadableText;
+import org.apache.james.imap.decode.DecodingException;
 import org.apache.james.imap.decode.ImapRequestLineReader;
-import org.apache.james.protocols.imap.DecodingException;
-import org.apache.james.protocols.imap.utils.EolInputStream;
+import org.apache.james.imap.utils.EolInputStream;
 import org.jboss.netty.buffer.ChannelBuffer;
 import org.jboss.netty.buffer.ChannelBufferInputStream;
 import org.jboss.netty.channel.Channel;
diff --git a/server/protocols/protocols-imap4/src/main/java/org/apache/james/imapserver/netty/NettyStreamImapRequestLineReader.java b/server/protocols/protocols-imap4/src/main/java/org/apache/james/imapserver/netty/NettyStreamImapRequestLineReader.java
index bda86b0..8e7481d 100644
--- a/server/protocols/protocols-imap4/src/main/java/org/apache/james/imapserver/netty/NettyStreamImapRequestLineReader.java
+++ b/server/protocols/protocols-imap4/src/main/java/org/apache/james/imapserver/netty/NettyStreamImapRequestLineReader.java
@@ -22,9 +22,9 @@ import java.io.IOException;
 import java.io.InputStream;
 
 import org.apache.james.imap.api.display.HumanReadableText;
-import org.apache.james.protocols.imap.DecodingException;
-import org.apache.james.protocols.imap.utils.EolInputStream;
-import org.apache.james.protocols.imap.utils.FixedLengthInputStream;
+import org.apache.james.imap.decode.DecodingException;
+import org.apache.james.imap.utils.EolInputStream;
+import org.apache.james.imap.utils.FixedLengthInputStream;
 import org.jboss.netty.channel.Channel;
 
 public class NettyStreamImapRequestLineReader extends AbstractNettyImapRequestLineReader {


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[james-project] 07/36: JAMES-2904 Cassandra session user password and ssl configuration options

Posted by bt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit 03ac1aa6bd60d8a6460db72e88ccf69e27758f9c
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Tue Oct 1 16:43:40 2019 +0700

    JAMES-2904 Cassandra session user password and ssl configuration options
---
 .../backends/cassandra/init/ClusterBuilder.java    |  24 ++++-
 .../init/configuration/ClusterConfiguration.java   |  72 +++++++++++++-
 .../backends/cassandra/CassandraWaitStrategy.java  |   2 +-
 .../james/backends/cassandra/DockerCassandra.java  |  14 ++-
 .../DockerCassandraAuthenticatedSingleton.java     |  44 ++-------
 .../destination/conf/cassandra.properties          |   3 +
 .../destination/conf/cassandra.properties          |   3 +
 .../destination/conf/cassandra.properties          |   3 +
 .../destination/conf/cassandra.properties          |   3 +
 .../modules/mailbox/ResilientClusterProvider.java  |   3 +
 .../AuthenticatedCassandraJamesServerTest.java     | 109 +++++++++++++++++++++
 ....java => CassandraAuthenticationExtension.java} |  46 ++++-----
 ...va => CassandraBadAuthenticationExtension.java} |  46 ++++-----
 .../java/org/apache/james/CassandraExtension.java  |   4 +
 src/site/xdoc/server/config-cassandra.xml          |  13 +++
 15 files changed, 289 insertions(+), 100 deletions(-)

diff --git a/backends-common/cassandra/src/main/java/org/apache/james/backends/cassandra/init/ClusterBuilder.java b/backends-common/cassandra/src/main/java/org/apache/james/backends/cassandra/init/ClusterBuilder.java
index bc212b0..681992a 100644
--- a/backends-common/cassandra/src/main/java/org/apache/james/backends/cassandra/init/ClusterBuilder.java
+++ b/backends-common/cassandra/src/main/java/org/apache/james/backends/cassandra/init/ClusterBuilder.java
@@ -55,10 +55,12 @@ public class ClusterBuilder {
     private Optional<Integer> readTimeoutMillis;
     private Optional<Integer> connectTimeoutMillis;
     private Optional<PoolingOptions> poolingOptions;
+    private Optional<Boolean> useSsl;
 
     private ClusterBuilder() {
         username = Optional.empty();
         password = Optional.empty();
+        useSsl = Optional.empty();
 
         host = Optional.empty();
         port = Optional.empty();
@@ -71,13 +73,21 @@ public class ClusterBuilder {
     }
 
     public ClusterBuilder username(String username) {
-        this.username = Optional.of(username);
+        return username(Optional.of(username));
+    }
+
+    public ClusterBuilder password(String password) {
+        return password(Optional.of(password));
+    }
+
+    public ClusterBuilder username(Optional<String> username) {
+        this.username = username;
 
         return this;
     }
 
-    public ClusterBuilder password(String password) {
-        this.password = Optional.of(password);
+    public ClusterBuilder password(Optional<String> password) {
+        this.password = password;
 
         return this;
     }
@@ -94,6 +104,12 @@ public class ClusterBuilder {
         return this;
     }
 
+    public ClusterBuilder useSsl(boolean useSsl) {
+        this.useSsl = Optional.of(useSsl);
+
+        return this;
+    }
+
     public ClusterBuilder poolingOptions(PoolingOptions poolingOptions) {
         this.poolingOptions = Optional.of(poolingOptions);
         return this;
@@ -155,6 +171,8 @@ public class ClusterBuilder {
         clusterBuilder.withSocketOptions(socketOptions);
         poolingOptions.ifPresent(clusterBuilder::withPoolingOptions);
 
+        useSsl.filter(b -> b).ifPresent(any -> clusterBuilder.withSSL());
+
         Cluster cluster = clusterBuilder.build();
         try {
             queryLogger.map(queryLoggerConfiguration ->
diff --git a/backends-common/cassandra/src/main/java/org/apache/james/backends/cassandra/init/configuration/ClusterConfiguration.java b/backends-common/cassandra/src/main/java/org/apache/james/backends/cassandra/init/configuration/ClusterConfiguration.java
index 5d832ca..0173373 100644
--- a/backends-common/cassandra/src/main/java/org/apache/james/backends/cassandra/init/configuration/ClusterConfiguration.java
+++ b/backends-common/cassandra/src/main/java/org/apache/james/backends/cassandra/init/configuration/ClusterConfiguration.java
@@ -46,6 +46,9 @@ public class ClusterConfiguration {
         private Optional<PoolingOptions> poolingOptions;
         private Optional<Integer> readTimeoutMillis;
         private Optional<Integer> connectTimeoutMillis;
+        private Optional<Boolean> useSsl;
+        private Optional<String> username;
+        private Optional<String> password;
 
         public Builder() {
             hosts = ImmutableList.builder();
@@ -57,6 +60,9 @@ public class ClusterConfiguration {
             poolingOptions = Optional.empty();
             readTimeoutMillis = Optional.empty();
             connectTimeoutMillis = Optional.empty();
+            username = Optional.empty();
+            password = Optional.empty();
+            useSsl = Optional.empty();
         }
 
         public Builder host(Host host) {
@@ -138,6 +144,33 @@ public class ClusterConfiguration {
             return this;
         }
 
+        public Builder username(Optional<String> username) {
+            this.username = username;
+            return this;
+        }
+
+        public Builder username(String username) {
+            return username(Optional.of(username));
+        }
+
+        public Builder password(Optional<String> password) {
+            this.password = password;
+            return this;
+        }
+
+        public Builder password(String password) {
+            return password(Optional.of(password));
+        }
+
+        public Builder useSsl(boolean useSsl) {
+            this.useSsl = Optional.of(useSsl);
+            return this;
+        }
+
+        public Builder useSsl() {
+            return useSsl(true);
+        }
+
         public Builder connectTimeoutMillis(int connectTimeoutMillis) {
             return connectTimeoutMillis(Optional.of(connectTimeoutMillis));
         }
@@ -152,12 +185,18 @@ public class ClusterConfiguration {
                 queryLoggerConfiguration.orElse(QueryLoggerConfiguration.DEFAULT),
                 poolingOptions,
                 readTimeoutMillis.orElse(DEFAULT_READ_TIMEOUT_MILLIS),
-                connectTimeoutMillis.orElse(DEFAULT_CONNECT_TIMEOUT_MILLIS));
+                connectTimeoutMillis.orElse(DEFAULT_CONNECT_TIMEOUT_MILLIS),
+                useSsl.orElse(false),
+                username,
+                password);
         }
     }
 
     private static final String CASSANDRA_NODES = "cassandra.nodes";
     public static final String CASSANDRA_KEYSPACE = "cassandra.keyspace";
+    public static final String CASSANDRA_USER = "cassandra.user";
+    public static final String CASSANDRA_PASSWORD = "cassandra.password";
+    public static final String CASSANDRA_SSL = "cassandra.ssl";
     public static final String REPLICATION_FACTOR = "cassandra.replication.factor";
     public static final String READ_TIMEOUT_MILLIS = "cassandra.readTimeoutMillis";
     public static final String CONNECT_TIMEOUT_MILLIS = "cassandra.connectTimeoutMillis";
@@ -170,6 +209,7 @@ public class ClusterConfiguration {
     private static final int DEFAULT_CONNECTION_MIN_DELAY = 5000;
     private static final int DEFAULT_READ_TIMEOUT_MILLIS = 5000;
     private static final int DEFAULT_CONNECT_TIMEOUT_MILLIS = 5000;
+    private static final boolean DEFAULT_SSL = false;
 
     public static Builder builder() {
         return new Builder();
@@ -186,6 +226,9 @@ public class ClusterConfiguration {
             .poolingOptions(readPoolingOptions(configuration))
             .readTimeoutMillis(Optional.ofNullable(configuration.getInteger(READ_TIMEOUT_MILLIS, null)))
             .connectTimeoutMillis(Optional.ofNullable(configuration.getInteger(CONNECT_TIMEOUT_MILLIS, null)))
+            .useSsl(configuration.getBoolean(CASSANDRA_SSL, false))
+            .username(Optional.ofNullable(configuration.getString(CASSANDRA_USER, null)))
+            .password(Optional.ofNullable(configuration.getString(CASSANDRA_PASSWORD, null)))
             .build();
     }
 
@@ -237,10 +280,13 @@ public class ClusterConfiguration {
     private final Optional<PoolingOptions> poolingOptions;
     private final int readTimeoutMillis;
     private final int connectTimeoutMillis;
+    private final boolean useSsl;
+    private final Optional<String> username;
+    private final Optional<String> password;
 
     public ClusterConfiguration(List<Host> hosts, String keyspace, int replicationFactor, int minDelay, int maxRetry,
                                 QueryLoggerConfiguration queryLoggerConfiguration, Optional<PoolingOptions> poolingOptions,
-                                int readTimeoutMillis, int connectTimeoutMillis) {
+                                int readTimeoutMillis, int connectTimeoutMillis, boolean useSsl, Optional<String> username, Optional<String> password) {
         this.hosts = hosts;
         this.keyspace = keyspace;
         this.replicationFactor = replicationFactor;
@@ -250,6 +296,9 @@ public class ClusterConfiguration {
         this.poolingOptions = poolingOptions;
         this.readTimeoutMillis = readTimeoutMillis;
         this.connectTimeoutMillis = connectTimeoutMillis;
+        this.useSsl = useSsl;
+        this.username = username;
+        this.password = password;
     }
 
     public List<Host> getHosts() {
@@ -288,6 +337,18 @@ public class ClusterConfiguration {
         return connectTimeoutMillis;
     }
 
+    public boolean isUseSsl() {
+        return useSsl;
+    }
+
+    public Optional<String> getUsername() {
+        return username;
+    }
+
+    public Optional<String> getPassword() {
+        return password;
+    }
+
     @Override
     public final boolean equals(Object o) {
         if (o instanceof ClusterConfiguration) {
@@ -301,7 +362,10 @@ public class ClusterConfiguration {
                 && Objects.equals(this.queryLoggerConfiguration, that.queryLoggerConfiguration)
                 && Objects.equals(this.poolingOptions, that.poolingOptions)
                 && Objects.equals(this.readTimeoutMillis, that.readTimeoutMillis)
-                && Objects.equals(this.connectTimeoutMillis, that.connectTimeoutMillis);
+                && Objects.equals(this.connectTimeoutMillis, that.connectTimeoutMillis)
+                && Objects.equals(this.useSsl, that.useSsl)
+                && Objects.equals(this.username, that.username)
+                && Objects.equals(this.password, that.password);
         }
         return false;
     }
@@ -309,6 +373,6 @@ public class ClusterConfiguration {
     @Override
     public final int hashCode() {
         return Objects.hash(hosts, keyspace, replicationFactor, minDelay, maxRetry, queryLoggerConfiguration, poolingOptions,
-            readTimeoutMillis, connectTimeoutMillis);
+            readTimeoutMillis, connectTimeoutMillis, username, useSsl, password);
     }
 }
diff --git a/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/CassandraWaitStrategy.java b/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/CassandraWaitStrategy.java
index bb47552..cbec58c 100644
--- a/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/CassandraWaitStrategy.java
+++ b/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/CassandraWaitStrategy.java
@@ -50,7 +50,7 @@ public class CassandraWaitStrategy implements WaitStrategy {
         Unreliables.retryUntilTrue(Ints.checkedCast(timeout.getSeconds()), TimeUnit.SECONDS, () -> {
                 try {
                     return cassandraContainer
-                        .execInContainer("cqlsh", "-e", "show host")
+                        .execInContainer("cqlsh", "-u", "cassandra", "-p", "cassandra", "-e", "show host")
                         .getStdout()
                         .contains("Connected to Test Cluster");
                 } catch (IOException | InterruptedException e) {
diff --git a/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/DockerCassandra.java b/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/DockerCassandra.java
index 688ed0e..58a9a08 100644
--- a/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/DockerCassandra.java
+++ b/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/DockerCassandra.java
@@ -19,6 +19,8 @@
 
 package org.apache.james.backends.cassandra;
 
+import java.util.function.Function;
+
 import org.apache.james.util.Host;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -26,6 +28,8 @@ import org.testcontainers.DockerClientFactory;
 import org.testcontainers.containers.GenericContainer;
 import org.testcontainers.containers.output.OutputFrame;
 import org.testcontainers.images.builder.ImageFromDockerfile;
+import org.testcontainers.images.builder.dockerfile.DockerfileBuilder;
+import org.testcontainers.images.builder.dockerfile.traits.RunStatementTrait;
 
 import com.github.dockerjava.api.DockerClient;
 import com.google.common.collect.ImmutableMap;
@@ -45,17 +49,21 @@ public class DockerCassandra {
 
     @SuppressWarnings("resource")
     public DockerCassandra() {
+        this("cassandra_3_11_3", Function.identity());
+    }
+
+    public DockerCassandra(String imageName, Function<DockerfileBuilder, DockerfileBuilder> additionalSteps) {
         client = DockerClientFactory.instance().client();
         boolean doNotDeleteImageAfterUsage = false;
         cassandraContainer = new GenericContainer<>(
-            new ImageFromDockerfile("cassandra_3_11_3", doNotDeleteImageAfterUsage)
+            new ImageFromDockerfile(imageName,doNotDeleteImageAfterUsage)
                 .withDockerfileFromBuilder(builder ->
-                    builder
+                    additionalSteps.apply(builder
                         .from("cassandra:3.11.3")
                         .env("ENV CASSANDRA_CONFIG", "/etc/cassandra")
                         .run("echo \"-Xms" + CASSANDRA_MEMORY + "M\" >> " + JVM_OPTIONS)
                         .run("echo \"-Xmx" + CASSANDRA_MEMORY + "M\" >> " + JVM_OPTIONS)
-                        .run("sed", "-i", "s/auto_snapshot: true/auto_snapshot: false/g", "/etc/cassandra/cassandra.yaml")
+                        .run("sed", "-i", "s/auto_snapshot: true/auto_snapshot: false/g", "/etc/cassandra/cassandra.yaml"))
                         .build()))
             .withTmpFs(ImmutableMap.of("/var/lib/cassandra", "rw,noexec,nosuid,size=200m"))
             .withExposedPorts(CASSANDRA_PORT)
diff --git a/server/container/guice/cassandra-guice/src/test/java/org/apache/james/CassandraExtension.java b/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/DockerCassandraAuthenticatedSingleton.java
similarity index 58%
copy from server/container/guice/cassandra-guice/src/test/java/org/apache/james/CassandraExtension.java
copy to backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/DockerCassandraAuthenticatedSingleton.java
index a2750cc..e16f639 100644
--- a/server/container/guice/cassandra-guice/src/test/java/org/apache/james/CassandraExtension.java
+++ b/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/DockerCassandraAuthenticatedSingleton.java
@@ -17,44 +17,14 @@
  * under the License.                                           *
  ****************************************************************/
 
-package org.apache.james;
+package org.apache.james.backends.cassandra;
 
-import org.junit.jupiter.api.extension.ExtensionContext;
+public class DockerCassandraAuthenticatedSingleton {
+    public static final DockerCassandra singleton = new DockerCassandra("cassandra_3_11_3_auth",
+        dockerfileBuilder -> dockerfileBuilder
+            .run("echo 'authenticator: PasswordAuthenticator' >> /etc/cassandra/cassandra.yaml"));
 
-import com.google.inject.Module;
-
-public class CassandraExtension implements GuiceModuleTestExtension {
-
-    private final DockerCassandraRule cassandra;
-
-    public CassandraExtension() {
-        this(new DockerCassandraRule());
-    }
-
-    public CassandraExtension(DockerCassandraRule cassandra) {
-        this.cassandra = cassandra;
-    }
-
-    @Override
-    public void beforeAll(ExtensionContext extensionContext) {
-        cassandra.start();
-    }
-
-    @Override
-    public void afterAll(ExtensionContext extensionContext) {
-        cassandra.stop();
-    }
-
-    @Override
-    public Module getModule() {
-        return cassandra.getModule();
-    }
-
-    public void pause() {
-        cassandra.pause();
-    }
-
-    public void unpause() {
-        cassandra.unpause();
+    static {
+        singleton.start();
     }
 }
diff --git a/dockerfiles/run/guice/cassandra-ldap/destination/conf/cassandra.properties b/dockerfiles/run/guice/cassandra-ldap/destination/conf/cassandra.properties
index ea199db..cebfe65 100644
--- a/dockerfiles/run/guice/cassandra-ldap/destination/conf/cassandra.properties
+++ b/dockerfiles/run/guice/cassandra-ldap/destination/conf/cassandra.properties
@@ -3,6 +3,9 @@
 
 cassandra.nodes=cassandra
 cassandra.keyspace=apache_james
+#cassandra.user=cassandra
+#cassandra.password=cassandra
+#cassandra.ssl=false
 cassandra.replication.factor=1
 cassandra.retryConnection.maxRetries=200
 cassandra.retryConnection.minDelay=5000
diff --git a/dockerfiles/run/guice/cassandra-rabbitmq-ldap/destination/conf/cassandra.properties b/dockerfiles/run/guice/cassandra-rabbitmq-ldap/destination/conf/cassandra.properties
index 1c63f7e..842f56d 100644
--- a/dockerfiles/run/guice/cassandra-rabbitmq-ldap/destination/conf/cassandra.properties
+++ b/dockerfiles/run/guice/cassandra-rabbitmq-ldap/destination/conf/cassandra.properties
@@ -3,6 +3,9 @@
 
 cassandra.nodes=cassandra
 cassandra.keyspace=apache_james
+#cassandra.user=cassandra
+#cassandra.password=cassandra
+#cassandra.ssl=false
 cassandra.replication.factor=1
 cassandra.retryConnection.maxRetries=200
 cassandra.retryConnection.minDelay=5000
diff --git a/dockerfiles/run/guice/cassandra-rabbitmq/destination/conf/cassandra.properties b/dockerfiles/run/guice/cassandra-rabbitmq/destination/conf/cassandra.properties
index 1c63f7e..842f56d 100644
--- a/dockerfiles/run/guice/cassandra-rabbitmq/destination/conf/cassandra.properties
+++ b/dockerfiles/run/guice/cassandra-rabbitmq/destination/conf/cassandra.properties
@@ -3,6 +3,9 @@
 
 cassandra.nodes=cassandra
 cassandra.keyspace=apache_james
+#cassandra.user=cassandra
+#cassandra.password=cassandra
+#cassandra.ssl=false
 cassandra.replication.factor=1
 cassandra.retryConnection.maxRetries=200
 cassandra.retryConnection.minDelay=5000
diff --git a/dockerfiles/run/guice/cassandra/destination/conf/cassandra.properties b/dockerfiles/run/guice/cassandra/destination/conf/cassandra.properties
index 2cf6a10..413a2ad 100644
--- a/dockerfiles/run/guice/cassandra/destination/conf/cassandra.properties
+++ b/dockerfiles/run/guice/cassandra/destination/conf/cassandra.properties
@@ -3,6 +3,9 @@
 
 cassandra.nodes=cassandra
 cassandra.keyspace=apache_james
+#cassandra.user=cassandra
+#cassandra.password=cassandra
+#cassandra.ssl=false
 cassandra.replication.factor=1
 cassandra.retryConnection.maxRetries=200
 cassandra.retryConnection.minDelay=5000
diff --git a/server/container/guice/cassandra-guice/src/main/java/org/apache/james/modules/mailbox/ResilientClusterProvider.java b/server/container/guice/cassandra-guice/src/main/java/org/apache/james/modules/mailbox/ResilientClusterProvider.java
index e28e6a4..979aa57 100644
--- a/server/container/guice/cassandra-guice/src/main/java/org/apache/james/modules/mailbox/ResilientClusterProvider.java
+++ b/server/container/guice/cassandra-guice/src/main/java/org/apache/james/modules/mailbox/ResilientClusterProvider.java
@@ -64,6 +64,9 @@ public class ResilientClusterProvider implements Provider<Cluster> {
         return () -> {
             Cluster cluster = ClusterBuilder.builder()
                     .servers(configuration.getHosts())
+                    .username(configuration.getUsername())
+                    .password(configuration.getPassword())
+                    .useSsl(configuration.isUseSsl())
                     .poolingOptions(configuration.getPoolingOptions())
                     .queryLoggerConfiguration(configuration.getQueryLoggerConfiguration())
                     .readTimeoutMillis(configuration.getReadTimeoutMillis())
diff --git a/server/container/guice/cassandra-guice/src/test/java/org/apache/james/AuthenticatedCassandraJamesServerTest.java b/server/container/guice/cassandra-guice/src/test/java/org/apache/james/AuthenticatedCassandraJamesServerTest.java
new file mode 100644
index 0000000..130f4c9
--- /dev/null
+++ b/server/container/guice/cassandra-guice/src/test/java/org/apache/james/AuthenticatedCassandraJamesServerTest.java
@@ -0,0 +1,109 @@
+/****************************************************************
+ * 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;
+
+import static org.apache.james.CassandraJamesServerMain.ALL_BUT_JMX_CASSANDRA_MODULE;
+import static org.apache.james.JamesServerContract.DOMAIN_LIST_CONFIGURATION_MODULE;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
+
+import org.apache.commons.lang3.NotImplementedException;
+import org.apache.james.backends.cassandra.DockerCassandraAuthenticatedSingleton;
+import org.apache.james.backends.cassandra.init.configuration.ClusterConfiguration;
+import org.apache.james.mailbox.extractor.TextExtractor;
+import org.apache.james.mailbox.store.search.PDFTextExtractor;
+import org.apache.james.modules.TestJMAPServerModule;
+import org.junit.jupiter.api.Nested;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+
+import com.datastax.driver.core.exceptions.AuthenticationException;
+import com.google.inject.CreationException;
+
+class AuthenticatedCassandraJamesServerTest {
+    private static final int LIMIT_TO_10_MESSAGES = 10;
+
+    @Nested
+    class AuthenticationTest implements JamesServerContract {
+        @RegisterExtension
+        JamesServerExtension testExtension = new JamesServerBuilder()
+            .extension(new DockerElasticSearchExtension())
+            .extension(new CassandraAuthenticationExtension())
+            .server(configuration -> GuiceJamesServer.forConfiguration(configuration)
+                .combineWith(ALL_BUT_JMX_CASSANDRA_MODULE)
+                .overrideWith(binder -> binder.bind(TextExtractor.class).to(PDFTextExtractor.class))
+                .overrideWith(new TestJMAPServerModule(LIMIT_TO_10_MESSAGES))
+                .overrideWith(DOMAIN_LIST_CONFIGURATION_MODULE))
+            .build();
+    }
+
+    @Nested
+    class SslTest {
+        @RegisterExtension
+        JamesServerExtension testExtension = new JamesServerBuilder()
+            .extension(new DockerElasticSearchExtension())
+            .extension(new CassandraExtension())
+            .disableAutoStart()
+            .server(configuration -> GuiceJamesServer.forConfiguration(configuration)
+                .combineWith(ALL_BUT_JMX_CASSANDRA_MODULE)
+                .overrideWith(binder -> binder.bind(TextExtractor.class).to(PDFTextExtractor.class))
+                .overrideWith(new TestJMAPServerModule(LIMIT_TO_10_MESSAGES))
+                .overrideWith(DOMAIN_LIST_CONFIGURATION_MODULE))
+            .overrideServerModule(binder -> binder.bind(ClusterConfiguration.class)
+                .toInstance(ClusterConfiguration.builder()
+                    .host(DockerCassandraAuthenticatedSingleton.singleton.getHost())
+                    .keyspace("testing")
+                    .replicationFactor(1)
+                    .maxRetry(1)
+                    .minDelay(100)
+                    .useSsl()
+                    .build()))
+            .build();
+
+        @Test
+        void startShouldFailWhenSslUsedAndNotSupportedByServer(GuiceJamesServer jamesServer) {
+            assertThatThrownBy(jamesServer::start)
+                .isInstanceOf(CreationException.class)
+                .hasStackTraceContaining("Caused by: com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed");
+        }
+    }
+
+    @Nested
+    class AuthenticationFailureTest {
+        @RegisterExtension
+        JamesServerExtension testExtension = new JamesServerBuilder()
+            .extension(new DockerElasticSearchExtension())
+            .extension(new CassandraBadAuthenticationExtension())
+            .disableAutoStart()
+            .server(configuration -> GuiceJamesServer.forConfiguration(configuration)
+                .combineWith(ALL_BUT_JMX_CASSANDRA_MODULE)
+                .overrideWith(binder -> binder.bind(TextExtractor.class).to(PDFTextExtractor.class))
+                .overrideWith(new TestJMAPServerModule(LIMIT_TO_10_MESSAGES))
+                .overrideWith(DOMAIN_LIST_CONFIGURATION_MODULE))
+            .build();
+
+        @Test
+        void startShouldFailOnBadPassword(GuiceJamesServer jamesServer) {
+            assertThatThrownBy(jamesServer::start)
+                .isInstanceOf(CreationException.class)
+                .hasStackTraceContaining("Caused by: com.datastax.driver.core.exceptions.AuthenticationException: Authentication error");
+        }
+    }
+}
diff --git a/server/container/guice/cassandra-guice/src/test/java/org/apache/james/CassandraExtension.java b/server/container/guice/cassandra-guice/src/test/java/org/apache/james/CassandraAuthenticationExtension.java
similarity index 55%
copy from server/container/guice/cassandra-guice/src/test/java/org/apache/james/CassandraExtension.java
copy to server/container/guice/cassandra-guice/src/test/java/org/apache/james/CassandraAuthenticationExtension.java
index a2750cc..7528d6c 100644
--- a/server/container/guice/cassandra-guice/src/test/java/org/apache/james/CassandraExtension.java
+++ b/server/container/guice/cassandra-guice/src/test/java/org/apache/james/CassandraAuthenticationExtension.java
@@ -19,42 +19,36 @@
 
 package org.apache.james;
 
+import org.apache.james.backends.cassandra.DockerCassandraAuthenticatedSingleton;
+import org.apache.james.backends.cassandra.init.configuration.ClusterConfiguration;
+import org.apache.james.server.CassandraTruncateTableTask;
 import org.junit.jupiter.api.extension.ExtensionContext;
 
 import com.google.inject.Module;
+import com.google.inject.multibindings.Multibinder;
+import com.google.inject.util.Modules;
 
-public class CassandraExtension implements GuiceModuleTestExtension {
-
-    private final DockerCassandraRule cassandra;
-
-    public CassandraExtension() {
-        this(new DockerCassandraRule());
-    }
-
-    public CassandraExtension(DockerCassandraRule cassandra) {
-        this.cassandra = cassandra;
-    }
+public class CassandraAuthenticationExtension implements GuiceModuleTestExtension {
 
     @Override
     public void beforeAll(ExtensionContext extensionContext) {
-        cassandra.start();
-    }
-
-    @Override
-    public void afterAll(ExtensionContext extensionContext) {
-        cassandra.stop();
+        DockerCassandraAuthenticatedSingleton.singleton.start();
     }
 
     @Override
     public Module getModule() {
-        return cassandra.getModule();
-    }
-
-    public void pause() {
-        cassandra.pause();
-    }
-
-    public void unpause() {
-        cassandra.unpause();
+        return Modules.combine((binder) -> binder.bind(ClusterConfiguration.class)
+                .toInstance(ClusterConfiguration.builder()
+                    .host(DockerCassandraAuthenticatedSingleton.singleton.getHost())
+                    .keyspace("testing")
+                    .username("cassandra")
+                    .password("cassandra")
+                    .replicationFactor(1)
+                    .maxRetry(20)
+                    .minDelay(5000)
+                    .build()),
+            binder -> Multibinder.newSetBinder(binder, CleanupTasksPerformer.CleanupTask.class)
+                .addBinding()
+                .to(CassandraTruncateTableTask.class));
     }
 }
diff --git a/server/container/guice/cassandra-guice/src/test/java/org/apache/james/CassandraExtension.java b/server/container/guice/cassandra-guice/src/test/java/org/apache/james/CassandraBadAuthenticationExtension.java
similarity index 56%
copy from server/container/guice/cassandra-guice/src/test/java/org/apache/james/CassandraExtension.java
copy to server/container/guice/cassandra-guice/src/test/java/org/apache/james/CassandraBadAuthenticationExtension.java
index a2750cc..a001393 100644
--- a/server/container/guice/cassandra-guice/src/test/java/org/apache/james/CassandraExtension.java
+++ b/server/container/guice/cassandra-guice/src/test/java/org/apache/james/CassandraBadAuthenticationExtension.java
@@ -19,42 +19,36 @@
 
 package org.apache.james;
 
+import org.apache.james.backends.cassandra.DockerCassandraAuthenticatedSingleton;
+import org.apache.james.backends.cassandra.init.configuration.ClusterConfiguration;
+import org.apache.james.server.CassandraTruncateTableTask;
 import org.junit.jupiter.api.extension.ExtensionContext;
 
 import com.google.inject.Module;
+import com.google.inject.multibindings.Multibinder;
+import com.google.inject.util.Modules;
 
-public class CassandraExtension implements GuiceModuleTestExtension {
-
-    private final DockerCassandraRule cassandra;
-
-    public CassandraExtension() {
-        this(new DockerCassandraRule());
-    }
-
-    public CassandraExtension(DockerCassandraRule cassandra) {
-        this.cassandra = cassandra;
-    }
+public class CassandraBadAuthenticationExtension implements GuiceModuleTestExtension {
 
     @Override
     public void beforeAll(ExtensionContext extensionContext) {
-        cassandra.start();
-    }
-
-    @Override
-    public void afterAll(ExtensionContext extensionContext) {
-        cassandra.stop();
+        DockerCassandraAuthenticatedSingleton.singleton.start();
     }
 
     @Override
     public Module getModule() {
-        return cassandra.getModule();
-    }
-
-    public void pause() {
-        cassandra.pause();
-    }
-
-    public void unpause() {
-        cassandra.unpause();
+        return Modules.combine((binder) -> binder.bind(ClusterConfiguration.class)
+                .toInstance(ClusterConfiguration.builder()
+                    .host(DockerCassandraAuthenticatedSingleton.singleton.getHost())
+                    .keyspace("testing")
+                    .username("cassandra")
+                    .password("bad")
+                    .replicationFactor(1)
+                    .maxRetry(1)
+                    .minDelay(100)
+                    .build()),
+            binder -> Multibinder.newSetBinder(binder, CleanupTasksPerformer.CleanupTask.class)
+                .addBinding()
+                .to(CassandraTruncateTableTask.class));
     }
 }
diff --git a/server/container/guice/cassandra-guice/src/test/java/org/apache/james/CassandraExtension.java b/server/container/guice/cassandra-guice/src/test/java/org/apache/james/CassandraExtension.java
index a2750cc..f7d1fc4 100644
--- a/server/container/guice/cassandra-guice/src/test/java/org/apache/james/CassandraExtension.java
+++ b/server/container/guice/cassandra-guice/src/test/java/org/apache/james/CassandraExtension.java
@@ -50,6 +50,10 @@ public class CassandraExtension implements GuiceModuleTestExtension {
         return cassandra.getModule();
     }
 
+    public DockerCassandraRule getCassandra() {
+        return cassandra;
+    }
+
     public void pause() {
         cassandra.pause();
     }
diff --git a/src/site/xdoc/server/config-cassandra.xml b/src/site/xdoc/server/config-cassandra.xml
index d951fe8..3511c87 100644
--- a/src/site/xdoc/server/config-cassandra.xml
+++ b/src/site/xdoc/server/config-cassandra.xml
@@ -38,6 +38,19 @@
         <dt><strong>cassandra.keyspace</strong></dt>
         <dd>Is the name of the keyspace used by James. Optional, default value: <b>apache_james</b></dd>
 
+        <dt><strong>cassandra.user</strong></dt>
+        <dd>Username used as a credential for contacting Cassandra cluster. Optional, default is absent,
+          required if <strong>cassandra.password</strong> is supplied</dd>
+
+        <dt><strong>cassandra.password</strong></dt>
+        <dd>Password used as a credential for contacting Cassandra cluster. Optional, default is absent,
+          required if <strong>cassandra.user</strong> is supplied</dd>
+
+        <dt><strong>cassandra.ssl</strong></dt>
+        <dd>Wether SSL should be enabled on the communications with Cassandra cluster. Optional, defaults to false.<br/>
+        The keystore used for trusting SLL server socket can be set via JSSE system properties as explained on
+        <a href="https://docs.datastax.com/en/developer/java-driver/3.7/manual/ssl/">Cassandra driver manual</a>.</dd>
+
         <dt><strong>cassandra.replication.factor</strong></dt>
         <dd>Is the replication factor used upon keyspace creation. Modifying this property while the keyspace already exists
         will have no effect. Optional. Default value 1.</dd>


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[james-project] 32/36: [REFACTORING] Remove unused class IMAPRequestLineReader

Posted by bt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit 6eac63c5d1d8fd36cd5ba8ea12dd3ea29b52ea5b
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Thu Nov 7 12:17:12 2019 +0700

    [REFACTORING] Remove unused class IMAPRequestLineReader
    
    This is part of the unused package protocols.imap
---
 .../protocols/imap/IMAPRequestLineReader.java      | 84 ----------------------
 1 file changed, 84 deletions(-)

diff --git a/protocols/imap/src/main/java/org/apache/james/protocols/imap/IMAPRequestLineReader.java b/protocols/imap/src/main/java/org/apache/james/protocols/imap/IMAPRequestLineReader.java
deleted file mode 100644
index 0ad94dc..0000000
--- a/protocols/imap/src/main/java/org/apache/james/protocols/imap/IMAPRequestLineReader.java
+++ /dev/null
@@ -1,84 +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.protocols.imap;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.UnsupportedEncodingException;
-import java.nio.ByteBuffer;
-import java.util.Iterator;
-
-import org.apache.james.imap.api.display.HumanReadableText;
-import org.apache.james.imap.decode.ImapRequestLineReader;
-import org.apache.james.protocols.imap.utils.EolInputStream;
-import org.apache.james.protocols.imap.utils.FixedLengthInputStream;
-
-public class IMAPRequestLineReader extends ImapRequestLineReader {
-
-    private final Iterator<ByteBuffer> args;
-    private final byte[] prefix;
-    private int pos = 0;
-    private ByteBuffer curBuf;
-    
-    public IMAPRequestLineReader(IMAPRequest request) throws UnsupportedEncodingException {
-        this.args = request.getArguments();
-        prefix = (request.getTag() + " " + request.getCommand() + " ").getBytes("US-ASCII");
-    }
-    
-    @Override
-    public char nextChar() throws DecodingException {
-        if (pos >= prefix.length) {
-            if (curBuf == null || curBuf.remaining() == 0) {
-                if (args.hasNext()) {
-                    curBuf = args.next();
-                } else {
-                    throw new DecodingException(HumanReadableText.ILLEGAL_ARGUMENTS, "Unexpected end of stream.");
-                }
-            }
-            return (char) curBuf.get();
-        }
-        return (char) prefix[pos++];
-    }
-
-    @Override
-    public InputStream read(int size, boolean extraCRLF) throws DecodingException {
-        // Unset the next char.
-        nextSeen = false;
-        nextChar = 0;
-        FixedLengthInputStream in = new FixedLengthInputStream(new InputStream() {
-            
-            @Override
-            public int read() throws IOException {
-                return consume();
-            }
-        }, size);
-        if (extraCRLF) {
-            return new EolInputStream(this, in);
-        } else {
-            return in;
-        }
-    }
-
-    @Override
-    protected void commandContinuationRequest() throws DecodingException {
-        // TODO FIX ME!
-        
-    }
-
-}


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[james-project] 06/36: JAMES-2933 Improve IntelliJ build section based on Jerry Malcolm feedback

Posted by bt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit 0f8349b6a505a8bb9c82f09ea63560625647a4bb
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Fri Nov 1 11:28:13 2019 +0700

    JAMES-2933 Improve IntelliJ build section based on Jerry Malcolm feedback
---
 .../intellij-idea/intellij-james-project.png       | Bin 181143 -> 80415 bytes
 src/site/xdoc/server/dev-build.xml                 |  56 ++++++++++-----------
 2 files changed, 28 insertions(+), 28 deletions(-)

diff --git a/src/site/resources/server/images/intellij-idea/intellij-james-project.png b/src/site/resources/server/images/intellij-idea/intellij-james-project.png
index 8150483..8c11898 100644
Binary files a/src/site/resources/server/images/intellij-idea/intellij-james-project.png and b/src/site/resources/server/images/intellij-idea/intellij-james-project.png differ
diff --git a/src/site/xdoc/server/dev-build.xml b/src/site/xdoc/server/dev-build.xml
index a4aa408..2787db0 100644
--- a/src/site/xdoc/server/dev-build.xml
+++ b/src/site/xdoc/server/dev-build.xml
@@ -99,6 +99,34 @@
 
   </section>
 
+    <section name="Build James from IntelliJ IDEA">
+
+        <p>This section has been created using IntelliJ IDEA 2019.2.1 and Maven 3. And downloading the master version of the server
+            from <code>http://git-wip-us.apache.org/repos/asf/james-project.git/</code>.
+        </p>
+
+        <subsection name="Getting the sources from the repository">
+            <p>To download the source code, you can use the Git support that comes with IntelliJ IDEA following the next steps:</p>
+
+            <p>First, in the Welcome page, click on <strong>Check out from Version Control</strong> and select <strong>Git</strong>.</p>
+            <img src="./images/intellij-idea/intellij-new-project.png"/>
+            <p>In the pop-up window, fill the <strong>URL</strong> part to <i>http://git-wip-us.apache.org/repos/asf/james-project.git</i>.</p>
+            <img src="./images/intellij-idea/intellij-git-repo.png"/>            <br/>
+
+            <p>When this process is done, the project should look like this. <br/></p>
+            <img src="./images/intellij-idea/intellij-james-project.png"/>
+
+        </subsection>
+
+        <subsection name="Building the project">
+            <p> To build the project, you must open the <strong>Maven Projects</strong> panel (should be the maven option in the upper right). Then double click on the package goal to run this goal.<br/></p>
+            <img src="./images/intellij-idea/intellij-mvn.png"/>
+            <p>Then you will find the James server zip in the <strong>server/app/target</strong> folder.<br/></p>
+            <img src="./images/intellij-idea/intellij-james-zip.png"/>
+            <p>Note that tests can be long and can be skept by toggling <i>skip test</i></p>
+        </subsection>
+    </section>
+
   <section name="Build James Source from Eclipse">
 
     <p>Warning: due to bad scala support in eclipse, we are not able to compile James with Eclipse. Contributions to
@@ -158,34 +186,6 @@
 
     </subsection>
 
-    <section name="Build James from IntelliJ IDEA">
-
-          <p>This section has been created using IntelliJ IDEA 2019.2.1 and Maven 3. And downloading the master version of the server
-              from <code>http://git-wip-us.apache.org/repos/asf/james-project.git/</code>.
-          </p>
-
-          <subsection name="Getting the sources from the repository">
-              <p>To download the source code, you can use the Git support that comes with IntelliJ IDEA following the next steps:</p>
-
-              <p>First, in the Welcome page, click on <strong>Check out from Version Control</strong> and select <strong>Git</strong>.</p>
-              <img src="./images/intellij-idea/intellij-new-project.png"/>
-              <p>In the pop-up window, press the <strong>+</strong> button to add the James code repository in the next pop-up.</p>
-              <img src="./images/intellij-idea/intellij-git-repo.png"/>            <br/>
-
-              <p>When this process is done, the project should look like this. <br/></p>
-              <img src="./images/intellij-idea/intellij-james-project.png"/>
-
-          </subsection>
-
-          <subsection name="Building the project">
-              <p> To build the project, you must open the <strong>Maven Projects</strong> panel. Then double click on the install goal to run this goal.<br/></p>
-              <img src="./images/intellij-idea/intellij-mvn.png"/>
-              <p>Then you will find the James server zip in the <strong>server/app/target</strong> folder.<br/></p>
-              <img src="./images/intellij-idea/intellij-james-zip.png"/>
-              <p>Note that tests can be long and can be skept by toggling <i>skip test</i></p>
-          </subsection>
-    </section>
-
     <subsection name="Run James from Eclipse">
 
       <p>That's it. Run or Debug James in Eclipse (right-click on the Main class) and Have Fun!.</p>


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[james-project] 27/36: [REFACTORING] Clean protocols-imap javadoc

Posted by bt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit d46ec94b34e7afbafcdc2f6bbf6e8487f4cd1cbf
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Thu Nov 7 11:46:49 2019 +0700

    [REFACTORING] Clean protocols-imap javadoc
    
     - Solve IntellijJ warnings related to javaDoc
     - Remove verbose, meaningless entries
---
 .../org/apache/james/imap/api/display/CharsetUtil.java   | 10 +++-------
 .../java/org/apache/james/imap/api/message/IdRange.java  | 11 ++---------
 .../org/apache/james/imap/api/process/ImapSession.java   |  7 -------
 .../org/apache/james/imap/api/process/SearchResUtil.java |  9 ---------
 .../apache/james/imap/api/process/SelectedMailbox.java   | 11 -----------
 .../apache/james/imap/decode/ImapRequestLineReader.java  | 16 ++--------------
 .../decode/parser/AbstractSelectionCommandParser.java    | 10 ----------
 .../james/imap/decode/parser/FetchCommandParser.java     |  4 +---
 .../james/imap/decode/parser/GetACLCommandParser.java    |  1 -
 .../apache/james/imap/encode/ImapResponseComposer.java   | 14 ++------------
 .../org/apache/james/imap/encode/ImapResponseWriter.java |  2 --
 .../imap/encode/base/AbstractChainedImapEncoder.java     |  5 -----
 .../org/apache/james/imap/message/response/Literal.java  |  2 --
 .../james/imap/processor/AbstractMailboxProcessor.java   |  4 ----
 .../james/imap/processor/AuthenticateProcessor.java      |  8 --------
 .../imap/processor/CapabilityImplementingProcessor.java  |  3 +--
 .../org/apache/james/imap/processor/EnableProcessor.java |  5 -----
 .../org/apache/james/imap/processor/GetACLProcessor.java |  1 -
 .../org/apache/james/imap/processor/ListProcessor.java   |  7 -------
 .../imap/processor/PermitEnableCapabilityProcessor.java  | 14 --------------
 .../org/apache/james/imap/processor/SetACLProcessor.java |  1 -
 .../org/apache/james/protocols/imap/IMAPRequest.java     |  4 ----
 .../apache/james/protocols/imap/utils/DecoderUtils.java  |  5 +----
 23 files changed, 12 insertions(+), 142 deletions(-)

diff --git a/protocols/imap/src/main/java/org/apache/james/imap/api/display/CharsetUtil.java b/protocols/imap/src/main/java/org/apache/james/imap/api/display/CharsetUtil.java
index bdb32db..b8ec77c 100644
--- a/protocols/imap/src/main/java/org/apache/james/imap/api/display/CharsetUtil.java
+++ b/protocols/imap/src/main/java/org/apache/james/imap/api/display/CharsetUtil.java
@@ -29,9 +29,7 @@ import com.beetstra.jutf7.CharsetProvider;
 /**
  * Utility class which can be used to get a list of supported {@link Charset}'s 
  * 
- * Beside this it has some methods included which helps to encode/decode modified UTF7 
- * 
- *
+ * Beside this it has some methods included which helps to encode/decode modified UTF7
  */
 public class CharsetUtil {
 
@@ -78,8 +76,7 @@ public class CharsetUtil {
 
     /**
      * Decode the given UTF7 encoded <code>String</code>
-     * 
-     * @param string
+     *
      * @return decoded
      */
     public static String decodeModifiedUTF7(String string) {
@@ -91,8 +88,7 @@ public class CharsetUtil {
     /**
      * Encode the given <code>String</code> to modified UTF7. 
      * See RFC3501 for more details
-     * 
-     * @param string
+     *
      * @return encoded
      */
     
diff --git a/protocols/imap/src/main/java/org/apache/james/imap/api/message/IdRange.java b/protocols/imap/src/main/java/org/apache/james/imap/api/message/IdRange.java
index 69f6d86..0fbf92b 100644
--- a/protocols/imap/src/main/java/org/apache/james/imap/api/message/IdRange.java
+++ b/protocols/imap/src/main/java/org/apache/james/imap/api/message/IdRange.java
@@ -80,9 +80,7 @@ public final class IdRange implements Iterable<Long>, Comparable<IdRange> {
 
     /**
      * Return true if the {@link IdRange} includes the given value
-     * 
-     * @param value
-     * @return include
+     *
      */
     public boolean includes(long value) {
         return lowVal <= value && value <= highVal;
@@ -138,9 +136,7 @@ public final class IdRange implements Iterable<Long>, Comparable<IdRange> {
     /**
      * Utility method which will copy the given {@link List} and try to merge
      * the {@link IdRange} in the copy before return it.
-     * 
-     * 
-     * @param ranges
+     *
      * @return mergedRanges
      */
     public static List<IdRange> mergeRanges(List<IdRange> ranges) {
@@ -180,8 +176,6 @@ public final class IdRange implements Iterable<Long>, Comparable<IdRange> {
 
     /**
      * Return a read-only {@link Iterator} which contains all msn/uid which fail in the specified range.
-     * 
-     * @return rangeIt
      */
     @Override
     public Iterator<Long> iterator() {
@@ -195,7 +189,6 @@ public final class IdRange implements Iterable<Long>, Comparable<IdRange> {
     
     /**
      * {@link Iterator} of a range of msn/uid
-     *
      */
     private final class RangeIterator implements Iterator<Long> {
 
diff --git a/protocols/imap/src/main/java/org/apache/james/imap/api/process/ImapSession.java b/protocols/imap/src/main/java/org/apache/james/imap/api/process/ImapSession.java
index 8128285..9bbf27a 100644
--- a/protocols/imap/src/main/java/org/apache/james/imap/api/process/ImapSession.java
+++ b/protocols/imap/src/main/java/org/apache/james/imap/api/process/ImapSession.java
@@ -139,29 +139,22 @@ public interface ImapSession {
 
     /**
      * Push in a new {@link ImapLineHandler} which is called for the next line received
-     * 
-     * @param lineHandler
      */
     void pushLineHandler(ImapLineHandler lineHandler);
 
     /**
      * Pop the current {@link ImapLineHandler}
-     * 
      */
     void popLineHandler();
     
     /**
      * Return true if multiple namespaces are supported
-     * 
-     * @return multipleNamespaces
      */
     boolean supportMultipleNamespaces();
     
     /**
      * Return true if the login / authentication via plain username / password is
      * disallowed
-     * 
-     * @return plainDisallowed
      */
     boolean isPlainAuthDisallowed();
 
diff --git a/protocols/imap/src/main/java/org/apache/james/imap/api/process/SearchResUtil.java b/protocols/imap/src/main/java/org/apache/james/imap/api/process/SearchResUtil.java
index 9931322..4e9c522 100644
--- a/protocols/imap/src/main/java/org/apache/james/imap/api/process/SearchResUtil.java
+++ b/protocols/imap/src/main/java/org/apache/james/imap/api/process/SearchResUtil.java
@@ -25,7 +25,6 @@ import org.apache.james.imap.api.message.IdRange;
 
 /**
  * Utility class which is used to support the SEARCHRES extension
- *
  */
 public class SearchResUtil {
     
@@ -34,9 +33,6 @@ public class SearchResUtil {
     /**
      * Return the saved sequence-set which you can refer to with $. This method will
      * return a IdRange[0] If no sequence-set is saved
-     * 
-     * @param session
-     * @return sequenceSet
      */
     public static IdRange[] getSavedSequenceSet(ImapSession session) {
         Object obj = session.getAttribute(SEARCHRES_SAVED_SET);
@@ -49,9 +45,6 @@ public class SearchResUtil {
     
     /**
      * Save the given sequence-set which you can refer to later with $.
-     * 
-     * @param session
-     * @param ranges
      */
     public static void saveSequenceSet(ImapSession session, IdRange[] ranges) {
         session.setAttribute(SEARCHRES_SAVED_SET, IdRange.mergeRanges(Arrays.asList(ranges)).toArray(new IdRange[0]));
@@ -59,8 +52,6 @@ public class SearchResUtil {
     
     /**
      * Reset the saved sequence-set
-     * 
-     * @param session
      */
     public static void resetSavedSequenceSet(ImapSession session) {
         session.setAttribute(SEARCHRES_SAVED_SET, null);
diff --git a/protocols/imap/src/main/java/org/apache/james/imap/api/process/SelectedMailbox.java b/protocols/imap/src/main/java/org/apache/james/imap/api/process/SelectedMailbox.java
index a0a1425..c16bdbc 100644
--- a/protocols/imap/src/main/java/org/apache/james/imap/api/process/SelectedMailbox.java
+++ b/protocols/imap/src/main/java/org/apache/james/imap/api/process/SelectedMailbox.java
@@ -73,22 +73,16 @@ public interface SelectedMailbox {
 
     /**
      * Return the count of all recent uids
-     * 
-     * @return recentCount
      */
     int recentCount();
 
     /**
      * Return the count of all existing uids
-     * 
-     * @return existsCount
      */
     long existsCount();
 
     /**
      * Return the path of the selected Mailbox
-     * 
-     * @return path
      */
     MailboxPath getPath() throws MailboxException;
 
@@ -128,9 +122,6 @@ public interface SelectedMailbox {
      */
     boolean isRecentUidRemoved();
 
-    /**
-     * 
-     */
     void resetRecentUidRemoved();
 
 
@@ -178,8 +169,6 @@ public interface SelectedMailbox {
     
     /**
      * Return all applicable Flags for the selected mailbox
-     * 
-     * @return flags
      */
     Flags getApplicableFlags();
     
diff --git a/protocols/imap/src/main/java/org/apache/james/imap/decode/ImapRequestLineReader.java b/protocols/imap/src/main/java/org/apache/james/imap/decode/ImapRequestLineReader.java
index 1006bc7..121ec3b 100644
--- a/protocols/imap/src/main/java/org/apache/james/imap/decode/ImapRequestLineReader.java
+++ b/protocols/imap/src/main/java/org/apache/james/imap/decode/ImapRequestLineReader.java
@@ -173,8 +173,6 @@ public abstract class ImapRequestLineReader {
 
     /**
      * Consume the rest of the line
-     * 
-     * @throws DecodingException
      */
     public void consumeLine() throws DecodingException {
         char next = nextChar();
@@ -265,9 +263,6 @@ public abstract class ImapRequestLineReader {
      * as an astring.
      * 
      * Be aware that mailbox names are encoded via a modified UTF7. For more information RFC3501
-     * 
-     * 
-     * 
      */
     public String mailboxUTF7() throws DecodingException {
         String mailbox = astring();
@@ -282,7 +277,6 @@ public abstract class ImapRequestLineReader {
      * Reads one <code>date</code> argument from the request.
      * 
      * @return <code>DayMonthYear</code>, not null
-     * @throws DecodingException
      */
     public DayMonthYear date() throws DecodingException {
 
@@ -443,9 +437,6 @@ public abstract class ImapRequestLineReader {
     /**
      * Consumes a CRLF from the request. TODO: This is too liberal, the spec
      * insists on \r\n for new lines.
-     * 
-     * @param request
-     * @throws DecodingException
      */
     private void consumeCRLF() throws DecodingException {
         char next = nextChar();
@@ -528,10 +519,9 @@ public abstract class ImapRequestLineReader {
     }
 
     /**
-     * Calls {@link #number()} with argument of false
+     * Calls {@link #number(boolean)} with argument of false
      * 
      * @return number
-     * @throws DecodingException
      */
     public long number() throws DecodingException {
         return number(false);
@@ -723,10 +713,8 @@ public abstract class ImapRequestLineReader {
     
     /**
      * Parse a range which use a ":" as delimiter
-     * 
-     * @param range
+     *
      * @return idRange
-     * @throws DecodingException
      */
     private IdRange parseRange(String range) throws DecodingException {
         int pos = range.indexOf(':');
diff --git a/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/AbstractSelectionCommandParser.java b/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/AbstractSelectionCommandParser.java
index fb773be..d83a855 100644
--- a/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/AbstractSelectionCommandParser.java
+++ b/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/AbstractSelectionCommandParser.java
@@ -163,11 +163,6 @@ public abstract class AbstractSelectionCommandParser extends AbstractImapCommand
      *                          ;; set of UIDs corresponding to the messages in
      *                          ;; known-sequence-set, in ascending order.
      *                          ;; * is not allowed.
-     * 
-     * 
-     * @param ranges
-     * @param checkOrder
-     * @throws DecodingException
      */
     private void checkIdRanges(IdRange[] ranges, boolean checkOrder) throws DecodingException {
         long last = 0;
@@ -205,11 +200,6 @@ public abstract class AbstractSelectionCommandParser extends AbstractImapCommand
      *                          ;; set of UIDs corresponding to the messages in
      *                          ;; known-sequence-set, in ascending order.
      *                          ;; * is not allowed.
-     * 
-     * 
-     * @param ranges
-     * @param checkOrder
-     * @throws DecodingException
      */
     private void checkUidRanges(UidRange[] ranges, boolean checkOrder) throws DecodingException {
         MessageUid last = MessageUid.MIN_VALUE;
diff --git a/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/FetchCommandParser.java b/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/FetchCommandParser.java
index d87a58c..a061d7f 100644
--- a/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/FetchCommandParser.java
+++ b/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/FetchCommandParser.java
@@ -48,10 +48,8 @@ public class FetchCommandParser extends AbstractUidCommandParser {
     /**
      * Create a {@link FetchData} by reading from the
      * {@link ImapRequestLineReader}
-     * 
-     * @param request
+     *
      * @return fetchData
-     * @throws DecodingException
      */
     protected FetchData fetchRequest(ImapRequestLineReader request) throws DecodingException {
         FetchData fetch = new FetchData();
diff --git a/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/GetACLCommandParser.java b/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/GetACLCommandParser.java
index da3dc0c..7f6b168 100644
--- a/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/GetACLCommandParser.java
+++ b/protocols/imap/src/main/java/org/apache/james/imap/decode/parser/GetACLCommandParser.java
@@ -30,7 +30,6 @@ import org.apache.james.protocols.imap.DecodingException;
 
 /**
  * GETACL Parser
- * 
  */
 public class GetACLCommandParser extends AbstractImapCommandParser {
 
diff --git a/protocols/imap/src/main/java/org/apache/james/imap/encode/ImapResponseComposer.java b/protocols/imap/src/main/java/org/apache/james/imap/encode/ImapResponseComposer.java
index d40a8cd..6df18b2 100644
--- a/protocols/imap/src/main/java/org/apache/james/imap/encode/ImapResponseComposer.java
+++ b/protocols/imap/src/main/java/org/apache/james/imap/encode/ImapResponseComposer.java
@@ -52,19 +52,15 @@ public interface ImapResponseComposer {
 
     /**
      * Composes a <code>NIL</code>.
-     * 
-     * @throws IOException
      */
     ImapResponseComposer nil() throws IOException;
 
     /**
      * Compose a response which contains the {@link ImapCommand} to which the
      * response belongs
-     * 
-     * @param command
+     *
      * @param message
      * @return self
-     * @throws IOException
      */
     ImapResponseComposer commandResponse(ImapCommand command, String message) throws IOException;
 
@@ -90,24 +86,18 @@ public interface ImapResponseComposer {
      * Write a '*'
      * 
      * @return composer
-     * @throws IOException
      */
     ImapResponseComposer untagged() throws IOException;
 
     /**
-     * 
-     * @param name
      * @return composer
-     * @throws IOException
      */
     ImapResponseComposer commandName(String name) throws IOException;
 
     /**
      * Write the message of type <code>String</code>
-     * 
-     * @param message
+     *
      * @return composer
-     * @throws IOException
      */
     ImapResponseComposer message(String message) throws IOException;
 
diff --git a/protocols/imap/src/main/java/org/apache/james/imap/encode/ImapResponseWriter.java b/protocols/imap/src/main/java/org/apache/james/imap/encode/ImapResponseWriter.java
index 35bfaa0..d3bc42f 100644
--- a/protocols/imap/src/main/java/org/apache/james/imap/encode/ImapResponseWriter.java
+++ b/protocols/imap/src/main/java/org/apache/james/imap/encode/ImapResponseWriter.java
@@ -38,7 +38,6 @@ public interface ImapResponseWriter {
      * 
      * @param literal
      *            <code>Literal</code> to be written, not null
-     * @throws IOException
      */
     void write(Literal literal) throws IOException;
 
@@ -47,7 +46,6 @@ public interface ImapResponseWriter {
      * 
      * @param buffer
      *            <code>byte array</code> to be written, not null
-     * @throws IOException
      */
     void write(byte[] buffer) throws IOException;
 
diff --git a/protocols/imap/src/main/java/org/apache/james/imap/encode/base/AbstractChainedImapEncoder.java b/protocols/imap/src/main/java/org/apache/james/imap/encode/base/AbstractChainedImapEncoder.java
index 65e750e..1c454c7 100644
--- a/protocols/imap/src/main/java/org/apache/james/imap/encode/base/AbstractChainedImapEncoder.java
+++ b/protocols/imap/src/main/java/org/apache/james/imap/encode/base/AbstractChainedImapEncoder.java
@@ -57,11 +57,6 @@ public abstract class AbstractChainedImapEncoder implements ImapEncoder {
 
     /**
      * Call next Encoder in the chain
-     * 
-     * @param message
-     * @param composer
-     * @param session
-     * @throws IOException
      */
     protected void chainEncode(ImapMessage message, ImapResponseComposer composer, ImapSession session) throws IOException {
         next.encode(message, composer, session);
diff --git a/protocols/imap/src/main/java/org/apache/james/imap/message/response/Literal.java b/protocols/imap/src/main/java/org/apache/james/imap/message/response/Literal.java
index fe59629..6b95df9 100644
--- a/protocols/imap/src/main/java/org/apache/james/imap/message/response/Literal.java
+++ b/protocols/imap/src/main/java/org/apache/james/imap/message/response/Literal.java
@@ -28,7 +28,6 @@ public interface Literal {
      * 
      * @return number of octets which will be
      *         put onto the channel
-     * @throws IOException 
      */
     long size() throws IOException;
 
@@ -37,7 +36,6 @@ public interface Literal {
      * Return the Literal as {@link InputStream}
      * 
      * @return elementIn
-     * @throws IOException
      */
     InputStream getInputStream() throws IOException;
 }
diff --git a/protocols/imap/src/main/java/org/apache/james/imap/processor/AbstractMailboxProcessor.java b/protocols/imap/src/main/java/org/apache/james/imap/processor/AbstractMailboxProcessor.java
index fcebc73..435f67a 100644
--- a/protocols/imap/src/main/java/org/apache/james/imap/processor/AbstractMailboxProcessor.java
+++ b/protocols/imap/src/main/java/org/apache/james/imap/processor/AbstractMailboxProcessor.java
@@ -373,9 +373,6 @@ public abstract class AbstractMailboxProcessor<M extends ImapRequest> extends Ab
 
     /**
      * Joins the elements of a mailboxPath together and returns them as a string
-     * 
-     * @param mailboxPath
-     * @return
      */
     private String joinMailboxPath(MailboxPath mailboxPath, char delimiter) {
         StringBuilder sb = new StringBuilder("");
@@ -513,7 +510,6 @@ public abstract class AbstractMailboxProcessor<M extends ImapRequest> extends Ab
      * @param range
      *            input range
      * @return normalized message range
-     * @throws MessageRangeException
      */
     protected MessageRange normalizeMessageRange(SelectedMailbox selected, MessageRange range) throws MessageRangeException {
         Type rangeType = range.getType();
diff --git a/protocols/imap/src/main/java/org/apache/james/imap/processor/AuthenticateProcessor.java b/protocols/imap/src/main/java/org/apache/james/imap/processor/AuthenticateProcessor.java
index 3660f68..04cc360 100644
--- a/protocols/imap/src/main/java/org/apache/james/imap/processor/AuthenticateProcessor.java
+++ b/protocols/imap/src/main/java/org/apache/james/imap/processor/AuthenticateProcessor.java
@@ -44,8 +44,6 @@ import com.google.common.collect.ImmutableList;
 
 /**
  * Processor which handles the AUTHENTICATE command. Only authtype of PLAIN is supported ATM.
- * 
- *
  */
 public class AuthenticateProcessor extends AbstractAuthProcessor<AuthenticateRequest> implements CapabilityImplementingProcessor {
     private static final Logger LOGGER = LoggerFactory.getLogger(AuthenticateProcessor.class);
@@ -88,12 +86,6 @@ public class AuthenticateProcessor extends AbstractAuthProcessor<AuthenticateReq
 
     /**
      * Parse the initialClientResponse and do a PLAIN AUTH with it
-     * 
-     * @param initialClientResponse
-     * @param session
-     * @param tag
-     * @param command
-     * @param responder
      */
     protected void doPlainAuth(String initialClientResponse, ImapSession session, String tag, ImapCommand command, Responder responder) {
         AuthenticationAttempt authenticationAttempt = parseDelegationAttempt(initialClientResponse);
diff --git a/protocols/imap/src/main/java/org/apache/james/imap/processor/CapabilityImplementingProcessor.java b/protocols/imap/src/main/java/org/apache/james/imap/processor/CapabilityImplementingProcessor.java
index bfb63d9..042bf2f 100644
--- a/protocols/imap/src/main/java/org/apache/james/imap/processor/CapabilityImplementingProcessor.java
+++ b/protocols/imap/src/main/java/org/apache/james/imap/processor/CapabilityImplementingProcessor.java
@@ -31,8 +31,7 @@ public interface CapabilityImplementingProcessor extends ImapProcessor {
 
     /**
      * Return a list of all Capabilities that are implemented by the Processor
-     * 
-     * @param session
+     *
      * @return list not null
      */
     List<String> getImplementedCapabilities(ImapSession session);
diff --git a/protocols/imap/src/main/java/org/apache/james/imap/processor/EnableProcessor.java b/protocols/imap/src/main/java/org/apache/james/imap/processor/EnableProcessor.java
index 76b8ac0..0a25ac3 100644
--- a/protocols/imap/src/main/java/org/apache/james/imap/processor/EnableProcessor.java
+++ b/protocols/imap/src/main/java/org/apache/james/imap/processor/EnableProcessor.java
@@ -103,8 +103,6 @@ public class EnableProcessor extends AbstractMailboxProcessor<EnableRequest> imp
 
     /**
      * Add a {@link PermitEnableCapabilityProcessor} which can be enabled
-     * 
-     * @param implementor
      */
     public void addProcessor(PermitEnableCapabilityProcessor implementor) {
         capabilities.add(implementor);
@@ -112,9 +110,6 @@ public class EnableProcessor extends AbstractMailboxProcessor<EnableRequest> imp
 
     /**
      * Return all enabled <code>CAPABILITIES</code> for this {@link ImapSession}
-     * 
-     * @param session
-     * @return enabled
      */
     @SuppressWarnings("unchecked")
     public static Set<String> getEnabledCapabilities(ImapSession session) {
diff --git a/protocols/imap/src/main/java/org/apache/james/imap/processor/GetACLProcessor.java b/protocols/imap/src/main/java/org/apache/james/imap/processor/GetACLProcessor.java
index 2599dc7..988b383 100644
--- a/protocols/imap/src/main/java/org/apache/james/imap/processor/GetACLProcessor.java
+++ b/protocols/imap/src/main/java/org/apache/james/imap/processor/GetACLProcessor.java
@@ -50,7 +50,6 @@ import com.google.common.collect.ImmutableList;
 
 /**
  * GETACL Processor.
- * 
  */
 public class GetACLProcessor extends AbstractMailboxProcessor<GetACLRequest> implements CapabilityImplementingProcessor {
     private static final Logger LOGGER = LoggerFactory.getLogger(GetACLProcessor.class);
diff --git a/protocols/imap/src/main/java/org/apache/james/imap/processor/ListProcessor.java b/protocols/imap/src/main/java/org/apache/james/imap/processor/ListProcessor.java
index e0569c1..f1972bd 100644
--- a/protocols/imap/src/main/java/org/apache/james/imap/processor/ListProcessor.java
+++ b/protocols/imap/src/main/java/org/apache/james/imap/processor/ListProcessor.java
@@ -81,13 +81,6 @@ public class ListProcessor extends AbstractMailboxProcessor<ListRequest> {
      * the hierarchy delimiter and the root name of the name given in the
      * reference. The value returned as the root MAY be the empty string if the
      * reference is non-rooted or is an empty string.
-     * 
-     * @param referenceName
-     * @param mailboxName
-     * @param session
-     * @param tag
-     * @param command
-     * @param responder
      */
     protected final void doProcess(String referenceName, String mailboxName, ImapSession session, String tag, ImapCommand command, Responder responder, MailboxTyper mailboxTyper) {
         String user = ImapSessionUtils.getUserName(session);
diff --git a/protocols/imap/src/main/java/org/apache/james/imap/processor/PermitEnableCapabilityProcessor.java b/protocols/imap/src/main/java/org/apache/james/imap/processor/PermitEnableCapabilityProcessor.java
index 3c02fb4..52e6242 100644
--- a/protocols/imap/src/main/java/org/apache/james/imap/processor/PermitEnableCapabilityProcessor.java
+++ b/protocols/imap/src/main/java/org/apache/james/imap/processor/PermitEnableCapabilityProcessor.java
@@ -32,32 +32,18 @@ public interface PermitEnableCapabilityProcessor extends CapabilityImplementingP
      * Return the capabilities which supports to get ENABLED.
      * 
      * Be sure that these are also returned by {@link #getImplementedCapabilities(ImapSession)}
-     * 
-     * @param session
-     * @return permitCaps
      */
     List<String> getPermitEnableCapabilities(ImapSession session);
     
     /**
      * Callback which is used when a ENABLED command was used to enable on of the CAPABILITIES which is managed by this implementation
-     * 
-     * @param message
-     * @param responder
-     * @param session
-     * @param capability
-     * @throws EnableException
      */
     void enable(ImapMessage message, Responder responder, ImapSession session, String capability) throws EnableException;
 
     /**
      * Exception which should get thrown if for whatever reason its not possible to enable a capability
-     * 
-     *
      */
     final class EnableException extends Exception {
-        /**
-         * 
-         */
         private static final long serialVersionUID = -4456052968041000753L;
 
         public EnableException(String msg, Throwable e) {
diff --git a/protocols/imap/src/main/java/org/apache/james/imap/processor/SetACLProcessor.java b/protocols/imap/src/main/java/org/apache/james/imap/processor/SetACLProcessor.java
index 841c61f..2ff8c9b 100644
--- a/protocols/imap/src/main/java/org/apache/james/imap/processor/SetACLProcessor.java
+++ b/protocols/imap/src/main/java/org/apache/james/imap/processor/SetACLProcessor.java
@@ -49,7 +49,6 @@ import org.slf4j.LoggerFactory;
 
 /**
  * SETACL Processor.
-
  */
 public class SetACLProcessor extends AbstractMailboxProcessor<SetACLRequest> implements CapabilityImplementingProcessor {
     private static final Logger LOGGER = LoggerFactory.getLogger(SetACLProcessor.class);
diff --git a/protocols/imap/src/main/java/org/apache/james/protocols/imap/IMAPRequest.java b/protocols/imap/src/main/java/org/apache/james/protocols/imap/IMAPRequest.java
index 85025a2..3d1de81 100644
--- a/protocols/imap/src/main/java/org/apache/james/protocols/imap/IMAPRequest.java
+++ b/protocols/imap/src/main/java/org/apache/james/protocols/imap/IMAPRequest.java
@@ -64,8 +64,6 @@ public class IMAPRequest implements Request {
     
     /**
      * Return the tag of the request
-     * 
-     * @return tag
      */
     public String getTag() {
         return tag;
@@ -108,8 +106,6 @@ public class IMAPRequest implements Request {
     /**
      * Return an {@link Iterator} which holds all argument lines. The returned {@link ByteBuffer}'s will be 
      * rewind by calling {@link ByteBuffer#rewind()} before return them
-     * 
-     * @return arguments
      */
     public Iterator<ByteBuffer> getArguments() {
         return new Iterator<ByteBuffer>() {
diff --git a/protocols/imap/src/main/java/org/apache/james/protocols/imap/utils/DecoderUtils.java b/protocols/imap/src/main/java/org/apache/james/protocols/imap/utils/DecoderUtils.java
index 00dbc21..e819816 100644
--- a/protocols/imap/src/main/java/org/apache/james/protocols/imap/utils/DecoderUtils.java
+++ b/protocols/imap/src/main/java/org/apache/james/protocols/imap/utils/DecoderUtils.java
@@ -228,7 +228,6 @@ public final class DecoderUtils {
      * @param yearChar
      *            forth digit
      * @return {@link Calendar} year
-     * @throws DecodingException
      */
     public static int decodeYear(char milleniumChar, char centuryChar, char decadeChar, char yearChar) throws DecodingException {
         return (decodeDigit(milleniumChar) * 1000) + (decodeDigit(centuryChar) * 100) + (decodeDigit(decadeChar) * 10) + decodeDigit(yearChar);
@@ -244,7 +243,6 @@ public final class DecoderUtils {
      * @param monthThirdChar
      *            third character in a month triple
      * @return {@link Calendar} month (<code>JAN</code>=0)
-     * @throws DecodingException
      */
     public static int decodeMonth(char monthFirstChar, char monthSecondChar, char monthThirdChar) throws DecodingException {
         final int result;
@@ -423,8 +421,7 @@ public final class DecoderUtils {
 
     /**
      * Decodes a number character into a <code>0-9</code> digit.
-     * 
-     * @param character
+     *
      * @return a digit
      * @throws DecodingException
      *             if the char is not a digit


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[james-project] 18/36: PROTOCOLS-37 [Refactoring] Remove unnecessary handling of FutureResponse

Posted by bt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit b3ee4b9e042575c52c9577752467259d295e2b23
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Thu Nov 7 08:59:45 2019 +0700

    PROTOCOLS-37 [Refactoring] Remove unnecessary handling of FutureResponse
    
    As stated by some comments, FutureResponse support is partially implemented
    and disabled. As such, we can get rid of it.
---
 .../protocols/api/AbstractProtocolTransport.java   | 37 +++-------------------
 .../protocols/api/handler/CommandDispatcher.java   | 26 ++-------------
 .../netty/BasicChannelUpstreamHandler.java         | 11 -------
 3 files changed, 7 insertions(+), 67 deletions(-)

diff --git a/protocols/api/src/main/java/org/apache/james/protocols/api/AbstractProtocolTransport.java b/protocols/api/src/main/java/org/apache/james/protocols/api/AbstractProtocolTransport.java
index 8b814bb..aa06d99 100644
--- a/protocols/api/src/main/java/org/apache/james/protocols/api/AbstractProtocolTransport.java
+++ b/protocols/api/src/main/java/org/apache/james/protocols/api/AbstractProtocolTransport.java
@@ -25,8 +25,6 @@ import java.util.List;
 import java.util.Queue;
 import java.util.concurrent.LinkedBlockingQueue;
 
-import org.apache.james.protocols.api.future.FutureResponse;
-
 
 /**
  * Abstract base class for {@link ProtocolTransport} implementation which already takes care of all the complex
@@ -56,21 +54,14 @@ public abstract class AbstractProtocolTransport implements ProtocolTransport {
                 enqueued = true;
             }
         }
-        
-        // if we didn't enqueue then we check if the response is writable or we have to 
-        // set us "asynchrnous" and wait for response to be ready.
+
         if (!enqueued) {
-            if (isResponseWritable(response)) {
-                writeResponseToClient(response, session);
-            } else {
-                addDequeuerListener(response, session);
-                isAsync = true;
-            }
+            writeResponseToClient(response, session);
         }
     }
     
     /**
-     * Helper method which tries to write all queued {@link Response}'s to the remote client. This method is aware of {@link FutureResponse} and makes sure the {@link Response}'s are written
+     * Helper method which tries to write all queued {@link Response}'s to the remote client. This method makes sure the {@link Response}'s are written
      * in the correct order
      * 
      * This is related to PROTOCOLS-36
@@ -94,30 +85,10 @@ public abstract class AbstractProtocolTransport implements ProtocolTransport {
                 }
             }
 
-            // if we have something in the queue we continue writing until we
-            // find something asynchronous.
-            if (isResponseWritable(queuedResponse)) {
-                writeResponseToClient(queuedResponse, session);
-            } else {
-                addDequeuerListener(queuedResponse, session);
-                // no changes to isAsync here, because in this method we are always already async.
-                break;
-            }
+            writeResponseToClient(queuedResponse, session);
         }
     }
     
-    private boolean isResponseWritable(Response response) {
-        return !(response instanceof FutureResponse) || ((FutureResponse) response).isReady();
-    }
-    
-    private void addDequeuerListener(Response responseFuture, final ProtocolSession session) {
-        ((FutureResponse) responseFuture).addListener(
-            response -> {
-                writeResponseToClient(response, session);
-                writeQueuedResponses(session);
-            });
-    }
-    
     /**
      * Write the {@link Response} to the client
      * 
diff --git a/protocols/api/src/main/java/org/apache/james/protocols/api/handler/CommandDispatcher.java b/protocols/api/src/main/java/org/apache/james/protocols/api/handler/CommandDispatcher.java
index 1c83cfa..90bd4a0 100644
--- a/protocols/api/src/main/java/org/apache/james/protocols/api/handler/CommandDispatcher.java
+++ b/protocols/api/src/main/java/org/apache/james/protocols/api/handler/CommandDispatcher.java
@@ -33,8 +33,6 @@ import org.apache.james.protocols.api.BaseRequest;
 import org.apache.james.protocols.api.ProtocolSession;
 import org.apache.james.protocols.api.Request;
 import org.apache.james.protocols.api.Response;
-import org.apache.james.protocols.api.future.FutureResponse;
-import org.apache.james.protocols.api.future.FutureResponseImpl;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -183,28 +181,10 @@ public class CommandDispatcher<SessionT extends ProtocolSession> implements Exte
     private Response executeResultHandlers(final SessionT session, Response responseFuture, final long executionTime, final CommandHandler<SessionT> cHandler, final Iterator<ProtocolHandlerResultHandler<Response, SessionT>> resultHandlers) {
         // Check if the there is a ResultHandler left to execute if not just return the response
         if (resultHandlers.hasNext()) {
-            // Special handling of FutureResponse
-            // See PROTOCOLS-37
-            if (responseFuture instanceof FutureResponse) {
-                final FutureResponseImpl futureResponse = new FutureResponseImpl();
-                ((FutureResponse) responseFuture).addListener(response -> {
-                    Response r = resultHandlers.next().onResponse(session, response, executionTime, cHandler);
+            responseFuture = resultHandlers.next().onResponse(session, responseFuture, executionTime, cHandler);
 
-                    // call the next ResultHandler
-                    r = executeResultHandlers(session, r, executionTime, cHandler, resultHandlers);
-
-                    // notify the FutureResponse that we are ready
-                    futureResponse.setResponse(r);
-                });
-                
-                // just return the new FutureResponse which will get notified once its ready
-                return futureResponse;
-            }  else {
-                responseFuture = resultHandlers.next().onResponse(session, responseFuture, executionTime, cHandler);
-                
-                // call the next ResultHandler 
-                return executeResultHandlers(session, responseFuture, executionTime, cHandler, resultHandlers);
-            }
+            // call the next ResultHandler
+            return executeResultHandlers(session, responseFuture, executionTime, cHandler, resultHandlers);
         }
         return responseFuture;
     }
diff --git a/protocols/netty/src/main/java/org/apache/james/protocols/netty/BasicChannelUpstreamHandler.java b/protocols/netty/src/main/java/org/apache/james/protocols/netty/BasicChannelUpstreamHandler.java
index 3b0586a..59b5239 100644
--- a/protocols/netty/src/main/java/org/apache/james/protocols/netty/BasicChannelUpstreamHandler.java
+++ b/protocols/netty/src/main/java/org/apache/james/protocols/netty/BasicChannelUpstreamHandler.java
@@ -31,7 +31,6 @@ import org.apache.james.protocols.api.ProtocolSession;
 import org.apache.james.protocols.api.ProtocolSessionImpl;
 import org.apache.james.protocols.api.ProtocolTransport;
 import org.apache.james.protocols.api.Response;
-import org.apache.james.protocols.api.future.FutureResponse;
 import org.apache.james.protocols.api.handler.ConnectHandler;
 import org.apache.james.protocols.api.handler.DisconnectHandler;
 import org.apache.james.protocols.api.handler.LineHandler;
@@ -99,11 +98,6 @@ public class BasicChannelUpstreamHandler extends SimpleChannelUpstreamHandler {
                     long executionTime = System.currentTimeMillis() - start;
 
                     for (ProtocolHandlerResultHandler resultHandler : resultHandlers) {
-                        // Disable till PROTOCOLS-37 is implemented
-                        if (response instanceof FutureResponse) {
-                            LOGGER.debug("ProtocolHandlerResultHandler are not supported for FutureResponse yet");
-                            break;
-                        }
                         resultHandler.onResponse(session, response, executionTime, cHandler);
                     }
                     if (response != null) {
@@ -156,11 +150,6 @@ public class BasicChannelUpstreamHandler extends SimpleChannelUpstreamHandler {
                 long executionTime = System.currentTimeMillis() - start;
 
                 for (ProtocolHandlerResultHandler resultHandler : resultHandlers) {
-                    // Disable till PROTOCOLS-37 is implemented
-                    if (response instanceof FutureResponse) {
-                        LOGGER.debug("ProtocolHandlerResultHandler are not supported for FutureResponse yet");
-                        break;
-                    }
                     response = resultHandler.onResponse(pSession, response, executionTime, lHandler);
                 }
                 if (response != null) {


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[james-project] 20/36: PROTOCOLS-37 [Refactoring] Get rid of FutureResponse class

Posted by bt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit 88d9ee8568a0b453c8765ed62fad3d7213e2a620
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Thu Nov 7 09:02:00 2019 +0700

    PROTOCOLS-37 [Refactoring] Get rid of FutureResponse class
---
 .../james/protocols/api/future/FutureResponse.java |  68 ----------
 .../protocols/api/future/FutureResponseImpl.java   | 149 ---------------------
 2 files changed, 217 deletions(-)

diff --git a/protocols/api/src/main/java/org/apache/james/protocols/api/future/FutureResponse.java b/protocols/api/src/main/java/org/apache/james/protocols/api/future/FutureResponse.java
deleted file mode 100644
index 02701f1..0000000
--- a/protocols/api/src/main/java/org/apache/james/protocols/api/future/FutureResponse.java
+++ /dev/null
@@ -1,68 +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.protocols.api.future;
-
-import org.apache.james.protocols.api.Response;
-
-/**
- * An special {@link Response} which allows to populate it in an async fashion. It also allows to register listeners which will get notified once the 
- * {@link FutureResponse} is ready
- * 
- *
- */
-public interface FutureResponse extends Response {
-
-    /**
-     * Add a {@link ResponseListener} which will get notified once {@link #isReady()} is true
-     * 
-     * @param listener
-     */
-    void addListener(ResponseListener listener);
-    
-    /**
-     * Remote a {@link ResponseListener}
-     * 
-     * @param listener
-     */
-    void removeListener(ResponseListener listener);
-    
-    /**
-     * Return <code>true</code> once the {@link FutureResponse} is ready and calling any of the get methods will not block any more.
-     * 
-     * @return ready
-     */
-    boolean isReady();
-    
-    
-    /**
-     * Listener which will get notified once the {@link FutureResponse#isReady()} returns <code>true</code>
-     * 
-     *
-     */
-    interface ResponseListener {
-
-        /**
-         * The {@link FutureResponse} is ready for processing
-         * 
-         * @param response
-         */
-        void onResponse(FutureResponse response);
-    }
-}
diff --git a/protocols/api/src/main/java/org/apache/james/protocols/api/future/FutureResponseImpl.java b/protocols/api/src/main/java/org/apache/james/protocols/api/future/FutureResponseImpl.java
deleted file mode 100644
index eed41c6..0000000
--- a/protocols/api/src/main/java/org/apache/james/protocols/api/future/FutureResponseImpl.java
+++ /dev/null
@@ -1,149 +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.protocols.api.future;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.james.protocols.api.AbstractResponse;
-import org.apache.james.protocols.api.Response;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * {@link FutureResponse} implementation which wraps a {@link AbstractResponse} implementation
- * 
- *
- */
-public class FutureResponseImpl implements FutureResponse {
-    
-    private final Logger logger;
-
-    public FutureResponseImpl() {
-        this(LoggerFactory.getLogger(FutureResponseImpl.class));
-    }
-    
-    public FutureResponseImpl(Logger logger) {
-        this.logger = logger;
-    }
-    
-    protected Response response;
-    private List<ResponseListener> listeners;
-    private int waiters;
-
-    protected final synchronized void checkReady() {
-        while (!isReady()) {
-            try {
-                waiters++;
-                wait();
-            } catch (InterruptedException e) {
-                Thread.currentThread().interrupt();
-            } finally {
-                waiters--;
-            }
-        }
-    }
-
-    @Override
-    public synchronized void addListener(ResponseListener listener) {
-        if (isReady()) {
-            listener.onResponse(this);
-        } else {
-            if (listeners == null) {
-                listeners = new ArrayList<>();
-            }
-            listeners.add(listener);
-        }
-    }
-
-    @Override
-    public synchronized void removeListener(ResponseListener listener) {
-        if (!isReady()) {
-            if (listeners != null) {
-                listeners.remove(listener);
-            }
-        }
-    }
-
-    @Override
-    public synchronized boolean isReady() {
-        return response != null;
-    }
-    
-    @Override
-    public List<CharSequence> getLines() {
-        checkReady();
-        return response.getLines();
-    }
-
-
-    @Override
-    public String getRetCode() {
-        checkReady();
-        return response.getRetCode();
-    }
-
-
-    @Override
-    public boolean isEndSession() {
-        checkReady();
-        return response.isEndSession();
-    }
-
-    @Override
-    public synchronized String toString() {
-        checkReady();
-        return response.toString();
-    }
-    
-    /**
-     * Set the {@link Response} which will be used to notify the registered
-     * {@link ResponseListener}'. After this method is called all waiting
-     * threads will get notified and {@link #isReady()} will return <code>true<code>. 
-     * 
-     * @param response
-     */
-    public void setResponse(Response response) {
-        boolean fire = false;
-        synchronized (this) {
-            if (!isReady()) {
-                this.response = response;
-                fire = listeners != null;
-
-                if (waiters > 0) {
-                    notifyAll();
-                }
-            }
-        }
-
-        if (fire) {
-            for (ResponseListener listener : listeners) {
-                try {
-                    listener.onResponse(this);
-                } catch (Throwable e) {
-                    logger.warn("An exception was thrown by the listener {}", listener, e);
-                }
-            }
-            listeners = null;
-            
-        }
-    }
-
-}


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[james-project] 04/36: JAMES-2933 Maven 3.6.0+ is required by the build

Posted by bt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit 21379b0d0c5cf48c776d6ade73affabdafe3dd33
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Thu Oct 31 10:02:38 2019 +0700

    JAMES-2933 Maven 3.6.0+ is required by the build
---
 pom.xml                            | 2 +-
 src/site/xdoc/server/dev-build.xml | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/pom.xml b/pom.xml
index 5d57f19..1f02df5 100644
--- a/pom.xml
+++ b/pom.xml
@@ -3131,7 +3131,7 @@
                         <configuration>
                             <rules>
                                 <requireMavenVersion>
-                                    <version>3.3.9</version>
+                                    <version>3.6.0</version>
                                 </requireMavenVersion>
                             </rules>
                         </configuration>
diff --git a/src/site/xdoc/server/dev-build.xml b/src/site/xdoc/server/dev-build.xml
index 99b530f..aa630bb 100644
--- a/src/site/xdoc/server/dev-build.xml
+++ b/src/site/xdoc/server/dev-build.xml
@@ -68,7 +68,7 @@
       <li>Java Development Kit - You must have a JDK of Java version 11 or higher installed to build the
           James distribution.  The exact JDKs available depend on the platform. A JDK must be downloaded and
           installed before the build can run.</li>
-      <li>Maven 3.3.9 - This is a Java-tailored, XML-configured, extensible build or make system. You need maven (3.3.9+) in order
+      <li>Maven 3.6.0 - This is a Java-tailored, XML-configured, extensible build or make system. You need maven (3.6.0+) in order
           to build James. We recommend you to use maven 3.6.2. You can get maven from <a href="http://maven.apache.org/download.html">here</a>.
           Installation instructions for maven are also available on the same page <a href="http://maven.apache.org/download.html">http://maven.apache.org/download.html</a>.</li>
     </ol>


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[james-project] 22/36: PROTOCOLS-37 [Refactoring] ReIndent AbstractProtocolTransport

Posted by bt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit 5062a28a203788e2e3429554af4724f87dd556ae
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Thu Nov 7 09:17:31 2019 +0700

    PROTOCOLS-37 [Refactoring] ReIndent AbstractProtocolTransport
---
 .../james/protocols/api/AbstractProtocolTransport.java | 18 ++++--------------
 1 file changed, 4 insertions(+), 14 deletions(-)

diff --git a/protocols/api/src/main/java/org/apache/james/protocols/api/AbstractProtocolTransport.java b/protocols/api/src/main/java/org/apache/james/protocols/api/AbstractProtocolTransport.java
index df4f478..65825ca 100644
--- a/protocols/api/src/main/java/org/apache/james/protocols/api/AbstractProtocolTransport.java
+++ b/protocols/api/src/main/java/org/apache/james/protocols/api/AbstractProtocolTransport.java
@@ -28,16 +28,11 @@ import java.util.concurrent.LinkedBlockingQueue;
 
 /**
  * Abstract base class for {@link ProtocolTransport} implementation which already takes care of all the complex
- * stuff when handling {@link Response}'s. 
- * 
- * 
- *
+ * stuff when handling {@link Response}'s.
  */
 public abstract class AbstractProtocolTransport implements ProtocolTransport {
-    
     private static final String CRLF = "\r\n";
 
-    
     // TODO: Should we limit the size ?
     private final Queue<Response> responses = new LinkedBlockingQueue<>();
     private volatile boolean isAsync = false;
@@ -73,13 +68,11 @@ public abstract class AbstractProtocolTransport implements ProtocolTransport {
                 if (isStartTLSSupported()) {
                     startTLS = true;
                 } else {
-                    
                     // StartTls is not supported by this transport, so throw a exception
                     throw new UnsupportedOperationException("StartTls is not supported by this ProtocolTransport implementation");
                 }
             }
-            
-            
+
             if (response instanceof StreamResponse) {
                 writeToClient(toBytes(response), session, false);
                 writeToClient(((StreamResponse) response).getStream(), session, startTLS);
@@ -94,10 +87,9 @@ public abstract class AbstractProtocolTransport implements ProtocolTransport {
             if (response.isEndSession()) {
                 // close the channel if needed after the message was written out
                 close();
-           } 
-         }        
+            }
+        }
     }
-    
 
     /**
      * Take the {@link Response} and encode it to a <code>byte</code> array
@@ -120,7 +112,6 @@ public abstract class AbstractProtocolTransport implements ProtocolTransport {
             throw new RuntimeException("No US-ASCII ?");
         }
     }
-    
 
     /**
      * Write the given <code>byte's</code> to the remote peer
@@ -139,7 +130,6 @@ public abstract class AbstractProtocolTransport implements ProtocolTransport {
      * @param startTLS true if startTLS should be started after the {@link InputStream} was written to the client
      */
     protected abstract void writeToClient(InputStream in, ProtocolSession session, boolean startTLS);
-
     
     /**
      * Close the Transport


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[james-project] 21/36: PROTOCOLS-37 [Refactoring] AbstractProtocolTransport::writeQueuedResponses is no longer used

Posted by bt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit 2cf0c2fe8659ea39e171f6abb419483918f61ffe
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Thu Nov 7 09:05:27 2019 +0700

    PROTOCOLS-37 [Refactoring] AbstractProtocolTransport::writeQueuedResponses is no longer used
---
 .../protocols/api/AbstractProtocolTransport.java   | 29 ----------------------
 1 file changed, 29 deletions(-)

diff --git a/protocols/api/src/main/java/org/apache/james/protocols/api/AbstractProtocolTransport.java b/protocols/api/src/main/java/org/apache/james/protocols/api/AbstractProtocolTransport.java
index aa06d99..df4f478 100644
--- a/protocols/api/src/main/java/org/apache/james/protocols/api/AbstractProtocolTransport.java
+++ b/protocols/api/src/main/java/org/apache/james/protocols/api/AbstractProtocolTransport.java
@@ -61,35 +61,6 @@ public abstract class AbstractProtocolTransport implements ProtocolTransport {
     }
     
     /**
-     * Helper method which tries to write all queued {@link Response}'s to the remote client. This method makes sure the {@link Response}'s are written
-     * in the correct order
-     * 
-     * This is related to PROTOCOLS-36
-     * 
-     * @param session
-     */
-    private  void writeQueuedResponses(ProtocolSession session) {
-        
-        // dequeue Responses until non is left
-        while (true) {
-            
-            Response queuedResponse = null;
-            
-            // synchrnously we check responses and if it is empty we move back to non asynch
-            // behaviour
-            synchronized (this) {
-                queuedResponse = responses.poll();
-                if (queuedResponse == null) {
-                    isAsync = false;
-                    break;
-                }
-            }
-
-            writeResponseToClient(queuedResponse, session);
-        }
-    }
-    
-    /**
      * Write the {@link Response} to the client
      * 
      * @param response


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[james-project] 23/36: PROTOCOLS-36 [Refactoring] AbstractProtocolTransport response queue is no longer needed

Posted by bt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit f3ae6ea82c161960e9a1d272440af2a0e1ca85f0
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Thu Nov 7 09:20:08 2019 +0700

    PROTOCOLS-36 [Refactoring] AbstractProtocolTransport response queue is no longer needed
    
    As stated by PROTOCOLS-36:
    
    ```
    If we mix FutureResponse and Response implementation we MUST ensure that
    the right order of responses is maintained. This basicly means that we need
    to put responses in a queue and dequeue them in the right order (respecting
    the FutureResponse async nature)
    ```
    
    Removing FutureResponse solves this, and removes the need for a queue.
---
 .../protocols/api/AbstractProtocolTransport.java    | 21 +--------------------
 1 file changed, 1 insertion(+), 20 deletions(-)

diff --git a/protocols/api/src/main/java/org/apache/james/protocols/api/AbstractProtocolTransport.java b/protocols/api/src/main/java/org/apache/james/protocols/api/AbstractProtocolTransport.java
index 65825ca..1b76bf8 100644
--- a/protocols/api/src/main/java/org/apache/james/protocols/api/AbstractProtocolTransport.java
+++ b/protocols/api/src/main/java/org/apache/james/protocols/api/AbstractProtocolTransport.java
@@ -22,8 +22,6 @@ package org.apache.james.protocols.api;
 import java.io.InputStream;
 import java.io.UnsupportedEncodingException;
 import java.util.List;
-import java.util.Queue;
-import java.util.concurrent.LinkedBlockingQueue;
 
 
 /**
@@ -32,27 +30,10 @@ import java.util.concurrent.LinkedBlockingQueue;
  */
 public abstract class AbstractProtocolTransport implements ProtocolTransport {
     private static final String CRLF = "\r\n";
-
-    // TODO: Should we limit the size ?
-    private final Queue<Response> responses = new LinkedBlockingQueue<>();
-    private volatile boolean isAsync = false;
     
     @Override
     public final void writeResponse(Response response, ProtocolSession session) {
-        // if we already in asynchrnous mode we simply enqueue the response
-        // we do this synchronously because we may have a dequeuer thread working on
-        // isAsync and responses.
-        boolean enqueued = false;
-        synchronized (this) {
-            if (isAsync == true) {
-                responses.offer(response);
-                enqueued = true;
-            }
-        }
-
-        if (!enqueued) {
-            writeResponseToClient(response, session);
-        }
+        writeResponseToClient(response, session);
     }
     
     /**


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[james-project] 15/36: JAMES-2904 Introduce a KeyspaceFactory

Posted by bt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit a82f3313a0e16a2eeb8c065fb4e01e3fa4b781b7
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Wed Oct 30 10:53:29 2019 +0700

    JAMES-2904 Introduce a KeyspaceFactory
    
    Handles the responsibility of creating the keyspace, if it does not
    already exists.
---
 .../backends/cassandra/init/ClusterFactory.java    | 16 ----------
 .../backends/cassandra/init/KeyspaceFactory.java   | 36 ++++++++++++++++++++++
 .../cassandra/init/ResilientClusterProvider.java   |  2 +-
 .../james/backends/cassandra/CassandraCluster.java |  4 ++-
 .../SessionWithInitializedTablesFactoryTest.java   |  4 +--
 5 files changed, 42 insertions(+), 20 deletions(-)

diff --git a/backends-common/cassandra/src/main/java/org/apache/james/backends/cassandra/init/ClusterFactory.java b/backends-common/cassandra/src/main/java/org/apache/james/backends/cassandra/init/ClusterFactory.java
index eafd622..ff04fb4 100644
--- a/backends-common/cassandra/src/main/java/org/apache/james/backends/cassandra/init/ClusterFactory.java
+++ b/backends-common/cassandra/src/main/java/org/apache/james/backends/cassandra/init/ClusterFactory.java
@@ -24,7 +24,6 @@ import org.apache.james.backends.cassandra.init.configuration.ClusterConfigurati
 import com.datastax.driver.core.Cluster;
 import com.datastax.driver.core.ConsistencyLevel;
 import com.datastax.driver.core.QueryOptions;
-import com.datastax.driver.core.Session;
 import com.datastax.driver.core.SocketOptions;
 import com.google.common.base.Preconditions;
 
@@ -65,21 +64,6 @@ public class ClusterFactory {
         }
     }
 
-    public static Cluster createWithKeyspace(ClusterConfiguration clusterConfiguration) {
-        Cluster cluster = create(clusterConfiguration);
-        createKeyspace(clusterConfiguration, cluster);
-        return cluster;
-    }
-
-    public static void createKeyspace(ClusterConfiguration clusterConfiguration, Cluster cluster) {
-        try (Session session = cluster.connect()) {
-            session.execute("CREATE KEYSPACE IF NOT EXISTS " + clusterConfiguration.getKeyspace()
-                + " WITH replication = {'class':'SimpleStrategy', 'replication_factor':" + clusterConfiguration.getReplicationFactor() + "}"
-                + " AND durable_writes = " + clusterConfiguration.isDurableWrites()
-                + ";");
-        }
-    }
-
     private static QueryOptions queryOptions() {
         return new QueryOptions()
                 .setConsistencyLevel(ConsistencyLevel.QUORUM);
diff --git a/backends-common/cassandra/src/main/java/org/apache/james/backends/cassandra/init/KeyspaceFactory.java b/backends-common/cassandra/src/main/java/org/apache/james/backends/cassandra/init/KeyspaceFactory.java
new file mode 100644
index 0000000..3f71803
--- /dev/null
+++ b/backends-common/cassandra/src/main/java/org/apache/james/backends/cassandra/init/KeyspaceFactory.java
@@ -0,0 +1,36 @@
+/****************************************************************
+ * 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.backends.cassandra.init;
+
+import org.apache.james.backends.cassandra.init.configuration.ClusterConfiguration;
+
+import com.datastax.driver.core.Cluster;
+import com.datastax.driver.core.Session;
+
+public class KeyspaceFactory {
+    public static void createKeyspace(ClusterConfiguration clusterConfiguration, Cluster cluster) {
+        try (Session session = cluster.connect()) {
+            session.execute("CREATE KEYSPACE IF NOT EXISTS " + clusterConfiguration.getKeyspace()
+                + " WITH replication = {'class':'SimpleStrategy', 'replication_factor':" + clusterConfiguration.getReplicationFactor() + "}"
+                + " AND durable_writes = " + clusterConfiguration.isDurableWrites()
+                + ";");
+        }
+    }
+}
diff --git a/backends-common/cassandra/src/main/java/org/apache/james/backends/cassandra/init/ResilientClusterProvider.java b/backends-common/cassandra/src/main/java/org/apache/james/backends/cassandra/init/ResilientClusterProvider.java
index 743b887..657f118 100644
--- a/backends-common/cassandra/src/main/java/org/apache/james/backends/cassandra/init/ResilientClusterProvider.java
+++ b/backends-common/cassandra/src/main/java/org/apache/james/backends/cassandra/init/ResilientClusterProvider.java
@@ -62,7 +62,7 @@ public class ResilientClusterProvider implements Provider<Cluster> {
         return () -> {
             Cluster cluster = ClusterFactory.create(configuration);
             try {
-                ClusterFactory.createKeyspace(configuration, cluster);
+                KeyspaceFactory.createKeyspace(configuration, cluster);
                 return cluster;
             } catch (Exception e) {
                 cluster.close();
diff --git a/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/CassandraCluster.java b/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/CassandraCluster.java
index 50c6099..d83fc26 100644
--- a/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/CassandraCluster.java
+++ b/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/CassandraCluster.java
@@ -24,6 +24,7 @@ import org.apache.james.backends.cassandra.components.CassandraModule;
 import org.apache.james.backends.cassandra.init.CassandraTableManager;
 import org.apache.james.backends.cassandra.init.CassandraTypesProvider;
 import org.apache.james.backends.cassandra.init.ClusterFactory;
+import org.apache.james.backends.cassandra.init.KeyspaceFactory;
 import org.apache.james.backends.cassandra.init.SessionWithInitializedTablesFactory;
 import org.apache.james.backends.cassandra.init.configuration.ClusterConfiguration;
 import org.apache.james.util.Host;
@@ -61,7 +62,8 @@ public final class CassandraCluster implements AutoCloseable {
                 .keyspace(KEYSPACE)
                 .disableDurableWrites()
                 .build();
-            cluster = ClusterFactory.createWithKeyspace(clusterConfiguration);
+            cluster = ClusterFactory.create(clusterConfiguration);
+            KeyspaceFactory.createKeyspace(clusterConfiguration, cluster);
             session = new SessionWithInitializedTablesFactory(clusterConfiguration, cluster, module).get();
             typesProvider = new CassandraTypesProvider(module, session);
         } catch (Exception exception) {
diff --git a/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/init/SessionWithInitializedTablesFactoryTest.java b/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/init/SessionWithInitializedTablesFactoryTest.java
index f3e6dd9..3235b40 100644
--- a/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/init/SessionWithInitializedTablesFactoryTest.java
+++ b/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/init/SessionWithInitializedTablesFactoryTest.java
@@ -33,7 +33,6 @@ import org.apache.james.backends.cassandra.init.configuration.ClusterConfigurati
 import org.apache.james.backends.cassandra.versions.CassandraSchemaVersionDAO;
 import org.apache.james.backends.cassandra.versions.CassandraSchemaVersionManager;
 import org.apache.james.backends.cassandra.versions.CassandraSchemaVersionModule;
-import org.apache.james.util.Host;
 import org.junit.jupiter.api.AfterAll;
 import org.junit.jupiter.api.AfterEach;
 import org.junit.jupiter.api.BeforeAll;
@@ -127,7 +126,8 @@ class SessionWithInitializedTablesFactoryTest {
             .replicationFactor(1)
             .disableDurableWrites()
             .build();
-        Cluster cluster = ClusterFactory.createWithKeyspace(clusterConfiguration);
+        Cluster cluster = ClusterFactory.create(clusterConfiguration);
+        KeyspaceFactory.createKeyspace(clusterConfiguration, cluster);
         return () -> new SessionWithInitializedTablesFactory(
                 clusterConfiguration,
                 cluster,


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[james-project] 12/36: JAMES-2904 CassandraExtension should have only one constructor

Posted by bt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit 1b547402d533fc91ea042bb4e3136c0259e8fa99
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Fri Oct 4 10:03:32 2019 +0700

    JAMES-2904 CassandraExtension should have only one constructor
---
 .../src/test/java/org/apache/james/CassandraExtension.java     |  7 +------
 .../src/test/java/org/apache/james/FixingGhostMailboxTest.java | 10 ++++++----
 .../org/apache/james/JamesServerWithRetryConnectionTest.java   |  8 ++++----
 3 files changed, 11 insertions(+), 14 deletions(-)

diff --git a/server/container/guice/cassandra-guice/src/test/java/org/apache/james/CassandraExtension.java b/server/container/guice/cassandra-guice/src/test/java/org/apache/james/CassandraExtension.java
index f7d1fc4..d2564f1 100644
--- a/server/container/guice/cassandra-guice/src/test/java/org/apache/james/CassandraExtension.java
+++ b/server/container/guice/cassandra-guice/src/test/java/org/apache/james/CassandraExtension.java
@@ -24,15 +24,10 @@ import org.junit.jupiter.api.extension.ExtensionContext;
 import com.google.inject.Module;
 
 public class CassandraExtension implements GuiceModuleTestExtension {
-
     private final DockerCassandraRule cassandra;
 
     public CassandraExtension() {
-        this(new DockerCassandraRule());
-    }
-
-    public CassandraExtension(DockerCassandraRule cassandra) {
-        this.cassandra = cassandra;
+        this.cassandra = new DockerCassandraRule();
     }
 
     @Override
diff --git a/server/container/guice/cassandra-guice/src/test/java/org/apache/james/FixingGhostMailboxTest.java b/server/container/guice/cassandra-guice/src/test/java/org/apache/james/FixingGhostMailboxTest.java
index dd01a60..ffd8e4f 100644
--- a/server/container/guice/cassandra-guice/src/test/java/org/apache/james/FixingGhostMailboxTest.java
+++ b/server/container/guice/cassandra-guice/src/test/java/org/apache/james/FixingGhostMailboxTest.java
@@ -60,6 +60,7 @@ import org.apache.james.modules.MailboxProbeImpl;
 import org.apache.james.modules.TestJMAPServerModule;
 import org.apache.james.server.CassandraProbe;
 import org.apache.james.task.TaskManager;
+import org.apache.james.util.Host;
 import org.apache.james.utils.DataProbeImpl;
 import org.apache.james.jmap.draft.JmapGuiceProbe;
 import org.apache.james.utils.WebAdminGuiceProbe;
@@ -92,12 +93,12 @@ public class FixingGhostMailboxTest {
     private static final String ALICE_SECRET = "aliceSecret";
     private static final String BOB_SECRET = "bobSecret";
 
-    public static final DockerCassandraRule cassandra = new DockerCassandraRule();
+    public static final CassandraExtension dockerCassandra = new CassandraExtension();
 
     @RegisterExtension
     static JamesServerExtension testExtension = new JamesServerBuilder()
         .extension(new DockerElasticSearchExtension())
-        .extension(new CassandraExtension(cassandra))
+        .extension(dockerCassandra)
         .server(configuration -> GuiceJamesServer.forConfiguration(configuration)
             .combineWith(ALL_BUT_JMX_CASSANDRA_MODULE)
             .overrideWith(binder -> binder.bind(TextExtractor.class).to(PDFTextExtractor.class))
@@ -138,10 +139,11 @@ public class FixingGhostMailboxTest {
             .addUser(BOB, BOB_SECRET);
         accessToken = authenticateJamesUser(baseUri(server), ALICE, ALICE_SECRET);
 
+        Host cassandraHost = dockerCassandra.getCassandra().getHost();
         session = Cluster.builder()
             .withoutJMXReporting()
-            .addContactPoint(cassandra.getIp())
-            .withPort(cassandra.getMappedPort(9042))
+            .addContactPoint(cassandraHost.getHostName())
+            .withPort(cassandraHost.getPort())
             .build()
             .connect(server.getProbe(CassandraProbe.class).getKeyspace());
 
diff --git a/server/container/guice/cassandra-guice/src/test/java/org/apache/james/JamesServerWithRetryConnectionTest.java b/server/container/guice/cassandra-guice/src/test/java/org/apache/james/JamesServerWithRetryConnectionTest.java
index 4f6745b..8945a3c 100644
--- a/server/container/guice/cassandra-guice/src/test/java/org/apache/james/JamesServerWithRetryConnectionTest.java
+++ b/server/container/guice/cassandra-guice/src/test/java/org/apache/james/JamesServerWithRetryConnectionTest.java
@@ -46,13 +46,13 @@ class JamesServerWithRetryConnectionTest {
     private static final int LIMIT_TO_10_MESSAGES = 10;
     private static final long WAITING_TIME = TimeUnit.MILLISECONDS.convert(10, TimeUnit.SECONDS);
 
-    private static final DockerCassandraRule cassandraRule = new DockerCassandraRule();
     private static final DockerElasticSearchExtension dockerElasticSearch = new DockerElasticSearchExtension();
+    private static final CassandraExtension dockerCassandra = new CassandraExtension();
 
     @RegisterExtension
     static JamesServerExtension testExtension = new JamesServerBuilder()
         .extension(dockerElasticSearch)
-        .extension(new CassandraExtension(cassandraRule))
+        .extension(dockerCassandra)
         .server(configuration -> GuiceJamesServer.forConfiguration(configuration)
             .combineWith(ALL_BUT_JMX_CASSANDRA_MODULE)
             .overrideWith(binder -> binder.bind(TextExtractor.class).to(PDFTextExtractor.class))
@@ -83,9 +83,9 @@ class JamesServerWithRetryConnectionTest {
 
     @Test
     void serverShouldRetryToConnectToCassandraWhenStartService(GuiceJamesServer server) throws Exception {
-        cassandraRule.pause();
+        dockerCassandra.getCassandra().pause();
 
-        waitToStartContainer(WAITING_TIME, cassandraRule::unpause);
+        waitToStartContainer(WAITING_TIME, dockerCassandra.getCassandra()::unpause);
 
         assertThatServerStartCorrectly(server);
     }


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[james-project] 02/36: JAMES-2933 Change intellij CVS image to Git

Posted by bt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit 581fba722c245d252c3d7f7c72720026b147d0cb
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Tue Oct 29 12:20:45 2019 +0700

    JAMES-2933 Change intellij CVS image to Git
---
 .../server/images/intellij-idea/intellij-git-repo.png   | Bin 0 -> 20247 bytes
 .../images/intellij-idea/intellij-svn-repo-add-repo.png | Bin 29020 -> 0 bytes
 .../intellij-svn-repo-checkout-choose-folder.png        | Bin 40299 -> 0 bytes
 .../server/images/intellij-idea/intellij-svn-repo.png   | Bin 60958 -> 0 bytes
 src/site/xdoc/server/dev-build.xml                      |   5 +----
 5 files changed, 1 insertion(+), 4 deletions(-)

diff --git a/src/site/resources/server/images/intellij-idea/intellij-git-repo.png b/src/site/resources/server/images/intellij-idea/intellij-git-repo.png
new file mode 100644
index 0000000..3cd5c27
Binary files /dev/null and b/src/site/resources/server/images/intellij-idea/intellij-git-repo.png differ
diff --git a/src/site/resources/server/images/intellij-idea/intellij-svn-repo-add-repo.png b/src/site/resources/server/images/intellij-idea/intellij-svn-repo-add-repo.png
deleted file mode 100644
index 7c3d095..0000000
Binary files a/src/site/resources/server/images/intellij-idea/intellij-svn-repo-add-repo.png and /dev/null differ
diff --git a/src/site/resources/server/images/intellij-idea/intellij-svn-repo-checkout-choose-folder.png b/src/site/resources/server/images/intellij-idea/intellij-svn-repo-checkout-choose-folder.png
deleted file mode 100644
index 63a3db8..0000000
Binary files a/src/site/resources/server/images/intellij-idea/intellij-svn-repo-checkout-choose-folder.png and /dev/null differ
diff --git a/src/site/resources/server/images/intellij-idea/intellij-svn-repo.png b/src/site/resources/server/images/intellij-idea/intellij-svn-repo.png
deleted file mode 100644
index 86618f5..0000000
Binary files a/src/site/resources/server/images/intellij-idea/intellij-svn-repo.png and /dev/null differ
diff --git a/src/site/xdoc/server/dev-build.xml b/src/site/xdoc/server/dev-build.xml
index 81d9d7f..bdfdb8e 100644
--- a/src/site/xdoc/server/dev-build.xml
+++ b/src/site/xdoc/server/dev-build.xml
@@ -222,10 +222,7 @@
           <p>First, in the Welcome page, click on <strong>Check out from Version Control</strong> and select <strong>Git</strong>.</p>
           <img src="./images/intellij-idea/intellij-new-project.png"/>
           <p>In the pop-up window, press the <strong>+</strong> button to add the James code repository in the next pop-up.</p>
-          <img src="./images/intellij-idea/intellij-svn-repo.png"/>            <br/>
-          <img src="./images/intellij-idea/intellij-svn-repo-add-repo.png"/>        <br/>
-          <p>Then, choose the location for the project.</p>
-          <img src="./images/intellij-idea/intellij-svn-repo-checkout-choose-folder.png"/>
+          <img src="./images/intellij-idea/intellij-git-repo.png"/>            <br/>
 
           <p>When this process is done, the project should look like this. <br/></p>
           <img src="./images/intellij-idea/intellij-james-project.png"/>


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[james-project] 31/36: [REFACTORING] IMAPMDCContext Should rely on ImapSession, not IMAPSession

Posted by bt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit 1047f874a5f83c8000672935d5a23173ea99168e
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Thu Nov 7 12:16:25 2019 +0700

    [REFACTORING] IMAPMDCContext Should rely on ImapSession, not IMAPSession
    
    IMAPSession is unused outside of protocols.imap code, not linked to executed code.
---
 .../james/imapserver/netty/IMAPMDCContext.java     | 24 ++++++++++++++--------
 1 file changed, 15 insertions(+), 9 deletions(-)

diff --git a/server/protocols/protocols-imap4/src/main/java/org/apache/james/imapserver/netty/IMAPMDCContext.java b/server/protocols/protocols-imap4/src/main/java/org/apache/james/imapserver/netty/IMAPMDCContext.java
index a0d5710..bb8799e 100644
--- a/server/protocols/protocols-imap4/src/main/java/org/apache/james/imapserver/netty/IMAPMDCContext.java
+++ b/server/protocols/protocols-imap4/src/main/java/org/apache/james/imapserver/netty/IMAPMDCContext.java
@@ -24,8 +24,11 @@ import java.net.InetSocketAddress;
 import java.net.SocketAddress;
 import java.util.Optional;
 
+import org.apache.james.core.Username;
+import org.apache.james.imap.api.ImapSessionUtils;
+import org.apache.james.imap.api.process.ImapSession;
 import org.apache.james.imap.api.process.SelectedMailbox;
-import org.apache.james.protocols.imap.IMAPSession;
+import org.apache.james.mailbox.MailboxSession;
 import org.apache.james.util.MDCBuilder;
 import org.jboss.netty.channel.ChannelHandlerContext;
 import org.jboss.netty.channel.ChannelLocal;
@@ -59,14 +62,17 @@ public class IMAPMDCContext {
     }
 
     private static MDCBuilder from(Object o) {
-        return Optional.ofNullable(o)
-            .filter(object -> object instanceof IMAPSession)
-            .map(object -> (IMAPSession) object)
-            .map(imapSession -> MDCBuilder.create()
-                .addContext(MDCBuilder.SESSION_ID, imapSession.getSessionID())
-                .addContext(MDCBuilder.USER, imapSession.getUser())
-                .addContext(from(Optional.ofNullable(imapSession.getSelected()))))
-            .orElse(MDCBuilder.create());
+        if (o instanceof ImapSession) {
+            ImapSession imapSession = (ImapSession) o;
+            MailboxSession mailboxSession = (MailboxSession) imapSession.getAttribute(ImapSessionUtils.MAILBOX_SESSION_ATTRIBUTE_SESSION_KEY);
+
+            return MDCBuilder.create()
+                .addContext(MDCBuilder.USER, Optional.ofNullable(mailboxSession)
+                    .map(MailboxSession::getUser)
+                    .map(Username::asString))
+                .addContext(from(Optional.ofNullable(imapSession.getSelected())));
+        }
+        return MDCBuilder.create();
     }
 
     private static MDCBuilder from(Optional<SelectedMailbox> selectedMailbox) {


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[james-project] 11/36: JAMES-2904 ClusterBuild should be turned into ClusterFactory

Posted by bt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit b48dc9715eaafb681aa4093e7fe60ff5c4dae03a
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Wed Oct 2 12:29:22 2019 +0700

    JAMES-2904 ClusterBuild should be turned into ClusterFactory
    
    Two part of James code were handling default values: the ClusterConfiguration
    and the ClusterBuilder.
    
    This made adding new options complicated.
---
 .../backends/cassandra/init/ClusterBuilder.java    | 178 ---------------------
 .../backends/cassandra/init/ClusterFactory.java    |  87 ++++++++++
 .../init/ClusterWithKeyspaceCreatedFactory.java    |  36 -----
 .../cassandra/init/ResilientClusterProvider.java   |  13 +-
 .../init/configuration/ClusterConfiguration.java   |  15 +-
 .../james/backends/cassandra/CassandraCluster.java |   9 +-
 .../james/backends/cassandra/DockerCassandra.java  |  16 +-
 ...terBuilderTest.java => ClusterFactoryTest.java} |   9 +-
 .../SessionWithInitializedTablesFactoryTest.java   |   8 +-
 src/site/xdoc/server/config-cassandra.xml          |   4 +-
 10 files changed, 118 insertions(+), 257 deletions(-)

diff --git a/backends-common/cassandra/src/main/java/org/apache/james/backends/cassandra/init/ClusterBuilder.java b/backends-common/cassandra/src/main/java/org/apache/james/backends/cassandra/init/ClusterBuilder.java
deleted file mode 100644
index e41c6d6..0000000
--- a/backends-common/cassandra/src/main/java/org/apache/james/backends/cassandra/init/ClusterBuilder.java
+++ /dev/null
@@ -1,178 +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.backends.cassandra.init;
-
-import java.util.Collection;
-import java.util.Optional;
-
-import org.apache.james.backends.cassandra.init.configuration.QueryLoggerConfiguration;
-import org.apache.james.util.Host;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.datastax.driver.core.Cluster;
-import com.datastax.driver.core.ConsistencyLevel;
-import com.datastax.driver.core.PoolingOptions;
-import com.datastax.driver.core.QueryOptions;
-import com.datastax.driver.core.SocketOptions;
-import com.google.common.base.Preconditions;
-import com.google.common.collect.ImmutableList;
-
-public class ClusterBuilder {
-    private static final Logger LOGGER = LoggerFactory.getLogger(ClusterBuilder.class);
-    private static final String DEFAULT_CLUSTER_IP = "localhost";
-    public static final int DEFAULT_CASSANDRA_PORT = 9042;
-
-    public static ClusterBuilder builder() {
-        return new ClusterBuilder();
-    }
-
-    private Optional<String> username;
-    private Optional<String> password;
-
-    private Optional<Collection<Host>> servers;
-
-    private Optional<QueryLoggerConfiguration> queryLogger;
-    private Optional<Integer> readTimeoutMillis;
-    private Optional<Integer> connectTimeoutMillis;
-    private Optional<PoolingOptions> poolingOptions;
-    private Optional<Boolean> useSsl;
-
-    private ClusterBuilder() {
-        username = Optional.empty();
-        password = Optional.empty();
-        useSsl = Optional.empty();
-
-        servers = Optional.empty();
-
-        queryLogger = Optional.empty();
-        readTimeoutMillis = Optional.empty();
-        connectTimeoutMillis = Optional.empty();
-        poolingOptions = Optional.empty();
-    }
-
-    public ClusterBuilder username(String username) {
-        return username(Optional.of(username));
-    }
-
-    public ClusterBuilder password(String password) {
-        return password(Optional.of(password));
-    }
-
-    public ClusterBuilder username(Optional<String> username) {
-        this.username = username;
-
-        return this;
-    }
-
-    public ClusterBuilder password(Optional<String> password) {
-        this.password = password;
-
-        return this;
-    }
-
-    public ClusterBuilder useSsl(boolean useSsl) {
-        this.useSsl = Optional.of(useSsl);
-
-        return this;
-    }
-
-    public ClusterBuilder poolingOptions(PoolingOptions poolingOptions) {
-        this.poolingOptions = Optional.of(poolingOptions);
-        return this;
-    }
-
-    public ClusterBuilder poolingOptions(Optional<PoolingOptions> poolingOptions) {
-        this.poolingOptions = poolingOptions;
-        return this;
-    }
-
-    public ClusterBuilder servers(Host... servers) {
-        this.servers = Optional.of(ImmutableList.copyOf(servers));
-
-        return this;
-    }
-
-    public ClusterBuilder servers(Collection<Host> servers) {
-        this.servers = Optional.of(servers);
-
-        return this;
-    }
-
-    public ClusterBuilder queryLoggerConfiguration(QueryLoggerConfiguration queryLogger) {
-        this.queryLogger = Optional.of(queryLogger);
-
-        return this;
-    }
-
-    public ClusterBuilder readTimeoutMillis(int readTimeoutMillis) {
-        this.readTimeoutMillis = Optional.of(readTimeoutMillis);
-        return this;
-    }
-
-    public ClusterBuilder connectTimeoutMillis(int connectTimeoutMillis) {
-        this.connectTimeoutMillis = Optional.of(connectTimeoutMillis);
-        return this;
-    }
-
-    public Cluster build() {
-        Preconditions.checkState(username.isPresent() == password.isPresent(), "If you specify username, you must specify password");
-
-        Cluster.Builder clusterBuilder = Cluster.builder()
-            .withoutJMXReporting();
-        getServers().forEach(server -> clusterBuilder
-            .addContactPoint(server.getHostName())
-            .withPort(server.getPort()));
-
-        username.map(username ->
-            password.map(password ->
-                clusterBuilder.withCredentials(username, password)));
-
-        clusterBuilder.withQueryOptions(queryOptions());
-
-        SocketOptions socketOptions = new SocketOptions();
-        readTimeoutMillis.ifPresent(socketOptions::setReadTimeoutMillis);
-        connectTimeoutMillis.ifPresent(socketOptions::setConnectTimeoutMillis);
-        clusterBuilder.withSocketOptions(socketOptions);
-        poolingOptions.ifPresent(clusterBuilder::withPoolingOptions);
-
-        useSsl.filter(b -> b).ifPresent(any -> clusterBuilder.withSSL());
-
-        Cluster cluster = clusterBuilder.build();
-        try {
-            queryLogger.map(queryLoggerConfiguration ->
-                cluster.register(queryLoggerConfiguration.getQueryLogger()));
-            return cluster;
-        } catch (Exception e) {
-            cluster.close();
-            throw e;
-        }
-    }
-
-    private QueryOptions queryOptions() {
-        return new QueryOptions()
-                .setConsistencyLevel(ConsistencyLevel.QUORUM);
-    }
-
-    private Collection<Host> getServers() {
-        return servers.orElse(ImmutableList.of(
-            Host.from(DEFAULT_CLUSTER_IP, DEFAULT_CASSANDRA_PORT)));
-    }
-}
diff --git a/backends-common/cassandra/src/main/java/org/apache/james/backends/cassandra/init/ClusterFactory.java b/backends-common/cassandra/src/main/java/org/apache/james/backends/cassandra/init/ClusterFactory.java
new file mode 100644
index 0000000..eafd622
--- /dev/null
+++ b/backends-common/cassandra/src/main/java/org/apache/james/backends/cassandra/init/ClusterFactory.java
@@ -0,0 +1,87 @@
+/****************************************************************
+ * 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.backends.cassandra.init;
+
+import org.apache.james.backends.cassandra.init.configuration.ClusterConfiguration;
+
+import com.datastax.driver.core.Cluster;
+import com.datastax.driver.core.ConsistencyLevel;
+import com.datastax.driver.core.QueryOptions;
+import com.datastax.driver.core.Session;
+import com.datastax.driver.core.SocketOptions;
+import com.google.common.base.Preconditions;
+
+public class ClusterFactory {
+    public static Cluster create(ClusterConfiguration configuration) {
+        Preconditions.checkState(configuration.getUsername().isPresent() == configuration.getPassword().isPresent(), "If you specify username, you must specify password");
+
+        Cluster.Builder clusterBuilder = Cluster.builder()
+            .withoutJMXReporting();
+        configuration.getHosts().forEach(server -> clusterBuilder
+            .addContactPoint(server.getHostName())
+            .withPort(server.getPort()));
+
+        configuration.getUsername().ifPresent(username ->
+            configuration.getPassword().ifPresent(password ->
+                clusterBuilder.withCredentials(username, password)));
+
+        clusterBuilder.withQueryOptions(queryOptions());
+
+        SocketOptions socketOptions = new SocketOptions();
+        socketOptions.setReadTimeoutMillis(configuration.getReadTimeoutMillis());
+        socketOptions.setConnectTimeoutMillis(configuration.getConnectTimeoutMillis());
+        clusterBuilder.withSocketOptions(socketOptions);
+        configuration.getPoolingOptions().ifPresent(clusterBuilder::withPoolingOptions);
+
+        if (configuration.useSsl()) {
+            clusterBuilder.withSSL();
+        }
+
+        Cluster cluster = clusterBuilder.build();
+        try {
+            configuration.getQueryLoggerConfiguration().map(queryLoggerConfiguration ->
+                cluster.register(queryLoggerConfiguration.getQueryLogger()));
+            return cluster;
+        } catch (Exception e) {
+            cluster.close();
+            throw e;
+        }
+    }
+
+    public static Cluster createWithKeyspace(ClusterConfiguration clusterConfiguration) {
+        Cluster cluster = create(clusterConfiguration);
+        createKeyspace(clusterConfiguration, cluster);
+        return cluster;
+    }
+
+    public static void createKeyspace(ClusterConfiguration clusterConfiguration, Cluster cluster) {
+        try (Session session = cluster.connect()) {
+            session.execute("CREATE KEYSPACE IF NOT EXISTS " + clusterConfiguration.getKeyspace()
+                + " WITH replication = {'class':'SimpleStrategy', 'replication_factor':" + clusterConfiguration.getReplicationFactor() + "}"
+                + " AND durable_writes = " + clusterConfiguration.isDurableWrites()
+                + ";");
+        }
+    }
+
+    private static QueryOptions queryOptions() {
+        return new QueryOptions()
+                .setConsistencyLevel(ConsistencyLevel.QUORUM);
+    }
+}
diff --git a/backends-common/cassandra/src/main/java/org/apache/james/backends/cassandra/init/ClusterWithKeyspaceCreatedFactory.java b/backends-common/cassandra/src/main/java/org/apache/james/backends/cassandra/init/ClusterWithKeyspaceCreatedFactory.java
deleted file mode 100644
index a93ca15..0000000
--- a/backends-common/cassandra/src/main/java/org/apache/james/backends/cassandra/init/ClusterWithKeyspaceCreatedFactory.java
+++ /dev/null
@@ -1,36 +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.backends.cassandra.init;
-
-import org.apache.james.backends.cassandra.init.configuration.ClusterConfiguration;
-
-import com.datastax.driver.core.Cluster;
-import com.datastax.driver.core.Session;
-
-public class ClusterWithKeyspaceCreatedFactory {
-    public static void createKeyspace(Cluster cluster, ClusterConfiguration clusterConfiguration) {
-        try (Session session = cluster.connect()) {
-            session.execute("CREATE KEYSPACE IF NOT EXISTS " + clusterConfiguration.getKeyspace()
-                + " WITH replication = {'class':'SimpleStrategy', 'replication_factor':" + clusterConfiguration.getReplicationFactor() + "}"
-                + " AND durable_writes = " + clusterConfiguration.isDurableWrites()
-                + ";");
-        }
-    }
-}
diff --git a/backends-common/cassandra/src/main/java/org/apache/james/backends/cassandra/init/ResilientClusterProvider.java b/backends-common/cassandra/src/main/java/org/apache/james/backends/cassandra/init/ResilientClusterProvider.java
index 523a925..743b887 100644
--- a/backends-common/cassandra/src/main/java/org/apache/james/backends/cassandra/init/ResilientClusterProvider.java
+++ b/backends-common/cassandra/src/main/java/org/apache/james/backends/cassandra/init/ResilientClusterProvider.java
@@ -60,18 +60,9 @@ public class ResilientClusterProvider implements Provider<Cluster> {
             ImmutableList.copyOf(configuration.getHosts()).toString());
 
         return () -> {
-            Cluster cluster = ClusterBuilder.builder()
-                    .servers(configuration.getHosts())
-                    .username(configuration.getUsername())
-                    .password(configuration.getPassword())
-                    .useSsl(configuration.isUseSsl())
-                    .poolingOptions(configuration.getPoolingOptions())
-                    .queryLoggerConfiguration(configuration.getQueryLoggerConfiguration())
-                    .readTimeoutMillis(configuration.getReadTimeoutMillis())
-                    .connectTimeoutMillis(configuration.getConnectTimeoutMillis())
-                    .build();
+            Cluster cluster = ClusterFactory.create(configuration);
             try {
-                ClusterWithKeyspaceCreatedFactory.createKeyspace(cluster, configuration);
+                ClusterFactory.createKeyspace(configuration, cluster);
                 return cluster;
             } catch (Exception e) {
                 cluster.close();
diff --git a/backends-common/cassandra/src/main/java/org/apache/james/backends/cassandra/init/configuration/ClusterConfiguration.java b/backends-common/cassandra/src/main/java/org/apache/james/backends/cassandra/init/configuration/ClusterConfiguration.java
index 68958f4..82c4afb 100644
--- a/backends-common/cassandra/src/main/java/org/apache/james/backends/cassandra/init/configuration/ClusterConfiguration.java
+++ b/backends-common/cassandra/src/main/java/org/apache/james/backends/cassandra/init/configuration/ClusterConfiguration.java
@@ -26,7 +26,6 @@ import java.util.Objects;
 import java.util.Optional;
 
 import org.apache.commons.configuration2.Configuration;
-import org.apache.james.backends.cassandra.init.ClusterBuilder;
 import org.apache.james.util.Host;
 
 import com.datastax.driver.core.HostDistance;
@@ -190,7 +189,7 @@ public class ClusterConfiguration {
                 replicationFactor.orElse(DEFAULT_REPLICATION_FACTOR),
                 minDelay.orElse(DEFAULT_CONNECTION_MIN_DELAY),
                 maxRetry.orElse(DEFAULT_CONNECTION_MAX_RETRIES),
-                queryLoggerConfiguration.orElse(QueryLoggerConfiguration.DEFAULT),
+                queryLoggerConfiguration,
                 poolingOptions,
                 readTimeoutMillis.orElse(DEFAULT_READ_TIMEOUT_MILLIS),
                 connectTimeoutMillis.orElse(DEFAULT_CONNECT_TIMEOUT_MILLIS),
@@ -218,6 +217,8 @@ public class ClusterConfiguration {
     private static final int DEFAULT_CONNECTION_MIN_DELAY = 5000;
     private static final int DEFAULT_READ_TIMEOUT_MILLIS = 5000;
     private static final int DEFAULT_CONNECT_TIMEOUT_MILLIS = 5000;
+    public static final int DEFAULT_CASSANDRA_PORT = 9042;
+
     private static final boolean DEFAULT_SSL = false;
 
     public static Builder builder() {
@@ -245,7 +246,7 @@ public class ClusterConfiguration {
         String[] ipAndPorts = configuration.getStringArray(CASSANDRA_NODES);
 
         return Arrays.stream(ipAndPorts)
-            .map(string -> Host.parseConfString(string, ClusterBuilder.DEFAULT_CASSANDRA_PORT))
+            .map(string -> Host.parseConfString(string, DEFAULT_CASSANDRA_PORT))
             .collect(Guavate.toImmutableList());
     }
 
@@ -285,7 +286,7 @@ public class ClusterConfiguration {
     private final int replicationFactor;
     private final int minDelay;
     private final int maxRetry;
-    private final QueryLoggerConfiguration queryLoggerConfiguration;
+    private final Optional<QueryLoggerConfiguration> queryLoggerConfiguration;
     private final Optional<PoolingOptions> poolingOptions;
     private final int readTimeoutMillis;
     private final int connectTimeoutMillis;
@@ -295,7 +296,7 @@ public class ClusterConfiguration {
     private final boolean durableWrites;
 
     public ClusterConfiguration(List<Host> hosts, String keyspace, int replicationFactor, int minDelay, int maxRetry,
-                                QueryLoggerConfiguration queryLoggerConfiguration, Optional<PoolingOptions> poolingOptions,
+                                Optional<QueryLoggerConfiguration> queryLoggerConfiguration, Optional<PoolingOptions> poolingOptions,
                                 int readTimeoutMillis, int connectTimeoutMillis, boolean useSsl, Optional<String> username,
                                 Optional<String> password, boolean durableWrites) {
         this.hosts = hosts;
@@ -337,7 +338,7 @@ public class ClusterConfiguration {
         return maxRetry;
     }
 
-    public QueryLoggerConfiguration getQueryLoggerConfiguration() {
+    public Optional<QueryLoggerConfiguration> getQueryLoggerConfiguration() {
         return queryLoggerConfiguration;
     }
 
@@ -353,7 +354,7 @@ public class ClusterConfiguration {
         return connectTimeoutMillis;
     }
 
-    public boolean isUseSsl() {
+    public boolean useSsl() {
         return useSsl;
     }
 
diff --git a/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/CassandraCluster.java b/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/CassandraCluster.java
index 9a6d412..50c6099 100644
--- a/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/CassandraCluster.java
+++ b/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/CassandraCluster.java
@@ -23,8 +23,7 @@ import java.util.Optional;
 import org.apache.james.backends.cassandra.components.CassandraModule;
 import org.apache.james.backends.cassandra.init.CassandraTableManager;
 import org.apache.james.backends.cassandra.init.CassandraTypesProvider;
-import org.apache.james.backends.cassandra.init.ClusterBuilder;
-import org.apache.james.backends.cassandra.init.ClusterWithKeyspaceCreatedFactory;
+import org.apache.james.backends.cassandra.init.ClusterFactory;
 import org.apache.james.backends.cassandra.init.SessionWithInitializedTablesFactory;
 import org.apache.james.backends.cassandra.init.configuration.ClusterConfiguration;
 import org.apache.james.util.Host;
@@ -57,16 +56,12 @@ public final class CassandraCluster implements AutoCloseable {
     private CassandraCluster(CassandraModule module, Host host) throws RuntimeException {
         this.module = module;
         try {
-            cluster = ClusterBuilder.builder()
-                .servers(host)
-                .build();
             ClusterConfiguration clusterConfiguration = ClusterConfiguration.builder()
                 .host(host)
                 .keyspace(KEYSPACE)
-                .replicationFactor(1)
                 .disableDurableWrites()
                 .build();
-            ClusterWithKeyspaceCreatedFactory.createKeyspace(cluster, clusterConfiguration);
+            cluster = ClusterFactory.createWithKeyspace(clusterConfiguration);
             session = new SessionWithInitializedTablesFactory(clusterConfiguration, cluster, module).get();
             typesProvider = new CassandraTypesProvider(module, session);
         } catch (Exception exception) {
diff --git a/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/DockerCassandra.java b/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/DockerCassandra.java
index 58a9a08..99dce87 100644
--- a/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/DockerCassandra.java
+++ b/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/DockerCassandra.java
@@ -19,8 +19,6 @@
 
 package org.apache.james.backends.cassandra;
 
-import java.util.function.Function;
-
 import org.apache.james.util.Host;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -29,7 +27,6 @@ import org.testcontainers.containers.GenericContainer;
 import org.testcontainers.containers.output.OutputFrame;
 import org.testcontainers.images.builder.ImageFromDockerfile;
 import org.testcontainers.images.builder.dockerfile.DockerfileBuilder;
-import org.testcontainers.images.builder.dockerfile.traits.RunStatementTrait;
 
 import com.github.dockerjava.api.DockerClient;
 import com.google.common.collect.ImmutableMap;
@@ -38,6 +35,13 @@ public class DockerCassandra {
 
     private static final Logger logger = LoggerFactory.getLogger(DockerCassandra.class);
 
+    @FunctionalInterface
+    interface AdditionalDockerFileStep {
+        AdditionalDockerFileStep IDENTITY = builder -> builder;
+
+        DockerfileBuilder applyStep(DockerfileBuilder builder);
+    }
+
     private static final int CASSANDRA_PORT = 9042;
     private static final int CASSANDRA_MEMORY = 650;
 
@@ -49,16 +53,16 @@ public class DockerCassandra {
 
     @SuppressWarnings("resource")
     public DockerCassandra() {
-        this("cassandra_3_11_3", Function.identity());
+        this("cassandra_3_11_3", AdditionalDockerFileStep.IDENTITY);
     }
 
-    public DockerCassandra(String imageName, Function<DockerfileBuilder, DockerfileBuilder> additionalSteps) {
+    public DockerCassandra(String imageName, AdditionalDockerFileStep additionalSteps) {
         client = DockerClientFactory.instance().client();
         boolean doNotDeleteImageAfterUsage = false;
         cassandraContainer = new GenericContainer<>(
             new ImageFromDockerfile(imageName,doNotDeleteImageAfterUsage)
                 .withDockerfileFromBuilder(builder ->
-                    additionalSteps.apply(builder
+                    additionalSteps.applyStep(builder
                         .from("cassandra:3.11.3")
                         .env("ENV CASSANDRA_CONFIG", "/etc/cassandra")
                         .run("echo \"-Xms" + CASSANDRA_MEMORY + "M\" >> " + JVM_OPTIONS)
diff --git a/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/init/ClusterBuilderTest.java b/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/init/ClusterFactoryTest.java
similarity index 85%
rename from backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/init/ClusterBuilderTest.java
rename to backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/init/ClusterFactoryTest.java
index 4ad3db7..ce45523 100644
--- a/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/init/ClusterBuilderTest.java
+++ b/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/init/ClusterFactoryTest.java
@@ -20,19 +20,20 @@ package org.apache.james.backends.cassandra.init;
 
 import static org.assertj.core.api.Assertions.assertThat;
 
+import org.apache.james.backends.cassandra.init.configuration.ClusterConfiguration;
 import org.apache.james.util.Host;
 import org.junit.jupiter.api.Test;
 
 import com.datastax.driver.core.Cluster;
 import com.datastax.driver.core.ConsistencyLevel;
 
-class ClusterBuilderTest {
+class ClusterFactoryTest {
 
     @Test
     void consistencyLevelShouldBeEqualToQuorum() {
-        Cluster cluster = ClusterBuilder.builder()
-            .servers(Host.from("localhost", ClusterBuilder.DEFAULT_CASSANDRA_PORT))
-            .build();
+        Cluster cluster = ClusterFactory.create(ClusterConfiguration.builder()
+                .host(Host.from("localhost", ClusterConfiguration.DEFAULT_CASSANDRA_PORT))
+                .build());
 
         ConsistencyLevel consistencyLevel = cluster.getConfiguration()
                 .getQueryOptions()
diff --git a/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/init/SessionWithInitializedTablesFactoryTest.java b/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/init/SessionWithInitializedTablesFactoryTest.java
index ea6fd49..f3e6dd9 100644
--- a/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/init/SessionWithInitializedTablesFactoryTest.java
+++ b/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/init/SessionWithInitializedTablesFactoryTest.java
@@ -121,17 +121,13 @@ class SessionWithInitializedTablesFactoryTest {
     }
 
     private static Supplier<Session> createSession(DockerCassandraExtension.DockerCassandra cassandraServer) {
-        Host host = cassandraServer.getHost();
-        Cluster cluster = ClusterBuilder.builder()
-            .servers(host)
-            .build();
         ClusterConfiguration clusterConfiguration = ClusterConfiguration.builder()
-            .host(host)
+            .host(cassandraServer.getHost())
             .keyspace(KEYSPACE)
             .replicationFactor(1)
             .disableDurableWrites()
             .build();
-        ClusterWithKeyspaceCreatedFactory.createKeyspace(cluster, clusterConfiguration);
+        Cluster cluster = ClusterFactory.createWithKeyspace(clusterConfiguration);
         return () -> new SessionWithInitializedTablesFactory(
                 clusterConfiguration,
                 cluster,
diff --git a/src/site/xdoc/server/config-cassandra.xml b/src/site/xdoc/server/config-cassandra.xml
index 3511c87..ad9a400 100644
--- a/src/site/xdoc/server/config-cassandra.xml
+++ b/src/site/xdoc/server/config-cassandra.xml
@@ -47,8 +47,8 @@
           required if <strong>cassandra.user</strong> is supplied</dd>
 
         <dt><strong>cassandra.ssl</strong></dt>
-        <dd>Wether SSL should be enabled on the communications with Cassandra cluster. Optional, defaults to false.<br/>
-        The keystore used for trusting SLL server socket can be set via JSSE system properties as explained on
+        <dd>Whether SSL should be enabled on the communications with Cassandra cluster. Optional, defaults to false.<br/>
+        The keystore used for trusting SSL server socket can be set via JSSE system properties as explained on
         <a href="https://docs.datastax.com/en/developer/java-driver/3.7/manual/ssl/">Cassandra driver manual</a>.</dd>
 
         <dt><strong>cassandra.replication.factor</strong></dt>


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[james-project] 30/36: [REFACTORING] Clean protocols-managesieve javadoc

Posted by bt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit 4a28ba57d3886f4cb991cf024f6398f34d1ea4f5
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Thu Nov 7 12:02:53 2019 +0700

    [REFACTORING] Clean protocols-managesieve javadoc
    
     - Solve IntellijJ warnings related to javaDoc
     - Remove verbose, meaningless entries
---
 .../org/apache/james/managesieve/api/AuthenticationProcessor.java | 4 +---
 .../org/apache/james/managesieve/api/ManageSieveException.java    | 8 --------
 2 files changed, 1 insertion(+), 11 deletions(-)

diff --git a/protocols/managesieve/src/main/java/org/apache/james/managesieve/api/AuthenticationProcessor.java b/protocols/managesieve/src/main/java/org/apache/james/managesieve/api/AuthenticationProcessor.java
index f9a8638..89994d8 100644
--- a/protocols/managesieve/src/main/java/org/apache/james/managesieve/api/AuthenticationProcessor.java
+++ b/protocols/managesieve/src/main/java/org/apache/james/managesieve/api/AuthenticationProcessor.java
@@ -25,9 +25,7 @@ public interface AuthenticationProcessor {
     String initialServerResponse(Session session);
 
     /**
-     * @return Null if authentication failed, the authenticated username if authentication is successfull
-     * @throws SyntaxException
-     * @throws AuthenticationException
+     * @return Null if authentication failed, the authenticated username if authentication is successful
      */
     String isAuthenticationSuccesfull(Session session, String suppliedClientData) throws SyntaxException, AuthenticationException;
 
diff --git a/protocols/managesieve/src/main/java/org/apache/james/managesieve/api/ManageSieveException.java b/protocols/managesieve/src/main/java/org/apache/james/managesieve/api/ManageSieveException.java
index 296b1a4..a34e5c6 100644
--- a/protocols/managesieve/src/main/java/org/apache/james/managesieve/api/ManageSieveException.java
+++ b/protocols/managesieve/src/main/java/org/apache/james/managesieve/api/ManageSieveException.java
@@ -23,7 +23,6 @@ package org.apache.james.managesieve.api;
 public class ManageSieveException extends Exception {
     /**
      * Creates a new instance of ManageSieveException.
-     *
      */
     public ManageSieveException() {
         super();
@@ -31,9 +30,6 @@ public class ManageSieveException extends Exception {
 
     /**
      * Creates a new instance of ManageSieveException.
-     *
-     * @param message
-     * @param cause
      */
     public ManageSieveException(String message, Throwable cause) {
         super(message, cause);
@@ -41,8 +37,6 @@ public class ManageSieveException extends Exception {
 
     /**
      * Creates a new instance of ManageSieveException.
-     *
-     * @param message
      */
     public ManageSieveException(String message) {
         super(message);
@@ -50,8 +44,6 @@ public class ManageSieveException extends Exception {
 
     /**
      * Creates a new instance of ManageSieveException.
-     *
-     * @param cause
      */
     public ManageSieveException(Throwable cause) {
         super(cause);


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[james-project] 08/36: JAMES-2904 Move ResilientClusterProvider to backend

Posted by bt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit ca3d8b7c763765bd987ce344310562c9d5da54dd
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Wed Oct 2 11:06:28 2019 +0700

    JAMES-2904 Move ResilientClusterProvider to backend
---
 .../james/backends/cassandra/init}/ResilientClusterProvider.java      | 4 +---
 .../java/org/apache/james/modules/mailbox/CassandraSessionModule.java | 1 +
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/server/container/guice/cassandra-guice/src/main/java/org/apache/james/modules/mailbox/ResilientClusterProvider.java b/backends-common/cassandra/src/main/java/org/apache/james/backends/cassandra/init/ResilientClusterProvider.java
similarity index 95%
rename from server/container/guice/cassandra-guice/src/main/java/org/apache/james/modules/mailbox/ResilientClusterProvider.java
rename to backends-common/cassandra/src/main/java/org/apache/james/backends/cassandra/init/ResilientClusterProvider.java
index 979aa57..150152b 100644
--- a/server/container/guice/cassandra-guice/src/main/java/org/apache/james/modules/mailbox/ResilientClusterProvider.java
+++ b/backends-common/cassandra/src/main/java/org/apache/james/backends/cassandra/init/ResilientClusterProvider.java
@@ -17,7 +17,7 @@
  * under the License.                                           *
  ****************************************************************/
 
-package org.apache.james.modules.mailbox;
+package org.apache.james.backends.cassandra.init;
 
 import java.time.Duration;
 import java.time.LocalDateTime;
@@ -28,8 +28,6 @@ import javax.inject.Inject;
 import javax.inject.Provider;
 import javax.inject.Singleton;
 
-import org.apache.james.backends.cassandra.init.ClusterBuilder;
-import org.apache.james.backends.cassandra.init.ClusterWithKeyspaceCreatedFactory;
 import org.apache.james.backends.cassandra.init.configuration.ClusterConfiguration;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
diff --git a/server/container/guice/cassandra-guice/src/main/java/org/apache/james/modules/mailbox/CassandraSessionModule.java b/server/container/guice/cassandra-guice/src/main/java/org/apache/james/modules/mailbox/CassandraSessionModule.java
index 11ce6ad..7f097b3 100644
--- a/server/container/guice/cassandra-guice/src/main/java/org/apache/james/modules/mailbox/CassandraSessionModule.java
+++ b/server/container/guice/cassandra-guice/src/main/java/org/apache/james/modules/mailbox/CassandraSessionModule.java
@@ -25,6 +25,7 @@ import org.apache.commons.configuration2.Configuration;
 import org.apache.commons.configuration2.ex.ConfigurationException;
 import org.apache.james.backends.cassandra.components.CassandraModule;
 import org.apache.james.backends.cassandra.init.CassandraZonedDateTimeModule;
+import org.apache.james.backends.cassandra.init.ResilientClusterProvider;
 import org.apache.james.backends.cassandra.init.SessionWithInitializedTablesFactory;
 import org.apache.james.backends.cassandra.init.configuration.CassandraConfiguration;
 import org.apache.james.backends.cassandra.init.configuration.ClusterConfiguration;


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org