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.Runnable
Contacts 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 int
DEFAULT_TIMEOUT
Default 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.Exception
getExceptionThrown()
java.lang.String
getUpgradeUrl()
boolean
isExceptionThrown()
boolean
isUpgradeNeeded()
void
run()
If theurl
has 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.0
orIConfig.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 theurl
has 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:
run
in interfacejava.lang.Runnable
-
-