public class DiscoveryHandlerImpl extends ComponentBase implements DiscoveryHandler, EventListener
DiscoveryHandler
implementation that reads the serverURL(s) from the configuration using key
CONFIG_DISCOVERY_SERVERURLS
.Constructor and Description |
---|
DiscoveryHandlerImpl() |
Modifier and Type | Method and Description |
---|---|
java.net.URL |
getServerUrl()
Returns the first available URL from a the ordered list of the configured server URLs.
|
void |
handle(java.lang.String topic,
java.util.Map<java.lang.String,java.lang.String> payload)
Event callback.
|
protected void |
onInit() |
protected void |
onStop() |
getAgentContext, getAgentUpdateHandler, getConfigurationHandler, getConnectionHandler, getDeploymentHandler, getDiscoveryHandler, getDownloadHandler, getEventsHandler, getExecutorService, getFeedbackHandler, getIdentificationHandler, getLoggingHandler, getWorkDir, init, logDebug, logDebug, logError, logError, logInfo, logInfo, logWarning, logWarning, onStart, start, stop
protected void onInit() throws java.lang.Exception
onInit
in class ComponentBase
java.lang.Exception
protected void onStop() throws java.lang.Exception
onStop
in class ComponentBase
java.lang.Exception
public void handle(java.lang.String topic, java.util.Map<java.lang.String,java.lang.String> payload)
EventListener
handle
in interface EventListener
topic
- The topic stringpayload
- An unmodifiable mappublic java.net.URL getServerUrl()
CONFIG_DISCOVERY_CHECKING
flag is set a connection is opened to test whether a serverURL is available
before it is returned.getServerUrl
in interface DiscoveryHandler
null
in case no server URL was valid.