public class NetworkChecker
extends java.lang.Object
Constructor and Description |
---|
NetworkChecker(java.lang.String address,
omero.log.Logger logger)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
boolean |
isAvailable()
Checks the network is available or not.
|
boolean |
isNetworkup(boolean useCachedValue)
Returns
true if the network is still up, otherwise throws an
UnknownHostException . |
public NetworkChecker(java.lang.String address, omero.log.Logger logger)
address
- The address of the server the client is connected to or
null
.logger
- Reference to the logger.public boolean isNetworkup(boolean useCachedValue) throws java.lang.Exception
true
if the network is still up, otherwise throws an
UnknownHostException
. This tests if the adapter is ready.useCachedValue
- Pass true
if we use the cached value,
false
otherwise.java.lang.Exception
- Thrown if the network is down.public boolean isAvailable() throws java.lang.Exception
java.lang.Exception
- Thrown if an error occurred if we cannot reach.