Top Description Inners Fields Constructors Methods
io.undertow.server.handlers.proxy.mod_cluster

public Class Balancer

extends Object
Class Inheritance
Imports
io.undertow.UndertowLogger, java.util.concurrent.atomic.AtomicInteger

The mod_cluster balancer config.
Authors
Stuart Douglas, Emanuel Muckenhuber

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class

Field Summary

Modifier and TypeField and Description
private final int
private static final AtomicInteger
private final int
maxRetries

Maximum number of failover attempts to send the request to the backend server.

private final String
name

Name of the balancer.

private final boolean
stickySession

true: use JVMRoute to stick a request to a node, false: ignore JVMRoute.

private final String
stickySessionCookie

Name of the cookie containing the session-id. Max size: 30 Default: "JSESSIONID"

private final boolean
stickySessionForce

true: Return an error if the request can't be routed according to JVMRoute, false: Route it to another node.

private final String
stickySessionPath

Name of the parameter containing the session-id. Max size: 30.

private final boolean
stickySessionRemove

true: remove the session-id (cookie or parameter) when the request can't be routed to the right node.

private final int
waitWorker

value in seconds: time to wait for an available worker.

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv static Balancer.BalancerBuilder
public int
public int
getMaxattempts()
Deprecated

public int
public String
public String
public String
public int
public boolean
public boolean
public boolean
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

idback to summary
private final int id
idGenback to summary
private static final AtomicInteger idGen
maxRetriesback to summary
private final int maxRetries

Maximum number of failover attempts to send the request to the backend server. Default: "1"

nameback to summary
private final String name

Name of the balancer. max size: 40, Default: "mycluster"

stickySessionback to summary
private final boolean stickySession

true: use JVMRoute to stick a request to a node, false: ignore JVMRoute. Default: true

stickySessionCookieback to summary
private final String stickySessionCookie

Name of the cookie containing the session-id. Max size: 30 Default: "JSESSIONID"

stickySessionForceback to summary
private final boolean stickySessionForce

true: Return an error if the request can't be routed according to JVMRoute, false: Route it to another node. Default: true

stickySessionPathback to summary
private final String stickySessionPath

Name of the parameter containing the session-id. Max size: 30. Default: "jsessionid"

stickySessionRemoveback to summary
private final boolean stickySessionRemove

true: remove the session-id (cookie or parameter) when the request can't be routed to the right node. false: send it anyway. Default: false

waitWorkerback to summary
private final int waitWorker

value in seconds: time to wait for an available worker. Default: "0" no wait.

Constructor Detail

Balancerback to summary
pack-priv Balancer(Balancer.BalancerBuilder b)

Method Detail

builderback to summary
pack-priv static Balancer.BalancerBuilder builder()
getIdback to summary
public int getId()
getMaxattemptsback to summary
public int getMaxattempts()

Deprecated

Annotations
@Deprecated
getMaxRetriesback to summary
public int getMaxRetries()
getNameback to summary
public String getName()
getStickySessionCookieback to summary
public String getStickySessionCookie()
getStickySessionPathback to summary
public String getStickySessionPath()
getWaitWorkerback to summary
public int getWaitWorker()
isStickySessionback to summary
public boolean isStickySession()
isStickySessionForceback to summary
public boolean isStickySessionForce()
isStickySessionRemoveback to summary
public boolean isStickySessionRemove()
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override
io.undertow.server.handlers.proxy.mod_cluster back to summary

public final Class Balancer.BalancerBuilder

extends Object
Class Inheritance
  • java.lang.Object
  • io.undertow.server.handlers.proxy.mod_cluster.Balancer.BalancerBuilder

Field Summary

Modifier and TypeField and Description
private int
private String
private boolean
private String
private boolean
private String
private boolean
private int

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Balancer
public int
getMaxattempts()
Deprecated for removal since 2.0.4. Use BalancerBuilder#getMaxRetries().

public int
public String
public String
public String
public int
public boolean
public boolean
public boolean
public Balancer.BalancerBuilder
setMaxattempts(int maxattempts)
Deprecated for removal since 2.0.4. Use BalancerBuilder#setMaxRetries(int).

public Balancer.BalancerBuilder
setMaxRetries(int
number of failover attempts
maxRetries
)

Maximum number of failover attempts to send the request to the backend server.

public Balancer.BalancerBuilder
public Balancer.BalancerBuilder
setStickySession(boolean stickySession)

public Balancer.BalancerBuilder
setStickySessionCookie(String stickySessionCookie)

public Balancer.BalancerBuilder
setStickySessionForce(boolean stickySessionForce)

public Balancer.BalancerBuilder
setStickySessionPath(String stickySessionPath)

public Balancer.BalancerBuilder
setStickySessionRemove(boolean stickySessionRemove)

public Balancer.BalancerBuilder
setWaitWorker(int waitWorker)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

maxRetriesback to summary
private int maxRetries
nameback to summary
private String name
stickySessionback to summary
private boolean stickySession
stickySessionCookieback to summary
private String stickySessionCookie
stickySessionForceback to summary
private boolean stickySessionForce
stickySessionPathback to summary
private String stickySessionPath
stickySessionRemoveback to summary
private boolean stickySessionRemove
waitWorkerback to summary
private int waitWorker

Constructor Detail

BalancerBuilderback to summary
public BalancerBuilder()

Method Detail

buildback to summary
public Balancer build()
getMaxattemptsback to summary
public int getMaxattempts()

Deprecated

for removal since 2.0.4.

Use BalancerBuilder#getMaxRetries().

Annotations
@Deprecated
since:2.0.4
forRemoval:true
getMaxRetriesback to summary
public int getMaxRetries()
getNameback to summary
public String getName()
getStickySessionCookieback to summary
public String getStickySessionCookie()
getStickySessionPathback to summary
public String getStickySessionPath()
getWaitWorkerback to summary
public int getWaitWorker()
isStickySessionback to summary
public boolean isStickySession()
isStickySessionForceback to summary
public boolean isStickySessionForce()
isStickySessionRemoveback to summary
public boolean isStickySessionRemove()
setMaxattemptsback to summary
public Balancer.BalancerBuilder setMaxattempts(int maxattempts)

Deprecated

for removal since 2.0.4.

Use BalancerBuilder#setMaxRetries(int).

Annotations
@Deprecated
since:2.0.4
forRemoval:true
setMaxRetriesback to summary
public Balancer.BalancerBuilder setMaxRetries(int maxRetries)

Maximum number of failover attempts to send the request to the backend server.

Parameters
maxRetries:int

number of failover attempts

setNameback to summary
public Balancer.BalancerBuilder setName(String name)
setStickySessionback to summary
public Balancer.BalancerBuilder setStickySession(boolean stickySession)
setStickySessionCookieback to summary
public Balancer.BalancerBuilder setStickySessionCookie(String stickySessionCookie)
setStickySessionForceback to summary
public Balancer.BalancerBuilder setStickySessionForce(boolean stickySessionForce)
setStickySessionPathback to summary
public Balancer.BalancerBuilder setStickySessionPath(String stickySessionPath)
setStickySessionRemoveback to summary
public Balancer.BalancerBuilder setStickySessionRemove(boolean stickySessionRemove)
setWaitWorkerback to summary
public Balancer.BalancerBuilder setWaitWorker(int waitWorker)