public interface IConfig extends ServiceInterface
Preferences
.
Also used as the main developer example for developing (stateless) ome.api
interfaces. See source code documentation for more.Modifier and Type | Field and Description |
---|---|
static String |
VERSION_REGEX
Defines how the omero.version
Preference will be parsed
into the form: Major.minor.patch for getVersion() |
Modifier and Type | Method and Description |
---|---|
Map<String,String> |
getClientConfigDefaults()
reads the etc/omero.properties file and returns all the key/value
pairs that are found there which match the prefix "omero.client".
|
Map<String,String> |
getClientConfigValues()
retrieves configuration values like
getConfigValues(String)
but only those with the prefix "omero.client". |
Map<String,String> |
getConfigDefaults()
reads the etc/omero.properties file and returns all the key/value
pairs that are found there.
|
String |
getConfigValue(String key)
retrieve a configuration value from the backend store.
|
Map<String,String> |
getConfigValues(String keyRegex)
retrieves configuration values from the backend store which match the
given regex.
|
Date |
getDatabaseTime()
checks the database for its time using a SELECT statement.
|
String |
getDatabaseUuid()
Provides the UUID for this OMERO (database) instance.
|
Date |
getServerTime()
checks the current server for its 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. |
static final String VERSION_REGEX
Preference
will be parsed
into the form: Major.minor.patch for getVersion()
Date getServerTime()
Date
representation of the server's own time.Date getDatabaseTime() throws InternalException
Date
representation of the database's time.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 ApiUsageException, SecurityViolation
SecurityViolation
to be thrown.key
- The non-null name of the desired configuration valueString
value linked to this key, possibly null if not
set.ApiUsageException
- if the key is null or invalid.SecurityViolation
- if the value for the key is not readable.Map<String,String> getConfigValues(String keyRegex)
keyRegex
- The non-null regex of the desired configuration valuesMap
from the found keys to the linked values.Map<String,String> getConfigDefaults()
Map
from the found keys to the linked values.Map<String,String> getClientConfigValues()
getConfigValues(String)
but only those with the prefix "omero.client".Map
from the found keys to the linked values.Map<String,String> getClientConfigDefaults()
Map
from the found keys to the linked values.void setConfigValue(String key, String value) throws ApiUsageException, 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.ApiUsageException
- if the key is null or invalid.SecurityViolation
- if the value is not writable.boolean setConfigValueIfEquals(String key, String value, String test) throws ApiUsageException, 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
- test
- ApiUsageException
SecurityViolation
setConfigValue(String, String)
String getVersion()
getVersion()
VERSION_REGEX
String getDatabaseUuid()
Version: 5.3.3-ice35-b63
Copyright © 2017 The University of Dundee & Open Microscopy Environment. All Rights Reserved.