Class SocketPerformancePreferences
- java.lang.Object
-
- org.apache.logging.log4j.core.net.SocketPerformancePreferences
-
- All Implemented Interfaces:
java.lang.Cloneable,Builder<SocketPerformancePreferences>
@Plugin(name="SocketPerformancePreferences", category="Core", printObject=true) public class SocketPerformancePreferences extends java.lang.Object implements Builder<SocketPerformancePreferences>, java.lang.Cloneable
Holds all socket options settable viaSocket.setPerformancePreferences(int, int, int).The
Socket.setPerformancePreferences(int, int, int)API may not be implemented by a JRE.
-
-
Field Summary
Fields Modifier and Type Field Description private intbandwidthprivate intconnectionTimeprivate intlatency
-
Constructor Summary
Constructors Constructor Description SocketPerformancePreferences()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidapply(java.net.Socket socket)SocketPerformancePreferencesbuild()Builds the object after all configuration has been set.intgetBandwidth()intgetConnectionTime()intgetLatency()static SocketPerformancePreferencesnewBuilder()voidsetBandwidth(int bandwidth)voidsetConnectionTime(int connectionTime)voidsetLatency(int latency)java.lang.StringtoString()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.logging.log4j.core.util.Builder
getErrorPrefix, isValid
-
-
-
-
Field Detail
-
bandwidth
@PluginBuilderAttribute @Required private int bandwidth
-
connectionTime
@PluginBuilderAttribute @Required private int connectionTime
-
latency
@PluginBuilderAttribute @Required private int latency
-
-
Method Detail
-
newBuilder
@PluginBuilderFactory public static SocketPerformancePreferences newBuilder()
-
apply
public void apply(java.net.Socket socket)
-
build
public SocketPerformancePreferences build()
Description copied from interface:BuilderBuilds the object after all configuration has been set. This will use default values for any unspecified attributes for the object.- Specified by:
buildin interfaceBuilder<SocketPerformancePreferences>- Returns:
- the configured instance.
-
getBandwidth
public int getBandwidth()
-
getConnectionTime
public int getConnectionTime()
-
getLatency
public int getLatency()
-
setBandwidth
public void setBandwidth(int bandwidth)
-
setConnectionTime
public void setConnectionTime(int connectionTime)
-
setLatency
public void setLatency(int latency)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-