Package ome.system
Class UpgradeCheck
- java.lang.Object
-
- ome.system.UpgradeCheck
-
- All Implemented Interfaces:
java.lang.Runnable
public class UpgradeCheck extends java.lang.Object implements java.lang.RunnableContacts a given URL which should be an OME server which will return either an empty String or a URL which points to a needed upgrade.- Since:
- 3.0-Beta2.3
-
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_TIMEOUTDefault timeout is 10 seconds.
-
Constructor Summary
Constructors Constructor Description UpgradeCheck(java.lang.String url, java.lang.String version, java.lang.String agent)UpgradeCheck(java.lang.String url, java.lang.String version, java.lang.String agent, int timeout)Main constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.ExceptiongetExceptionThrown()java.lang.StringgetUpgradeUrl()booleanisExceptionThrown()booleanisUpgradeNeeded()voidrun()If theurlhas been set to null or the empty string, then no upgrade check will be performed (silently).
-
-
-
Field Detail
-
DEFAULT_TIMEOUT
public static final int DEFAULT_TIMEOUT
Default timeout is 10 seconds.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
UpgradeCheck
public UpgradeCheck(java.lang.String url, java.lang.String version, java.lang.String agent)
-
UpgradeCheck
public UpgradeCheck(java.lang.String url, java.lang.String version, java.lang.String agent, int timeout)Main constructor.- Parameters:
url- Null or empty value disables check.version- Current version as specified in the omero.properties file under the "omero.version" property. This can be accessed viaIConfig.getVersion() // 4.0.0orIConfig.getConfigValue("omero.version") // [optional-]4.0.0[-optional]agent- Name of the agent which is accessing the registry. This will be appended to "OMERO." in order to adhere to the registry API.timeout- How long to wait for a
-
-
Method Detail
-
isUpgradeNeeded
public boolean isUpgradeNeeded()
-
getUpgradeUrl
public java.lang.String getUpgradeUrl()
-
isExceptionThrown
public boolean isExceptionThrown()
-
getExceptionThrown
public java.lang.Exception getExceptionThrown()
-
run
public void run()
If theurlhas been set to null or the empty string, then no upgrade check will be performed (silently). If however the string is an invalid URL, a warning will be printed. This method should never throw an exception.- Specified by:
runin interfacejava.lang.Runnable
-
-