ome.system
Class UpgradeCheck

java.lang.Object
  extended by ome.system.UpgradeCheck
All Implemented Interfaces:
Runnable

public class UpgradeCheck
extends Object
implements 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
Author:
Josh Moore, josh at glencoesoftware.com

Field Summary
static int DEFAULT_TIMEOUT
          Default timeout is 10 seconds.
 
Constructor Summary
UpgradeCheck(String url, String version, String agent)
          Calls UpgradeCheck(String, String, String, int) using DEFAULT_TIMEOUT
UpgradeCheck(String url, String version, String agent, int timeout)
          Main constructor.
 
Method Summary
 Exception getExceptionThrown()
           
 String getUpgradeUrl()
           
 boolean isExceptionThrown()
           
 boolean isUpgradeNeeded()
           
 void run()
          If the url has been set to null or the empty string, then no upgrade check will be performed (silently).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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(String url,
                    String version,
                    String agent)
Calls UpgradeCheck(String, String, String, int) using DEFAULT_TIMEOUT


UpgradeCheck

public UpgradeCheck(String url,
                    String version,
                    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 via IConfig.getVersion() // 4.0.0 or IConfig.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 String getUpgradeUrl()

isExceptionThrown

public boolean isExceptionThrown()

getExceptionThrown

public Exception getExceptionThrown()

run

public void run()
If the url 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 interface Runnable


OmeroJava Api

Version: Beta4.2.1-r8614-Beta4.2-b41

Copyright © 2009 The University of Dundee. All Rights Reserved.