|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IConfig
Access to server configuration. These methods provide access to the state and
configuration of the server and its components (e.g. the database). However,
it should not be assumed that two subsequent calls to a proxy for this
service will go to the same server due to clustering.
Not all possible server configuration is available through this API. Some
values (such as DB connection info, ports, etc.) must naturally be set before
this service is accessible.
Manages synchronization of the various configuration sources internally. It
is therefore important that as far as possible all configuration changes
take place via this interface and not, for example, directly via
Preferences
.
Also used as the main developer example for developing (stateless) ome.api
interfaces. See source code documentation for more.
Field Summary | |
---|---|
static String |
VERSION_REGEX
Defines how the omero.version Preference will be parsed
into the form: Major.minor.patch for getVersion() |
Method Summary | |
---|---|
String |
getConfigValue(String key)
retrieve a configuration value from the backend store. |
Date |
getDatabaseTime()
checks the database for it's time using a SELECT statement. |
String |
getDatabaseUuid()
Provides the UUID for this OMERO (database) instance. |
Date |
getServerTime()
checks the current server for it's time. |
String |
getVersion()
Provides the release version. |
void |
setConfigValue(String key,
String value)
set a configuration value in the backend store. |
boolean |
setConfigValueIfEquals(String key,
String value,
String test)
Calls setConfigValue(String, String) if and only if the
configuration property is currently equal to the test argument. |
Field Detail |
---|
static final String VERSION_REGEX
Preference
will be parsed
into the form: Major.minor.patch for getVersion()
Method Detail |
---|
Date getServerTime()
Date
representation of the server's own time.Date getDatabaseTime() throws ome.conditions.InternalException
Date
representation of the database's time.
ome.conditions.InternalException
- though any call can throw an InternalException it is more
likely that this can occur while contacting the DB. An
exception here most likely means (A) a temporary issue with
the DB or (B) a SQL dialect issue which must be corrected by
the Omero team.String getConfigValue(String key) throws ome.conditions.ApiUsageException, ome.conditions.SecurityViolation
SecurityViolation
to be thrown.
key
- The non-null name of the desired configuration value
String
value linked to this key, possibly null if not
set.
ome.conditions.ApiUsageException
- if the key is null or invalid.
ome.conditions.SecurityViolation
- if the value for the key is not readable.void setConfigValue(String key, String value) throws ome.conditions.ApiUsageException, ome.conditions.SecurityViolation
SecurityViolation
to be
thrown. If the value is null or empty, then the configuration will be
removed in all writable configuration sources. If the configuration is
set in a non-modifiable source (e.g. in a property file on the classpath),
then a subsequent call to getConfigValue() will return that value.
key
- The non-null name of the desired configuration valuevalue
- The String
value to assign to the given key.
ome.conditions.ApiUsageException
- if the key is null or invalid.
ome.conditions.SecurityViolation
- if the value is not writable.boolean setConfigValueIfEquals(String key, String value, String test) throws ome.conditions.ApiUsageException, ome.conditions.SecurityViolation
setConfigValue(String, String)
if and only if the
configuration property is currently equal to the test argument. If the
test is null or empty, then the configuration property will be set only
if missing.
key
- value
-
ome.conditions.ApiUsageException
ome.conditions.SecurityViolation
setConfigValue(String, String)
String getVersion()
getVersion()
VERSION_REGEX
String getDatabaseUuid()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Version: Beta-4.1.1-r5927-b91
Copyright © 2009 The University of Dundee. All Rights Reserved.