This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/master by this push: new 83e9c07 CAMEL-14565: Add docs for missing option 83e9c07 is described below commit 83e9c07804cdd920de81491948b42b71d0237540 Author: Claus Ibsen <claus.ib...@gmail.com> AuthorDate: Fri Feb 14 16:18:11 2020 +0100 CAMEL-14565: Add docs for missing option --- .../netty/http/NettyHttpSecurityConfiguration.java | 20 +++++++++----------- .../camel/component/netty/NettyConfiguration.java | 16 ++++------------ .../component/netty/NettyManualEndpointTest.java | 2 +- 3 files changed, 14 insertions(+), 24 deletions(-) diff --git a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpSecurityConfiguration.java b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpSecurityConfiguration.java index bec640e..9b4fe53 100644 --- a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpSecurityConfiguration.java +++ b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpSecurityConfiguration.java @@ -17,19 +17,26 @@ package org.apache.camel.component.netty.http; import org.apache.camel.LoggingLevel; +import org.apache.camel.spi.Metadata; /** * Security configuration for the {@link NettyHttpConsumer}. */ public class NettyHttpSecurityConfiguration { + @Metadata(label = "security", defaultValue = "true", description = "Whether to enable authentication") private boolean authenticate = true; + @Metadata(label = "security", defaultValue = "Basic", description = "Security constraint. Currently only Basic is supported.") private String constraint = "Basic"; + @Metadata(label = "security", description = "Name of security realm") private String realm; + @Metadata(label = "security", description = "Sets a SecurityConstraint to use for checking if a web resource is restricted or not." + + " By default this is null, which means all resources is restricted.") private SecurityConstraint securityConstraint; + @Metadata(label = "security", description = " Sets the SecurityAuthenticator to use for authenticating the HttpPrincipal.") private SecurityAuthenticator securityAuthenticator; + @Metadata(label = "security", defaultValue = "DEBUG", description = "Sets a logging level to use for logging denied login attempts (incl stacktraces)") private LoggingLevel loginDeniedLoggingLevel = LoggingLevel.DEBUG; - private String roleClassName; public boolean isAuthenticate() { return authenticate; @@ -37,8 +44,6 @@ public class NettyHttpSecurityConfiguration { /** * Whether to enable authentication - * <p/> - * This is by default enabled. */ public void setAuthenticate(boolean authenticate) { this.authenticate = authenticate; @@ -105,11 +110,4 @@ public class NettyHttpSecurityConfiguration { this.loginDeniedLoggingLevel = loginDeniedLoggingLevel; } - public String getRoleClassName() { - return roleClassName; - } - - public void setRoleClassName(String roleClassName) { - this.roleClassName = roleClassName; - } -} +} \ No newline at end of file diff --git a/components/camel-netty/src/main/java/org/apache/camel/component/netty/NettyConfiguration.java b/components/camel-netty/src/main/java/org/apache/camel/component/netty/NettyConfiguration.java index 37a9ba1..69f9222 100644 --- a/components/camel-netty/src/main/java/org/apache/camel/component/netty/NettyConfiguration.java +++ b/components/camel-netty/src/main/java/org/apache/camel/component/netty/NettyConfiguration.java @@ -375,27 +375,19 @@ public class NettyConfiguration extends NettyServerBootstrapConfiguration implem this.encoders = encoders; } - public ChannelHandler getEncoder() { - return encoders.isEmpty() ? null : encoders.get(0); - } - /** - * A custom ChannelHandler class that can be used to perform special marshalling of outbound payloads. + * Adds a custom ChannelHandler class that can be used to perform special marshalling of outbound payloads. */ - public void setEncoder(ChannelHandler encoder) { + public void addEncoder(ChannelHandler encoder) { if (!encoders.contains(encoder)) { encoders.add(encoder); } } - public ChannelHandler getDecoder() { - return decoders.isEmpty() ? null : decoders.get(0); - } - /** - * A custom ChannelHandler class that can be used to perform special marshalling of inbound payloads. + * Adds a custom ChannelHandler class that can be used to perform special marshalling of inbound payloads. */ - public void setDecoder(ChannelHandler decoder) { + public void addDecoder(ChannelHandler decoder) { if (!decoders.contains(decoder)) { decoders.add(decoder); } diff --git a/components/camel-netty/src/test/java/org/apache/camel/component/netty/NettyManualEndpointTest.java b/components/camel-netty/src/test/java/org/apache/camel/component/netty/NettyManualEndpointTest.java index d8c4757..81cc0e8 100644 --- a/components/camel-netty/src/test/java/org/apache/camel/component/netty/NettyManualEndpointTest.java +++ b/components/camel-netty/src/test/java/org/apache/camel/component/netty/NettyManualEndpointTest.java @@ -54,7 +54,7 @@ public class NettyManualEndpointTest extends BaseNettyTest { nettyConfig.setSync(false); // need to add encoders and decoders manually - nettyConfig.setEncoder(ChannelHandlerFactories.newStringEncoder(CharsetUtil.UTF_8, "tcp")); + nettyConfig.addEncoder(ChannelHandlerFactories.newStringEncoder(CharsetUtil.UTF_8, "tcp")); List<ChannelHandler> decoders = new ArrayList<>(); decoders.add(ChannelHandlerFactories.newDelimiterBasedFrameDecoder(1000, Delimiters.lineDelimiter(), "tcp")); decoders.add(ChannelHandlerFactories.newStringDecoder(CharsetUtil.UTF_8, "tcp"));