public class WalledGardenInternetObservingStrategy extends java.lang.Object implements InternetObservingStrategy
Constructor and Description |
---|
WalledGardenInternetObservingStrategy() |
Modifier and Type | Method and Description |
---|---|
protected java.lang.String |
adjustHost(java.lang.String host) |
protected javax.net.ssl.HttpsURLConnection |
createHttpsUrlConnection(java.lang.String host,
int port,
int timeoutInMs) |
protected java.net.HttpURLConnection |
createHttpUrlConnection(java.lang.String host,
int port,
int timeoutInMs) |
java.lang.String |
getDefaultPingHost()
Gets default remote ping host for a given Internet Observing Strategy
|
protected java.lang.Boolean |
isConnected(java.lang.String host,
int port,
int timeoutInMs,
ErrorHandler errorHandler) |
<any> |
observeInternetConnectivity(int initialIntervalInMs,
int intervalInMs,
java.lang.String host,
int port,
int timeoutInMs,
ErrorHandler errorHandler)
Observes connectivity with the Internet by opening socket connection with remote host
|
public WalledGardenInternetObservingStrategy()
public <any> observeInternetConnectivity(int initialIntervalInMs, int intervalInMs, java.lang.String host, int port, int timeoutInMs, ErrorHandler errorHandler)
InternetObservingStrategy
observeInternetConnectivity
in interface InternetObservingStrategy
initialIntervalInMs
- in milliseconds determining the delay of the first connectivity
checkintervalInMs
- in milliseconds determining how often we want to check connectivityhost
- for checking Internet connectivityport
- for checking Internet connectivitytimeoutInMs
- for pinging remote host in millisecondserrorHandler
- for handling errors while checking connectivitypublic java.lang.String getDefaultPingHost()
InternetObservingStrategy
getDefaultPingHost
in interface InternetObservingStrategy
protected java.lang.String adjustHost(java.lang.String host)
protected java.lang.Boolean isConnected(java.lang.String host, int port, int timeoutInMs, ErrorHandler errorHandler)
protected java.net.HttpURLConnection createHttpUrlConnection(java.lang.String host, int port, int timeoutInMs) throws java.io.IOException
java.io.IOException
protected javax.net.ssl.HttpsURLConnection createHttpsUrlConnection(java.lang.String host, int port, int timeoutInMs) throws java.io.IOException
java.io.IOException