Author: norman Date: Mon Nov 21 09:48:23 2011 New Revision: 1204420 URL: http://svn.apache.org/viewvc?rev=1204420&view=rev Log: Rename Secure to Encryption and add javadocs. See PROTOCOLS-51
Added: james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/Encryption.java (contents, props changed) - copied, changed from r1204245, james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/Secure.java Removed: james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/Secure.java Modified: james/protocols/trunk/impl/src/main/java/org/apache/james/protocols/impl/BasicChannelUpstreamHandler.java james/protocols/trunk/impl/src/main/java/org/apache/james/protocols/impl/NettyServer.java Copied: james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/Encryption.java (from r1204245, james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/Secure.java) URL: http://svn.apache.org/viewvc/james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/Encryption.java?p2=james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/Encryption.java&p1=james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/Secure.java&r1=1204245&r2=1204420&rev=1204420&view=diff ============================================================================== --- james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/Secure.java (original) +++ james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/Encryption.java Mon Nov 21 09:48:23 2011 @@ -25,44 +25,80 @@ import javax.net.ssl.SSLContext; * This class should be used to setup encrypted protocol handling * */ -public final class Secure { +public final class Encryption { private final SSLContext context; private final boolean starttls; private final String[] enabledCipherSuites; - private Secure(SSLContext context, boolean starttls, String[] enabledCipherSuites) { + private Encryption(SSLContext context, boolean starttls, String[] enabledCipherSuites) { this.context = context; this.starttls = starttls; this.enabledCipherSuites = enabledCipherSuites; } + - public static Secure createTls(SSLContext context) { + /** + * + * @see #createStartTls(SSLContext, String[]) + */ + public static Encryption createTls(SSLContext context) { return createTls(context, null); } - public static Secure createTls(SSLContext context, String[] enabledCipherSuites) { - return new Secure(context, false, enabledCipherSuites); + /** + * 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); } - - public static Secure createStartTls(SSLContext context) { + + /** + * + * @see #createStartTls(SSLContext, String[]) + */ + public static Encryption createStartTls(SSLContext context) { return createStartTls(context, null); } - public static Secure createStartTls(SSLContext context, String[] enabledCipherSuites) { - return new Secure(context, true, null); - } - - - + /** + * 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, null); + } + + /** + * Return the {@link SSLContext} to use + * + * @return context + */ public SSLContext getContext() { return context; } + /** + * Return <code>true</code> if this {@link Encryption} should be used for STARTTLS + * + * @return starttls + */ public boolean isStartTLS() { return starttls; } + /** + * Return the Ciphersuites that are allowed for the {@link Encryption} or <code>null</code> if all should be allowed + * + * @return ciphersuites + */ public String[] getEnabledCipherSuites() { return enabledCipherSuites; } Propchange: james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/Encryption.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Modified: james/protocols/trunk/impl/src/main/java/org/apache/james/protocols/impl/BasicChannelUpstreamHandler.java URL: http://svn.apache.org/viewvc/james/protocols/trunk/impl/src/main/java/org/apache/james/protocols/impl/BasicChannelUpstreamHandler.java?rev=1204420&r1=1204419&r2=1204420&view=diff ============================================================================== --- james/protocols/trunk/impl/src/main/java/org/apache/james/protocols/impl/BasicChannelUpstreamHandler.java (original) +++ james/protocols/trunk/impl/src/main/java/org/apache/james/protocols/impl/BasicChannelUpstreamHandler.java Mon Nov 21 09:48:23 2011 @@ -29,7 +29,7 @@ import org.apache.james.protocols.api.Pr import org.apache.james.protocols.api.ProtocolSession; import org.apache.james.protocols.api.ProtocolTransport; import org.apache.james.protocols.api.Response; -import org.apache.james.protocols.api.Secure; +import org.apache.james.protocols.api.Encryption; import org.apache.james.protocols.api.handler.ConnectHandler; import org.apache.james.protocols.api.handler.DisconnectHandler; import org.apache.james.protocols.api.handler.LineHandler; @@ -56,13 +56,13 @@ public class BasicChannelUpstreamHandler protected final Logger logger; protected final Protocol protocol; protected final ProtocolHandlerChain chain; - protected final Secure secure; + protected final Encryption secure; public BasicChannelUpstreamHandler(Protocol protocol, Logger logger) { this(protocol, logger, null); } - public BasicChannelUpstreamHandler(Protocol protocol, Logger logger, Secure secure) { + public BasicChannelUpstreamHandler(Protocol protocol, Logger logger, Encryption secure) { this.protocol = protocol; this.chain = protocol.getProtocolChain(); this.logger = logger; Modified: james/protocols/trunk/impl/src/main/java/org/apache/james/protocols/impl/NettyServer.java URL: http://svn.apache.org/viewvc/james/protocols/trunk/impl/src/main/java/org/apache/james/protocols/impl/NettyServer.java?rev=1204420&r1=1204419&r2=1204420&view=diff ============================================================================== --- james/protocols/trunk/impl/src/main/java/org/apache/james/protocols/impl/NettyServer.java (original) +++ james/protocols/trunk/impl/src/main/java/org/apache/james/protocols/impl/NettyServer.java Mon Nov 21 09:48:23 2011 @@ -22,7 +22,7 @@ package org.apache.james.protocols.impl; import javax.net.ssl.SSLContext; import org.apache.james.protocols.api.Protocol; -import org.apache.james.protocols.api.Secure; +import org.apache.james.protocols.api.Encryption; import org.jboss.netty.channel.ChannelPipelineFactory; import org.jboss.netty.channel.ChannelUpstreamHandler; import org.jboss.netty.channel.group.ChannelGroup; @@ -44,14 +44,14 @@ public class NettyServer extends Abstrac private ChannelUpstreamHandler coreHandler; - protected final Secure secure; + protected final Encryption secure; public NettyServer(Protocol protocol) { this(protocol, null); } - public NettyServer(Protocol protocol, Secure secure) { + public NettyServer(Protocol protocol, Encryption secure) { super(); this.protocol = protocol; this.secure = secure; --------------------------------------------------------------------- To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org