Top Description Fields Constructors Methods
io.vertx.core.net

public Class TrafficShapingOptions

extends Object
Class Inheritance
Annotations
@Unstable
@DataObject
@JsonGen
publicConverter:false
Imports
java.util.Objects, java.util.concurrent.TimeUnit, io.netty.util.internal.ObjectUtil, io.vertx.codegen.annotations.DataObject, .Unstable, io.vertx.codegen.json.annotations.JsonGen, io.vertx.core.json.JsonObject

Options describing how io.netty.handler.traffic.GlobalTrafficShapingHandler will handle traffic shaping.

Field Summary

Modifier and TypeField and Description
private long
private TimeUnit
public static final long
DEFAULT_CHECK_INTERVAL

Default check interval for stats = 1 second.

public static final long
DEFAULT_INBOUND_GLOBAL_BANDWIDTH_LIMIT

Default inbound bandwidth limit in bytes/sec = 0 (0 implies unthrottled)

public static final long
DEFAULT_MAX_TIME

Default max delay to wait = 15 seconds.

public static final long
DEFAULT_OUTBOUND_GLOBAL_BANDWIDTH_LIMIT

Default outbound bandwidth limit in bytes/sec = 0 (0 implies unthrottled)

public static final long
DEFAULT_PEAK_OUTBOUND_GLOBAL_BANDWIDTH

