org.LexGrid.LexBIG.caCore.connection.orm.utils
Class DBConnector

java.lang.Object
  extended by org.LexGrid.LexBIG.caCore.connection.orm.utils.DBConnector

public class DBConnector
extends Object

The junction point between the LexEVSAPI and the local LexBIG installation. Used to obtain information about the loaded vocabularies and their Database Connection information.

Author:
Kevin Peterson

Field Summary
private  org.LexGrid.LexBIG.Impl.helpers.SQLConnectionInfo[] codingSchemeConnections
           
private  org.LexGrid.LexBIG.DataModel.InterfaceElements.CodingSchemeRendering[] csr
           
private  org.LexGrid.LexBIG.Impl.helpers.SQLConnectionInfo[] historyConnections
           
private static String LEXBIG_SYSPROPERTY
          The Constant LEXBIG_SYSPROPERTY.
private static org.apache.log4j.Logger log
           
private  org.LexGrid.LexBIG.Impl.dataAccess.ResourceManager rm
           
 
Constructor Summary
DBConnector(org.LexGrid.LexBIG.caCore.security.properties.LexEVSProperties properties)
          Create a connection to a local LexBIG installation, given a set of properties.
 
Method Summary
 org.LexGrid.LexBIG.Impl.helpers.SQLConnectionInfo[] getCodingSchemeConnections()
           
 org.LexGrid.LexBIG.DataModel.InterfaceElements.CodingSchemeRendering getCodingSchemeRenderingForURIAndVersion(String uri, String version)
          Gets the Complete CodingSchemeRendering of a CodingScheme.
 org.LexGrid.LexBIG.DataModel.InterfaceElements.CodingSchemeRendering[] getCodingSchemeRenderings()
           
private  org.LexGrid.LexBIG.Impl.helpers.SQLConnectionInfo[] getDBCodingSchemeConnectionInfoFromLexBIG(org.LexGrid.LexBIG.DataModel.InterfaceElements.CodingSchemeRendering[] csr)
           
private  org.LexGrid.LexBIG.Impl.helpers.SQLConnectionInfo[] getDBHistoryConnectionInfoFromLexBIG(org.LexGrid.LexBIG.DataModel.InterfaceElements.CodingSchemeRendering[] csr)
           
 org.LexGrid.LexBIG.Impl.helpers.SQLConnectionInfo[] getHistoryConnections()
           
private  String getInternalVersionString(String codingSchemeName, org.LexGrid.LexBIG.DataModel.Core.CodingSchemeVersionOrTag tagOrVersion)
           
 String getLocalDBNameForURIAndVersion(String uri, String version)
          Gets the local DB name (in other words, the name that this Coding Scheme uses to identify itself in the database).
 org.LexGrid.LexBIG.DataModel.Collections.CodingSchemeTagList getTagList(String uri, String version)
          Returns the list of Tags associated with this Coding Scheme
private  HashSet<String> getUniqueURIs(org.LexGrid.LexBIG.DataModel.InterfaceElements.CodingSchemeRendering[] csr)
           
 String getURIFromCodingSchemeName(String codingSchemeName, org.LexGrid.LexBIG.DataModel.Core.CodingSchemeVersionOrTag tagOrVersion)
          Returns the URI of the CodingScheme given a local name.
 boolean isCodingSchemeActive(String name, org.LexGrid.LexBIG.DataModel.Core.CodingSchemeVersionOrTag csvt)
          Determines whether or not the requested Coding Scheme is active in the system.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private static org.apache.log4j.Logger log

LEXBIG_SYSPROPERTY

private static final String LEXBIG_SYSPROPERTY
The Constant LEXBIG_SYSPROPERTY.

See Also:
Constant Field Values

codingSchemeConnections

private org.LexGrid.LexBIG.Impl.helpers.SQLConnectionInfo[] codingSchemeConnections

historyConnections

private org.LexGrid.LexBIG.Impl.helpers.SQLConnectionInfo[] historyConnections

rm

private org.LexGrid.LexBIG.Impl.dataAccess.ResourceManager rm

csr

private org.LexGrid.LexBIG.DataModel.InterfaceElements.CodingSchemeRendering[] csr
Constructor Detail

DBConnector

public DBConnector(org.LexGrid.LexBIG.caCore.security.properties.LexEVSProperties properties)
Create a connection to a local LexBIG installation, given a set of properties.

Parameters:
properties - LexEVSProperties used to establish a connection to the local LexBIG installation
Method Detail

isCodingSchemeActive

