com.softwareag.tamino.db.api.common
Class TDatabaseVersionCache

java.lang.Object
  extended by com.softwareag.tamino.db.api.common.TDatabaseVersionCache

public class TDatabaseVersionCache
extends java.lang.Object

The TDatabaseVersionCache keeps track of all connected databases and their versions. The cache will be filled while the whole lifetime of the JVM.

Version:
$Revision: 1.3 $
Author:
Stefan Liebig

Method Summary
 void clear()
          Clear the cache.
 java.lang.String fetchVersion(TUri databaseUri)
          Get the version from the given database uri.
static TDatabaseVersionCache getInstance()
          Get the TDatabaseVersionCache singleton instance.
 java.lang.String getVersion(TUri databaseUri)
          Get the version from the given database uri.
 void update(TUri databaseUri, java.lang.String version)
          Update the cache.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static TDatabaseVersionCache getInstance()
Get the TDatabaseVersionCache singleton instance.

Returns:
the singleton

update

public void update(TUri databaseUri,
                   java.lang.String version)
Update the cache. This method is called from the API internally to update the Tamino version. An empty (null, "") version will not be inserted/updated.

Parameters:
databaseUri - the database uri
version - the version string

getVersion

public java.lang.String getVersion(TUri databaseUri)
Get the version from the given database uri. If no version is available for the given database uri in the cache an empty string will be returned.

Parameters:
databaseUri - the database uri string
Returns:
version the version string

fetchVersion

public java.lang.String fetchVersion(TUri databaseUri)
Get the version from the given database uri. If no version is available for the given database uri in the cache a Tamino diagnose command will be tried. An empty string will be returned if no version information can be fetched.

Parameters:
databaseUri - the database uri string
Returns:
version the version string

clear

public void clear()
Clear the cache.



Copyright (c) 2013 Software AG. All Rights Reserved.