Class 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)
      Returns true if the network is still up, otherwise throws an UnknownHostException.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • NetworkChecker

        public NetworkChecker​(java.lang.String address,
                              omero.log.Logger logger)
        Creates a new instance.
        Parameters:
        address - The address of the server the client is connected to or null.
        logger - Reference to the logger.
    • Method Detail

      • isNetworkup

        public boolean isNetworkup​(boolean useCachedValue)
                            throws java.lang.Exception
        Returns true if the network is still up, otherwise throws an UnknownHostException. This tests if the adapter is ready.
        Parameters:
        useCachedValue - Pass true 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.