public class BlacklistServiceFilter extends Object implements ServiceFilter
Constructor and Description |
---|
BlacklistServiceFilter() |
BlacklistServiceFilter(List<ServiceDefinition> blacklist) |
Modifier and Type | Method and Description |
---|---|
void |
addServer(ServiceDefinition server)
Add a server to the known list of servers.
|
void |
addServer(String serverString)
Add a server to the known list of servers to blacklist.
|
List<ServiceDefinition> |
apply(List<ServiceDefinition> services)
Chooses one of the service to use
|
static BlacklistServiceFilter |
forServices(Collection<ServiceDefinition> definitions) |
static BlacklistServiceFilter |
forServices(ServiceDefinition... definitions) |
void |
removeServer(Predicate<ServiceDefinition> condition)
Remove an existing server from the list of known servers.
|
void |
setServers(List<String> servers)
Set the servers to blacklist.
|
void |
setServers(String servers)
Set the servers to blacklist.
|
public BlacklistServiceFilter()
public BlacklistServiceFilter(List<ServiceDefinition> blacklist)
public void setServers(List<String> servers)
servers
- server in the format: [service@]host:port.public void setServers(String servers)
servers
- servers separated by comma in the format: [service@]host:port,[service@]host2:port,[service@]host3:port and so on.public void addServer(ServiceDefinition server)
public void addServer(String serverString)
serverString
- servers separated by comma in the format: [service@]host:port,[service@]host2:port,[service@]host3:port and so on.public void removeServer(Predicate<ServiceDefinition> condition)
public List<ServiceDefinition> apply(List<ServiceDefinition> services)
ServiceFilter
apply
in interface ServiceFilter
services
- list of servicespublic static BlacklistServiceFilter forServices(Collection<ServiceDefinition> definitions)
public static BlacklistServiceFilter forServices(ServiceDefinition... definitions)
Apache Camel