public boolean isCodingSchemeActive(String name,
                                    org.LexGrid.LexBIG.DataModel.Core.CodingSchemeVersionOrTag csvt)
                             throws org.LexGrid.LexBIG.Exceptions.LBParameterException
Determines whether or not the requested Coding Scheme is active in the system.

Parameters:
name - Local Name of the Coding Scheme
csvt - Version or Tag information
Returns:
true if active, false if inactive
Throws:
org.LexGrid.LexBIG.Exceptions.LBParameterException

getDBCodingSchemeConnectionInfoFromLexBIG

private org.LexGrid.LexBIG.Impl.helpers.SQLConnectionInfo[] getDBCodingSchemeConnectionInfoFromLexBIG(org.LexGrid.LexBIG.DataModel.InterfaceElements.CodingSchemeRendering[] csr)
                                                                                               throws org.LexGrid.LexBIG.Exceptions.LBInvocationException
Throws:
org.LexGrid.LexBIG.Exceptions.LBInvocationException

getDBHistoryConnectionInfoFromLexBIG

private org.LexGrid.LexBIG.Impl.helpers.SQLConnectionInfo[] getDBHistoryConnectionInfoFromLexBIG(org.LexGrid.LexBIG.DataModel.InterfaceElements.CodingSchemeRendering[] csr)
                                                                                          throws org.LexGrid.LexBIG.Exceptions.LBInvocationException
Throws:
org.LexGrid.LexBIG.Exceptions.LBInvocationException

getUniqueURIs

private HashSet<String> getUniqueURIs(org.LexGrid.LexBIG.DataModel.InterfaceElements.CodingSchemeRendering[] csr)

getTagList

public org.LexGrid.LexBIG.DataModel.Collections.CodingSchemeTagList getTagList(String uri,
                                                                               String version)
                                                                        throws Exception
Returns the list of Tags associated with this Coding Scheme

Parameters:
uri - URI of the Coding Scheme
version - Version of the Coding Scheme
Returns:
List of Tags associated with this Coding Scheme
Throws:
Exception

getURIFromCodingSchemeName

public String getURIFromCodingSchemeName(String codingSchemeName,
                                         org.LexGrid.LexBIG.DataModel.Core.CodingSchemeVersionOrTag tagOrVersion)
                                  throws org.LexGrid.LexBIG.Exceptions.LBParameterException
Returns the URI of the CodingScheme given a local name.

Parameters:
codingSchemeName - Local Name of the Coding Scheme
tagOrVersion - Version or Tag information
Returns:
URI of the CodingScheme
Throws:
org.LexGrid.LexBIG.Exceptions.LBParameterException

getInternalVersionString

private String getInternalVersionString(String codingSchemeName,
                                        org.LexGrid.LexBIG.DataModel.Core.CodingSchemeVersionOrTag tagOrVersion)
                                 throws org.LexGrid.LexBIG.Exceptions.LBParameterException
Throws:
org.LexGrid.LexBIG.Exceptions.LBParameterException

getCodingSchemeRenderingForURIAndVersion

public org.LexGrid.LexBIG.DataModel.InterfaceElements.CodingSchemeRendering getCodingSchemeRenderingForURIAndVersion(String uri,
                                                                                                                     String version)
                                                                                                              throws org.LexGrid.LexBIG.Exceptions.LBParameterException
Gets the Complete CodingSchemeRendering of a CodingScheme.

Parameters:
uri - URI of the Coding Scheme
version - Version of the Coding Scheme
Returns:
the CodingSchemeRendering
Throws:
org.LexGrid.LexBIG.Exceptions.LBParameterException

getLocalDBNameForURIAndVersion

public String getLocalDBNameForURIAndVersion(String uri,
                                             String version)
                                      throws org.LexGrid.LexBIG.Exceptions.LBParameterException
Gets the local DB name (in other words, the name that this Coding Scheme uses to identify itself in the database).

Parameters:
uri - URI of the Coding Scheme
version - Version of the Coding Scheme
Returns:
the Local DB name
Throws:
org.LexGrid.LexBIG.Exceptions.LBParameterException

getCodingSchemeRenderings

public org.LexGrid.LexBIG.DataModel.InterfaceElements.CodingSchemeRendering[] getCodingSchemeRenderings()

getCodingSchemeConnections

public org.LexGrid.LexBIG.Impl.helpers.SQLConnectionInfo[] getCodingSchemeConnections()

getHistoryConnections

public org.LexGrid.LexBIG.Impl.helpers.SQLConnectionInfo[] getHistoryConnections()