@ThreadSafe public class DefaultMCMPHandler extends Object implements MCMPHandler
MCMPHandler.| Modifier and Type | Class and Description |
|---|---|
static class |
DefaultMCMPHandler.VirtualHostImpl |
| Constructor and Description |
|---|
DefaultMCMPHandler(MCMPHandlerConfiguration config,
ResetRequestSource source,
MCMPRequestFactory requestFactory,
MCMPResponseParser responseParser) |
| Modifier and Type | Method and Description |
|---|---|
void |
addProxy(InetSocketAddress socketAddress)
Add a proxy to the list of those with which this handler communicates.
|
void |
addProxy(InetSocketAddress socketAddress,
boolean established)
Add a proxy to the list of those with which this handler communicates.
|
void |
addProxy(ProxyConfiguration proxyConfiguration)
Add a proxy to the list of those with which this handler communicates.
|
void |
addProxy(ProxyConfiguration proxyConfiguration,
boolean established)
Add a proxy to the list of those with which this handler communicates.
|
Set<MCMPServerState> |
getProxyStates()
Get the state of all proxies
|
void |
init(Collection<ProxyConfiguration> proxies,
MCMPConnectionListener connectionListener)
Initialization method for MCMP handler.
|
boolean |
isProxyHealthOK()
Convenience method that checks whether the status of all proxies is
OK. |
void |
markProxiesInError()
|
void |
removeProxy(InetSocketAddress socketAddress)
Remove a proxy from the list of those with which this handler communicates.
|
void |
reset()
|
Map<MCMPServerState,String> |
sendRequest(MCMPRequest request)
Send a request to all healthy proxies.
|
Map<MCMPServerState,List<String>> |
sendRequests(List<MCMPRequest> requests)
Send a list of requests to all healthy proxies, with all requests in the list sent to each proxy before moving on to the
next.
|
void |
shutdown()
Perform any shut down work.
|
void |
status()
Perform periodic processing.
|
public DefaultMCMPHandler(MCMPHandlerConfiguration config, ResetRequestSource source, MCMPRequestFactory requestFactory, MCMPResponseParser responseParser)
public void init(Collection<ProxyConfiguration> proxies, MCMPConnectionListener connectionListener)
MCMPHandlerinit in interface MCMPHandlerproxies - a collection of initial ProxyConfigurationsconnectionListener - connection listenerpublic void shutdown()
MCMPHandlershutdown in interface MCMPHandlerpublic void addProxy(InetSocketAddress socketAddress)
MCMPHandlerMCMPHandler.status().
Same as addProxy(address, false.
addProxy in interface MCMPHandlersocketAddress - InetSocketAddress on which the proxy listens for MCMP requestspublic void addProxy(ProxyConfiguration proxyConfiguration)
MCMPHandlerMCMPHandler.status().
Same as addProxy(proxyConfiguration, false).
addProxy in interface MCMPHandlerproxyConfiguration - ProxyConfiguration defining address on which the proxy listens for MCMP requests
and optional local address to bind connections topublic void addProxy(InetSocketAddress socketAddress, boolean established)
MCMPHandlerMCMPHandler.status().addProxy in interface MCMPHandlersocketAddress - InetSocketAddress on which the proxy listens for MCMP requestsestablished - true if the proxy should be considered established,
false otherwise.public void addProxy(ProxyConfiguration proxyConfiguration, boolean established)
MCMPHandlerMCMPHandler.status().addProxy in interface MCMPHandlerproxyConfiguration - ProxyConfiguration defining address on which the proxy listens for MCMP requests
and optional local address to bind connections toestablished - true if the proxy should be considered established,
false otherwise.public void removeProxy(InetSocketAddress socketAddress)
MCMPHandlerMCMPHandler.status().removeProxy in interface MCMPHandlersocketAddress - InetSocketAddress on which the proxy listens for MCMP requestspublic Set<MCMPServerState> getProxyStates()
MCMPHandlergetProxyStates in interface MCMPHandlerpublic boolean isProxyHealthOK()
MCMPHandlerOK.isProxyHealthOK in interface MCMPHandlertrue if all proxies are OK, false otherwisepublic void markProxiesInError()
MCMPHandlerOK down to ERROR, which will
trigger a refresh of their configuration.markProxiesInError in interface MCMPHandlerpublic void reset()
MCMPHandlerreset in interface MCMPHandlerpublic void status()
MCMPHandleraddProxy(...) or
removeProxy(...). Attempt to establish communication with any proxies whose state is
ERROR. If successful and a ResetRequestSource has been provided, update the proxy
with the list of requests provided by the source.status in interface MCMPHandlerpublic Map<MCMPServerState,String> sendRequest(MCMPRequest request)
MCMPHandlersendRequest in interface MCMPHandlerrequest - the request. Cannot be nullpublic Map<MCMPServerState,List<String>> sendRequests(List<MCMPRequest> requests)
MCMPHandlersendRequests in interface MCMPHandlerrequests - the requests. Cannot be nullCopyright © 2023 JBoss by Red Hat. All rights reserved.