public interface ILoadBalancer
Modifier and Type | Method and Description |
---|---|
void |
addServers(java.util.List<Server> newServers)
Initial list of servers.
|
Server |
chooseServer(java.lang.Object key)
Choose a server from load balancer.
|
java.util.List<Server> |
getAllServers() |
java.util.List<Server> |
getReachableServers() |
java.util.List<Server> |
getServerList(boolean availableOnly)
Deprecated.
2016-01-20 This method is deprecated in favor of the
cleaner
getReachableServers() (equivalent to availableOnly=true)
and getAllServers() API (equivalent to availableOnly=false).
Get the current list of servers. |
void |
markServerDown(Server server)
To be called by the clients of the load balancer to notify that a Server is down
else, the LB will think its still Alive until the next Ping cycle - potentially
(assuming that the LB Impl does a ping)
|
void addServers(java.util.List<Server> newServers)
newServers
- new servers to addServer chooseServer(java.lang.Object key)
key
- An object that the load balancer may use to determine which server to return. null if
the load balancer does not use this parameter.void markServerDown(Server server)
server
- Server to mark as down@Deprecated java.util.List<Server> getServerList(boolean availableOnly)
getReachableServers()
(equivalent to availableOnly=true)
and getAllServers()
API (equivalent to availableOnly=false).
Get the current list of servers.availableOnly
- if true, only live and available servers should be returnedjava.util.List<Server> getReachableServers()
java.util.List<Server> getAllServers()