ome.logic
Class ConfigImpl

java.lang.Object
  extended by ome.logic.AbstractLevel2Service
      extended by ome.logic.ConfigImpl
All Implemented Interfaces:
IConfig, LocalConfig, ServiceInterface, SelfConfigurableService

@Transactional
public class ConfigImpl
extends AbstractLevel2Service
implements LocalConfig

implementation of the IConfig service interface. Also used as the main developer example for developing (stateless) ome.logic implementations. See source code documentation for more.

Since:
3.0-M3
Version:
$Revision$, $Date$
Author:
Josh Moore, josh.moore at gmx.de
See Also:
IConfig

Field Summary
 
Fields inherited from class ome.logic.AbstractLevel2Service
iQuery, iUpdate, metadata, queryFactory, sec
 
Fields inherited from interface ome.api.IConfig
VERSION_REGEX
 
Constructor Summary
ConfigImpl()
           
 
Method Summary
 String getConfigValue(String key)
          see IConfig.getConfigValue(String)
 Date getDatabaseTime()
          see IConfig.getDatabaseTime()
 String getDatabaseUuid()
          Provides the UUID for this OMERO (database) instance.
 String getDatabaseVersion()
          Retrieves the newest database patch.
 String getInternalValue(String key)
          Provides a configuration value, ignoring the visibility of the given value.
 Date getServerTime()
          see IConfig.getServerTime()
 Class<? extends ServiceInterface> getServiceInterface()
           
 String getVersion()
          see IConfig.getVersion()
 void setConfigValue(String key, String value)
          see IConfig.setConfigValue(String, String)
 boolean setConfigValueIfEquals(String key, String value, String test)
          see IConfig.setConfigValueIfEquals(String, String, String)
 void setCurrentDetails(CurrentDetails currentDetails)
          PreferenceContext setter for dependency injection.
 void setDatabaseIdentity(DatabaseIdentity db)
           
 void setPreferenceContext(PreferenceContext prefs)
          PreferenceContext setter for dependency injection.
 void setSqlAction(ome.util.SqlAction sql)
          SqlAction setter for dependency injection.
 
Methods inherited from class ome.logic.AbstractLevel2Service
getBeanHelper, getExtendedMetadata, getQueryFactory, getSecuritySystem, selfConfigure, setExtendedMetadata, setQueryFactory, setQueryService, setSecuritySystem, setUpdateService
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConfigImpl

public ConfigImpl()
Method Detail

setSqlAction

public final void setSqlAction(ome.util.SqlAction sql)
SqlAction setter for dependency injection.

Parameters:
sql -
See Also:
BeanHelper.throwIfAlreadySet(Object, Object)

setPreferenceContext

public final void setPreferenceContext(PreferenceContext prefs)
PreferenceContext setter for dependency injection.

Parameters:
prefs -
See Also:
BeanHelper.throwIfAlreadySet(Object, Object)

setCurrentDetails

public final void setCurrentDetails(CurrentDetails currentDetails)
PreferenceContext setter for dependency injection.

Parameters:
prefs -
See Also:
BeanHelper.throwIfAlreadySet(Object, Object)

setDatabaseIdentity

public final void setDatabaseIdentity(DatabaseIdentity db)

getServiceInterface

public final Class<? extends ServiceInterface> getServiceInterface()
Specified by:
getServiceInterface in interface SelfConfigurableService

getServerTime

public Date getServerTime()
see IConfig.getServerTime()

Specified by:
getServerTime in interface IConfig
Returns:
Non-null Date representation of the server's own time.

getDatabaseTime

public Date getDatabaseTime()
see IConfig.getDatabaseTime()

Specified by:
getDatabaseTime in interface IConfig
Returns:
Non-null Date representation of the database's time.

getConfigValue

public String getConfigValue(String key)
see IConfig.getConfigValue(String)

Specified by:
getConfigValue in interface IConfig
Parameters:
key - The non-null name of the desired configuration value
Returns:
The String value linked to this key, possibly null if not set.

getInternalValue

public String getInternalValue(String key)
Description copied from interface: LocalConfig
Provides a configuration value, ignoring the visibility of the given value.

Specified by:
getInternalValue in interface LocalConfig

setConfigValue

public void setConfigValue(String key,
                           String value)
see IConfig.setConfigValue(String, String)

Specified by:
setConfigValue in interface IConfig
Parameters:
key - The non-null name of the desired configuration value
value - The String value to assign to the given key.

setConfigValueIfEquals

public boolean setConfigValueIfEquals(String key,
                                      String value,
                                      String test)
                               throws ome.conditions.ApiUsageException,
                                      ome.conditions.SecurityViolation
see IConfig.setConfigValueIfEquals(String, String, String)

Specified by:
setConfigValueIfEquals in interface IConfig
Returns:
Throws:
ome.conditions.ApiUsageException
ome.conditions.SecurityViolation
See Also:
IConfig.setConfigValue(String, String)

getVersion

public String getVersion()
see IConfig.getVersion()

Specified by:
getVersion in interface IConfig
See Also:
IConfig.VERSION_REGEX

getDatabaseVersion

public String getDatabaseVersion()
Description copied from interface: LocalConfig
Retrieves the newest database patch. Also functions a simple DB ping.

Specified by:
getDatabaseVersion in interface LocalConfig

getDatabaseUuid

public String getDatabaseUuid()
Description copied from interface: IConfig
Provides the UUID for this OMERO (database) instance. To make imports and exports function properly, only one physical database should be active with a given instance UUID. All other copies of the database with that UUID are invalid as soon as one modification is made. This value is stored in the configuration table under the key "omero.db.uuid"

Specified by:
getDatabaseUuid in interface IConfig
Returns:
String not null.


OmeroJava Api

Version: 4.3.4-dbcbce5a-b4

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