You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by gg...@apache.org on 2022/03/03 13:47:43 UTC

[logging-log4j2] branch release-2.x updated (ee93748 -> 7673943)

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

ggregory pushed a change to branch release-2.x
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git.


    from ee93748  Add changelog entry for LOG4J2-3413
     new 9f75dea  Javadoc.
     new 7673943  Javadoc.

The 2 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:
 .../log4j/core/net/Rfc1349TrafficClass.java        |  32 ++++-
 .../logging/log4j/core/net/SocketOptions.java      | 146 ++++++++++++++++++++-
 2 files changed, 168 insertions(+), 10 deletions(-)

[logging-log4j2] 01/02: Javadoc.

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

ggregory pushed a commit to branch release-2.x
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git

commit 9f75dea390f0295f51898acc14e6e7d1e7b51050
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Thu Mar 3 08:45:36 2022 -0500

    Javadoc.
---
 .../logging/log4j/core/net/SocketOptions.java      | 146 ++++++++++++++++++++-
 1 file changed, 141 insertions(+), 5 deletions(-)

diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/net/SocketOptions.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/net/SocketOptions.java
index 711d044..f8555c7 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/net/SocketOptions.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/net/SocketOptions.java
@@ -32,6 +32,11 @@ import org.apache.logging.log4j.core.util.Builder;
 @Plugin(name = "SocketOptions", category = Core.CATEGORY_NAME, printObject = true)
 public class SocketOptions implements Builder<SocketOptions>, Cloneable {
 
+    /**
+     * Constructs a new builder.
+     *
+     * @return a new builder.
+     */
     @PluginBuilderFactory
     public static SocketOptions newBuilder() {
         return new SocketOptions();
@@ -70,6 +75,12 @@ public class SocketOptions implements Builder<SocketOptions>, Cloneable {
     @PluginBuilderAttribute
     private Integer trafficClass;
 
+    /**
+     * Applies the values in this builder to the given socket.
+     *
+     * @param socket The target Socket.
+     * @throws SocketException if there is an error in the underlying protocol, such as a TCP error.
+     */
     public void apply(final Socket socket) throws SocketException {
         if (keepAlive != null) {
             socket.setKeepAlive(keepAlive.booleanValue());
@@ -110,6 +121,11 @@ public class SocketOptions implements Builder<SocketOptions>, Cloneable {
         }
     }
 
+    /**
+     * See {@link Socket#setTrafficClass(int)}.
+     * 
+     * @return the value to apply to a {@link Socket}.
+     */
     public Integer getActualTrafficClass() {
         if (trafficClass != null && rfc1349TrafficClass != null) {
             throw new IllegalStateException("You MUST not set both customTrafficClass and trafficClass.");
@@ -123,100 +139,221 @@ public class SocketOptions implements Builder<SocketOptions>, Cloneable {
         return null;
     }
 
+    /**
+     * See {@link Socket#setPerformancePreferences(int, int, int)}.
+     * 
+     * @return this.
+     */
     public SocketPerformancePreferences getPerformancePreferences() {
         return performancePreferences;
     }
 
+    /**
+     * See {@link Socket#setReceiveBufferSize(int)}.
+     * 
+     * @return the value to apply to a {@link Socket}.
+     */
     public Integer getReceiveBufferSize() {
         return receiveBufferSize;
     }
 
+    /**
+     * See {@link Socket#setTrafficClass(int)}.
+     * 
+     * @return the value to apply to a {@link Socket}.
+     */
     public Rfc1349TrafficClass getRfc1349TrafficClass() {
         return rfc1349TrafficClass;
     }
 
+    /**
+     * See {@link Socket#setSendBufferSize(int)}.
+     * 
+     * @return the value to apply to a {@link Socket}.
+     */
     public Integer getSendBufferSize() {
         return sendBufferSize;
     }
 
+    /**
+     * See {@link Socket#setSoLinger(boolean, int)}.
+     * 
+     * @return the value to apply to a {@link Socket}.
+     */
     public Integer getSoLinger() {
         return soLinger;
     }
 
+    /**
+     * See {@link Socket#setSoTimeout(int)}.
+     * 
+     * @return the value to apply to a {@link Socket}.
+     */
     public Integer getSoTimeout() {
         return soTimeout;
     }
 
+    /**
+     * See {@link Socket#setTrafficClass(int)}.
+     * 
+     * @return the value to apply to a {@link Socket}.
+     */
     public Integer getTrafficClass() {
         return trafficClass;
     }
 
+    /**
+     * See {@link Socket#setKeepAlive(boolean)}.
+     * 
+     * @return the value to apply to a {@link Socket}.
+     */
     public Boolean isKeepAlive() {
         return keepAlive;
     }
 
+    /**
+     * See {@link Socket#setOOBInline(boolean)}.
+     * 
+     * @return the value to apply to a {@link Socket}.
+     */
     public Boolean isOobInline() {
         return oobInline;
     }
 
+    /**
+     * See {@link Socket#setReuseAddress(boolean)}.
+     * 
+     * @return the value to apply to a {@link Socket}.
+     */
     public Boolean isReuseAddress() {
         return reuseAddress;
     }
 
+    /**
+     * See {@link Socket#setTcpNoDelay(boolean)}.
+     * 
+     * @return the value to apply to a {@link Socket}.
+     */
     public Boolean isTcpNoDelay() {
         return tcpNoDelay;
     }
 
+    /**
+     * See {@link Socket#setKeepAlive(boolean)}.
+     * 
+     * @param keepAlive See {@link Socket#setKeepAlive(boolean)}.
+     * @return this.
+     */
     public SocketOptions setKeepAlive(final boolean keepAlive) {
         this.keepAlive = Boolean.valueOf(keepAlive);
         return this;
     }
 
+    /**
+     * See {@link Socket#setOOBInline(boolean)}.
+     * 
+     * @param oobInline See {@link Socket#setOOBInline(boolean)}.
+     * @return this.
+     */
     public SocketOptions setOobInline(final boolean oobInline) {
         this.oobInline = Boolean.valueOf(oobInline);
         return this;
     }
 
+    /**
+     * See {@link Socket#setPerformancePreferences(int, int, int)}.
+     * 
+     * @param performancePreferences See {@link Socket#setPerformancePreferences(int, int, int)}.
+     * @return this.
+     */
     public SocketOptions setPerformancePreferences(final SocketPerformancePreferences performancePreferences) {
         this.performancePreferences = performancePreferences;
         return this;
     }
 
+    /**
+     * See {@link Socket#setReceiveBufferSize(int)}.
+     * 
+     * @param receiveBufferSize See {@link Socket#setReceiveBufferSize(int)}.
+     * @return this.
+     */
     public SocketOptions setReceiveBufferSize(final int receiveBufferSize) {
         this.receiveBufferSize = receiveBufferSize;
         return this;
     }
 
+    /**
+     * See {@link Socket#setReuseAddress(boolean)}.
+     * 
+     * @param reuseAddress See {@link Socket#setReuseAddress(boolean)}.
+     * @return this.
+     */
     public SocketOptions setReuseAddress(final boolean reuseAddress) {
         this.reuseAddress = Boolean.valueOf(reuseAddress);
         return this;
     }
 
+    /**
+     * See {@link Socket#setTrafficClass(int)}.
+     * 
+     * @param trafficClass See {@link Socket#setTrafficClass(int)}.
+     * @return the value to apply to a {@link Socket}.
+     */
     public SocketOptions setRfc1349TrafficClass(final Rfc1349TrafficClass trafficClass) {
         this.rfc1349TrafficClass = trafficClass;
         return this;
     }
 
+    /**
+     * See {@link Socket#setSendBufferSize(int)}.
+     * 
+     * @param sendBufferSize See {@link Socket#setSendBufferSize(int)}.
+     * @return this.
+     */
     public SocketOptions setSendBufferSize(final int sendBufferSize) {
         this.sendBufferSize = sendBufferSize;
         return this;
     }
 
+    /**
+     * See {@link Socket#setSoLinger(boolean, int)}.
+     * 
+     * @param soLinger See {@link Socket#setSoLinger(boolean, int)}.
+     * @return this.
+     */
     public SocketOptions setSoLinger(final int soLinger) {
         this.soLinger = soLinger;
         return this;
     }
 
+    /**
+     * See {@link Socket#setSoTimeout(int)}.
+     * 
+     * @param soTimeout See {@link Socket#setSoTimeout(int)}.
+     * @return this.
+     */
     public SocketOptions setSoTimeout(final int soTimeout) {
         this.soTimeout = soTimeout;
         return this;
     }
 
+    /**
+     * See {@link Socket#setTcpNoDelay(boolean)}.
+     * 
+     * @param tcpNoDelay See {@link Socket#setTcpNoDelay(boolean)}.
+     * @return this.
+     */
     public SocketOptions setTcpNoDelay(final boolean tcpNoDelay) {
         this.tcpNoDelay = Boolean.valueOf(tcpNoDelay);
         return this;
     }
 
+    /**
+     * See {@link Socket#setTrafficClass(int)}.
+     * 
+     * @param trafficClass See {@link Socket#setTrafficClass(int)}.
+     * @return this.
+     */
     public SocketOptions setTrafficClass(final int trafficClass) {
         this.trafficClass = trafficClass;
         return this;
@@ -224,10 +361,9 @@ public class SocketOptions implements Builder<SocketOptions>, Cloneable {
 
     @Override
     public String toString() {
-        return "SocketOptions [keepAlive=" + keepAlive + ", oobInline=" + oobInline + ", performancePreferences="
-                + performancePreferences + ", receiveBufferSize=" + receiveBufferSize + ", reuseAddress=" + reuseAddress
-                + ", rfc1349TrafficClass=" + rfc1349TrafficClass + ", sendBufferSize=" + sendBufferSize + ", soLinger="
-                + soLinger + ", soTimeout=" + soTimeout + ", tcpNoDelay=" + tcpNoDelay + ", trafficClass="
-                + trafficClass + "]";
+        return "SocketOptions [keepAlive=" + keepAlive + ", oobInline=" + oobInline + ", performancePreferences=" + performancePreferences
+            + ", receiveBufferSize=" + receiveBufferSize + ", reuseAddress=" + reuseAddress + ", rfc1349TrafficClass=" + rfc1349TrafficClass
+            + ", sendBufferSize=" + sendBufferSize + ", soLinger=" + soLinger + ", soTimeout=" + soTimeout + ", tcpNoDelay=" + tcpNoDelay + ", trafficClass="
+            + trafficClass + "]";
     }
 }

[logging-log4j2] 02/02: Javadoc.

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

ggregory pushed a commit to branch release-2.x
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git

commit 7673943d7fe1677cac46551b545d032ee91c338d
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Thu Mar 3 08:47:38 2022 -0500

    Javadoc.
---
 .../log4j/core/net/Rfc1349TrafficClass.java        | 32 ++++++++++++++++++----
 1 file changed, 27 insertions(+), 5 deletions(-)

diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/net/Rfc1349TrafficClass.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/net/Rfc1349TrafficClass.java
index fe5d6f1..f557cf6 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/net/Rfc1349TrafficClass.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/net/Rfc1349TrafficClass.java
@@ -29,13 +29,30 @@ package org.apache.logging.log4j.core.net;
  */
 public enum Rfc1349TrafficClass {
 
-    // @formatter:off
+    /**
+     * IPTOS_NORMAL (0x00)
+     */
     IPTOS_NORMAL(0x00),
+
+    /**
+     * IPTOS_LOWCOST (0x02)
+     */
     IPTOS_LOWCOST(0x02),
-    IPTOS_LOWDELAY (0x10),
-    IPTOS_RELIABILITY (0x04),
-    IPTOS_THROUGHPUT (0x08);
-    // @formatter:on
+
+    /**
+     * IPTOS_LOWDELAY (0x10)
+     */
+    IPTOS_LOWDELAY(0x10),
+
+    /**
+     * IPTOS_RELIABILITY (0x04)
+     */
+    IPTOS_RELIABILITY(0x04),
+
+    /**
+     * IPTOS_THROUGHPUT (0x08)
+     */
+    IPTOS_THROUGHPUT(0x08);
 
     private final int trafficClass;
 
@@ -43,6 +60,11 @@ public enum Rfc1349TrafficClass {
         this.trafficClass = trafficClass;
     }
 
+    /**
+     * Gets the value.
+     *
+     * @return the value.
+     */
     public int value() {
         return trafficClass;
     }