Default peak outbound bandwidth limit in bytes/sec = 400 Mbps (aligns with netty's default in io.netty.handler.traffic.AbstractTrafficShapingHandler#DEFAULT_MAX_SIZE)

private long
private long
private TimeUnit
private long
private long

Constructor Summary

AccessConstructor and Description
public
public
public
TrafficShapingOptions(JsonObject json)
References Deprecated JsonObject is deprecated or references (maybe indirectly) at least one deprecated element.

Method Summary

Modifier and TypeMethod and Description
public boolean
equals(Object
the reference object with which to compare.
obj
)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

public long

Returns:

delay between two computations of performances
getCheckIntervalForStats
()

public TimeUnit

Returns:

check interval for stats time unit
getCheckIntervalForStatsTimeUnit
()

public long

Returns:

inbound bandwidth limit in bytes
getInboundGlobalBandwidth
()

public long

Returns:

maximum delay to wait in case of traffic excess
getMaxDelayToWait
()

public TimeUnit

Returns:

maximum delay time unit
getMaxDelayToWaitTimeUnit
()

public long

Returns:

outbound bandwidth limit in byte
getOutboundGlobalBandwidth
()

public long

Returns:

max outbound bandwidth limit in bytes
getPeakOutboundGlobalBandwidth
()

public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this object.

public TrafficShapingOptions

Returns:

a reference to this, so the API can be used fluently
setCheckIntervalForStats
(long
delay between two computations of performances
checkIntervalForStats
)

Set the delay between two computations of performances for channels

public TrafficShapingOptions

Returns:

a reference to this, so the API can be used fluently
setCheckIntervalForStatsTimeUnit
(TimeUnit
check interval for stats time unit
checkIntervalForStatsTimeUnit
)

Set time unit for check interval for stats.

public TrafficShapingOptions

Returns:

a reference to this, so the API can be used fluently
setInboundGlobalBandwidth
(long
bandwidth limit
inboundGlobalBandwidth
)

Set bandwidth limit in bytes per second for inbound connections

public TrafficShapingOptions

Returns:

a reference to this, so the API can be used fluently
setMaxDelayToWait
(long
maximum delay time for waiting
maxDelayToWaitTime
)

Set the maximum delay to wait in case of traffic excess

public TrafficShapingOptions

Returns:

a reference to this, so the API can be used fluently
setMaxDelayToWaitUnit
(TimeUnit
maximum delay time's unit
maxDelayToWaitTimeUnit
)

Set the maximum delay to wait time unit

public TrafficShapingOptions

Returns:

a reference to this, so the API can be used fluently
setOutboundGlobalBandwidth
(long
bandwidth limit
outboundGlobalBandwidth
)

Set bandwidth limit in bytes per second for outbound connections

public TrafficShapingOptions

Returns:

a reference to this, so the API can be used fluently
setPeakOutboundGlobalBandwidth
(long
peak outbound bandwidth
peakOutboundGlobalBandwidth
)

Set the maximum global write size in bytes per second allowed in the buffer globally for all channels before write suspended is set.

public JsonObject
toJson()
References Deprecated JsonObject is deprecated or references (maybe indirectly) at least one deprecated element.

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAlltoStringwaitwaitwait

Field Detail

checkIntervalForStatsback to summary
private long checkIntervalForStats
checkIntervalForStatsTimeUnitback to summary
private TimeUnit checkIntervalForStatsTimeUnit
DEFAULT_CHECK_INTERVALback to summary
public static final long DEFAULT_CHECK_INTERVAL

Default check interval for stats = 1 second. The units are in milliseconds. (Aligns with netty's default in io.netty.handler.traffic.AbstractTrafficShapingHandler#DEFAULT_CHECK_INTERVAL)

DEFAULT_INBOUND_GLOBAL_BANDWIDTH_LIMITback to summary
public static final long DEFAULT_INBOUND_GLOBAL_BANDWIDTH_LIMIT

Default inbound bandwidth limit in bytes/sec = 0 (0 implies unthrottled)

DEFAULT_MAX_TIMEback to summary
public static final long DEFAULT_MAX_TIME

Default max delay to wait = 15 seconds. The units are in milliseconds. (Aligns with netty's default in io.netty.handler.traffic.AbstractTrafficShapingHandler#DEFAULT_MAX_TIME)

DEFAULT_OUTBOUND_GLOBAL_BANDWIDTH_LIMITback to summary
public static final long DEFAULT_OUTBOUND_GLOBAL_BANDWIDTH_LIMIT

Default outbound bandwidth limit in bytes/sec = 0 (0 implies unthrottled)

DEFAULT_PEAK_OUTBOUND_GLOBAL_BANDWIDTHback to summary
public static final long DEFAULT_PEAK_OUTBOUND_GLOBAL_BANDWIDTH

Default peak outbound bandwidth limit in bytes/sec = 400 Mbps (aligns with netty's default in io.netty.handler.traffic.AbstractTrafficShapingHandler#DEFAULT_MAX_SIZE)

inboundGlobalBandwidthback to summary
private long inboundGlobalBandwidth
maxDelayToWaitback to summary
private long maxDelayToWait
maxDelayToWaitTimeUnitback to summary
private TimeUnit maxDelayToWaitTimeUnit
outboundGlobalBandwidthback to summary
private long outboundGlobalBandwidth
peakOutboundGlobalBandwidthback to summary
private long peakOutboundGlobalBandwidth

Constructor Detail

TrafficShapingOptionsback to summary
public TrafficShapingOptions()
TrafficShapingOptionsback to summary
public TrafficShapingOptions(TrafficShapingOptions other)
TrafficShapingOptionsback to summary
public TrafficShapingOptions(JsonObject json)

References Deprecated

JsonObject is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Method Detail

equalsback to summary
public boolean equals(Object obj)

Overrides java.lang.Object.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Parameters
obj:Object

the reference object with which to compare.

Returns:boolean

true if this object is the same as the obj argument; false otherwise.

Annotations
@Override
getCheckIntervalForStatsback to summary
public long getCheckIntervalForStats()
Returns:long

delay between two computations of performances

getCheckIntervalForStatsTimeUnitback to summary
public TimeUnit getCheckIntervalForStatsTimeUnit()
Returns:TimeUnit

check interval for stats time unit

getInboundGlobalBandwidthback to summary
public long getInboundGlobalBandwidth()
Returns:long

inbound bandwidth limit in bytes

getMaxDelayToWaitback to summary
public long getMaxDelayToWait()
Returns:long

maximum delay to wait in case of traffic excess

getMaxDelayToWaitTimeUnitback to summary
public TimeUnit getMaxDelayToWaitTimeUnit()
Returns:TimeUnit

maximum delay time unit

getOutboundGlobalBandwidthback to summary
public long getOutboundGlobalBandwidth()
Returns:long

outbound bandwidth limit in byte

getPeakOutboundGlobalBandwidthback to summary
public long getPeakOutboundGlobalBandwidth()
Returns:long

max outbound bandwidth limit in bytes

hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for this object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns:int

a hash code value for this object

Annotations
@Override
setCheckIntervalForStatsback to summary
public TrafficShapingOptions setCheckIntervalForStats(long checkIntervalForStats)

Set the delay between two computations of performances for channels

Parameters
checkIntervalForStats:long

delay between two computations of performances

Returns:TrafficShapingOptions

a reference to this, so the API can be used fluently

setCheckIntervalForStatsTimeUnitback to summary
public TrafficShapingOptions setCheckIntervalForStatsTimeUnit(TimeUnit checkIntervalForStatsTimeUnit)

Set time unit for check interval for stats.

Parameters
checkIntervalForStatsTimeUnit:TimeUnit

check interval for stats time unit

Returns:TrafficShapingOptions

a reference to this, so the API can be used fluently

setInboundGlobalBandwidthback to summary
public TrafficShapingOptions setInboundGlobalBandwidth(long inboundGlobalBandwidth)

Set bandwidth limit in bytes per second for inbound connections

Parameters
inboundGlobalBandwidth:long

bandwidth limit

Returns:TrafficShapingOptions

a reference to this, so the API can be used fluently

setMaxDelayToWaitback to summary
public TrafficShapingOptions setMaxDelayToWait(long maxDelayToWaitTime)

Set the maximum delay to wait in case of traffic excess

Parameters
maxDelayToWaitTime:long

maximum delay time for waiting

Returns:TrafficShapingOptions

a reference to this, so the API can be used fluently

setMaxDelayToWaitUnitback to summary
public TrafficShapingOptions setMaxDelayToWaitUnit(TimeUnit maxDelayToWaitTimeUnit)

Set the maximum delay to wait time unit

Parameters
maxDelayToWaitTimeUnit:TimeUnit

maximum delay time's unit

Returns:TrafficShapingOptions

a reference to this, so the API can be used fluently

setOutboundGlobalBandwidthback to summary
public TrafficShapingOptions setOutboundGlobalBandwidth(long outboundGlobalBandwidth)

Set bandwidth limit in bytes per second for outbound connections

Parameters
outboundGlobalBandwidth:long

bandwidth limit

Returns:TrafficShapingOptions

a reference to this, so the API can be used fluently

setPeakOutboundGlobalBandwidthback to summary
public TrafficShapingOptions setPeakOutboundGlobalBandwidth(long peakOutboundGlobalBandwidth)

Set the maximum global write size in bytes per second allowed in the buffer globally for all channels before write suspended is set. Default value is 400 MB

Parameters
peakOutboundGlobalBandwidth:long

peak outbound bandwidth

Returns:TrafficShapingOptions

a reference to this, so the API can be used fluently

toJsonback to summary
public JsonObject toJson()

References Deprecated

JsonObject is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.