Package omero.gateway.util
Class NetworkChecker
- java.lang.Object
-
- omero.gateway.util.NetworkChecker
-
public class NetworkChecker extends java.lang.Object
Checks if the network is still up.- Since:
- 4.4
-
-
Constructor Summary
Constructors Constructor Description NetworkChecker(java.lang.String address, omero.log.Logger logger)
Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isAvailable()
Checks the network is available or not.boolean
isNetworkup(boolean useCachedValue)
Returnstrue
if the network is still up, otherwise throws anUnknownHostException
.
-
-
-
Method Detail
-
isNetworkup
public boolean isNetworkup(boolean useCachedValue) throws java.lang.Exception
Returnstrue
if the network is still up, otherwise throws anUnknownHostException
. This tests if the adapter is ready.- Parameters:
useCachedValue
- Passtrue
if we use the cached value,false
otherwise.- Returns:
- See above.
- Throws:
java.lang.Exception
- Thrown if the network is down.
-
isAvailable
public boolean isAvailable() throws java.lang.Exception
Checks the network is available or not.- Returns:
- See above.
- Throws:
java.lang.Exception
- Thrown if an error occurred if we cannot reach.
-
-