You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mina.apache.org by el...@apache.org on 2022/04/10 22:50:19 UTC
[mina] branch 2.2.X updated: Added some missing javadoc
This is an automated email from the ASF dual-hosted git repository.
elecharny pushed a commit to branch 2.2.X
in repository https://gitbox.apache.org/repos/asf/mina.git
The following commit(s) were added to refs/heads/2.2.X by this push:
new 8ec921afd Added some missing javadoc
8ec921afd is described below
commit 8ec921afd72291384a501176c757cd5408cbc60e
Author: emmanuel lecharny <el...@apache.org>
AuthorDate: Mon Apr 11 00:50:13 2022 +0200
Added some missing javadoc
---
.../java/org/apache/mina/core/buffer/IoBuffer.java | 2 +
.../mina/core/write/WriteRejectedException.java | 1 +
.../org/apache/mina/filter/ssl/SSLHandlerG0.java | 2 +-
.../java/org/apache/mina/filter/ssl/SslEvent.java | 2 +-
.../java/org/apache/mina/filter/ssl/SslFilter.java | 2 +-
.../org/apache/mina/filter/ssl/SslHandler.java | 48 +++++++++++-----------
6 files changed, 30 insertions(+), 27 deletions(-)
diff --git a/mina-core/src/main/java/org/apache/mina/core/buffer/IoBuffer.java b/mina-core/src/main/java/org/apache/mina/core/buffer/IoBuffer.java
index db5e47726..d9a91d7b5 100644
--- a/mina-core/src/main/java/org/apache/mina/core/buffer/IoBuffer.java
+++ b/mina-core/src/main/java/org/apache/mina/core/buffer/IoBuffer.java
@@ -1520,6 +1520,7 @@ public abstract class IoBuffer implements Comparable<IoBuffer> {
* Returns hexdump of this buffer. The data and pointer are not changed as a
* result of this method call.
*
+ * @param pretty tells if the ourput should be verbose or not
* @return hexidecimal representation of this buffer
*/
public String getHexDump(boolean pretty) {
@@ -1542,6 +1543,7 @@ public abstract class IoBuffer implements Comparable<IoBuffer> {
*
* @param length The maximum number of bytes to dump from the current buffer
* position.
+ * @param pretty tells if the ourput should be verbose or not
* @return hexidecimal representation of this buffer
*/
public String getHexDump(int length, boolean pretty) {
diff --git a/mina-core/src/main/java/org/apache/mina/core/write/WriteRejectedException.java b/mina-core/src/main/java/org/apache/mina/core/write/WriteRejectedException.java
index afb583b0e..b21a25963 100644
--- a/mina-core/src/main/java/org/apache/mina/core/write/WriteRejectedException.java
+++ b/mina-core/src/main/java/org/apache/mina/core/write/WriteRejectedException.java
@@ -61,6 +61,7 @@ public class WriteRejectedException extends WriteException {
* Create a new WriteRejectedException instance
*
* @param requests The {@link WriteRequest} which has been rejected
+ * @param message The error message
*/
public WriteRejectedException(Collection<WriteRequest> requests, String message) {
super(requests, message);
diff --git a/mina-core/src/main/java/org/apache/mina/filter/ssl/SSLHandlerG0.java b/mina-core/src/main/java/org/apache/mina/filter/ssl/SSLHandlerG0.java
index 53d2da9d1..3109426a2 100644
--- a/mina-core/src/main/java/org/apache/mina/filter/ssl/SSLHandlerG0.java
+++ b/mina-core/src/main/java/org/apache/mina/filter/ssl/SSLHandlerG0.java
@@ -42,7 +42,7 @@ import org.apache.mina.core.write.WriteRequest;
* @author Jonathan Valliere
* @author <a href="http://mina.apache.org">Apache MINA Project</a>
*/
-public class SSLHandlerG0 extends SslHandler {
+/* package protected */ class SSLHandlerG0 extends SslHandler {
/**
* Maximum number of queued messages waiting for encoding
diff --git a/mina-core/src/main/java/org/apache/mina/filter/ssl/SslEvent.java b/mina-core/src/main/java/org/apache/mina/filter/ssl/SslEvent.java
index bd75845f5..49e271f17 100644
--- a/mina-core/src/main/java/org/apache/mina/filter/ssl/SslEvent.java
+++ b/mina-core/src/main/java/org/apache/mina/filter/ssl/SslEvent.java
@@ -22,7 +22,7 @@ package org.apache.mina.filter.ssl;
import org.apache.mina.filter.FilterEvent;
/**
- * A SSL event sent by {@link SSLFilter} when the session is secured or not
+ * A SSL event sent by {@link SslFilter} when the session is secured or not
* secured.
*
* @author <a href="http://mina.apache.org">Apache MINA Project</a>
diff --git a/mina-core/src/main/java/org/apache/mina/filter/ssl/SslFilter.java b/mina-core/src/main/java/org/apache/mina/filter/ssl/SslFilter.java
index 1b93f5ef0..7d47382fd 100644
--- a/mina-core/src/main/java/org/apache/mina/filter/ssl/SslFilter.java
+++ b/mina-core/src/main/java/org/apache/mina/filter/ssl/SslFilter.java
@@ -91,7 +91,7 @@ public class SslFilter extends IoFilterAdapter {
* <li><b>TLSv1.1</b> or <b>TLSv1</b></li>
* <li><b>TLSv1.2</b></li>
* <li><b>TLSv1.3</b></li>
- * <li><b>NONE</li>
+ * <li><b>NONE</b></li>
* </ul>
*
* If null, we will use the default <em>SSLEngine</em> configurtation.
diff --git a/mina-core/src/main/java/org/apache/mina/filter/ssl/SslHandler.java b/mina-core/src/main/java/org/apache/mina/filter/ssl/SslHandler.java
index fd2c528e1..04365c5f3 100644
--- a/mina-core/src/main/java/org/apache/mina/filter/ssl/SslHandler.java
+++ b/mina-core/src/main/java/org/apache/mina/filter/ssl/SslHandler.java
@@ -107,12 +107,12 @@ public abstract class SslHandler {
}
/**
- * {@code true} if the encryption session is open
+ * @return {@code true} if the encryption session is open
*/
abstract public boolean isOpen();
/**
- * {@code true} if the encryption session is connected and secure
+ * @return {@code true} if the encryption session is connected and secure
*/
abstract public boolean isConnected();
@@ -120,21 +120,19 @@ public abstract class SslHandler {
* Opens the encryption session, this may include sending the initial handshake
* message
*
- * @param session
- * @param next
+ * @param next The next filter
*
- * @throws SSLException
+ * @throws SSLException The thrown exception
*/
abstract public void open(NextFilter next) throws SSLException;
/**
* Decodes encrypted messages and passes the results to the {@code next} filter.
*
- * @param message
- * @param session
- * @param next
+ * @param next The next filter
+ * @param message the received message
*
- * @throws SSLException
+ * @throws SSLException The thrown exception
*/
abstract public void receive(NextFilter next, final IoBuffer message) throws SSLException;
@@ -146,11 +144,10 @@ public abstract class SslHandler {
* specific number of pending write operations at any moment of time. When one
* {@code WriteRequest} is acknowledged, another can be encoded and written.
*
- * @param request
- * @param session
- * @param next
+ * @param next The next filter
+ * @param request The request to ack
*
- * @throws SSLException
+ * @throws SSLException The thrown exception
*/
abstract public void ack(NextFilter next, final WriteRequest request) throws SSLException;
@@ -161,11 +158,10 @@ public abstract class SslHandler {
* The encryption session may be currently handshaking preventing application
* messages from being written.
*
- * @param request
- * @param session
- * @param next
+ * @param next The next filter
+ * @param request The request to write
*
- * @throws SSLException
+ * @throws SSLException The thrown exception
* @throws WriteRejectedException when the session is closing
*/
abstract public void write(NextFilter next, final WriteRequest request) throws SSLException, WriteRejectedException;
@@ -173,10 +169,10 @@ public abstract class SslHandler {
/**
* Closes the encryption session and writes any required messages
*
- * @param next
+ * @param next The next filter
* @param linger if true, write any queued messages before closing
*
- * @throws SSLException
+ * @throws SSLException The thrown exception
*/
abstract public void close(NextFilter next, final boolean linger) throws SSLException;
@@ -256,23 +252,27 @@ public abstract class SslHandler {
/**
* Allocates the default encoder buffer for the given source size
*
- * @param source
- * @return buffer
+ * @param estimate The estimated remaining size
+ * @return buffer The allocated buffer
*/
protected IoBuffer allocate_encode_buffer(int estimate) {
SSLSession session = this.mEngine.getHandshakeSession();
- if (session == null)
+
+ if (session == null) {
session = this.mEngine.getSession();
+ }
+
int packets = Math.max(MIN_ENCODER_BUFFER_PACKETS,
Math.min(MAX_ENCODER_BUFFER_PACKETS, 1 + (estimate / session.getApplicationBufferSize())));
+
return IoBuffer.allocate(packets * session.getPacketBufferSize());
}
/**
* Allocates the default decoder buffer for the given source size
*
- * @param source
- * @return buffer
+ * @param estimate The estimated remaining size
+ * @return buffer The allocated buffer
*/
protected IoBuffer allocate_app_buffer(int estimate) {
SSLSession session = this.mEngine.getHandshakeSession();