public class XmlRegistry extends java.lang.Object implements Registry
Modifier and Type | Class and Description |
---|---|
static class |
XmlRegistry.DBEntry
The Class DBEntry.
|
static class |
XmlRegistry.HistoryEntry
The Class HistoryEntry.
|
Registry.KnownTags, Registry.ResourceType
Constructor and Description |
---|
XmlRegistry(java.lang.String pathToRegistryFile)
Instantiates a new xml registry.
|
XmlRegistry(SystemVariables systemVariables)
Instantiates a new xml registry.
|
Modifier and Type | Method and Description |
---|---|
void |
activate(AbsoluteCodingSchemeVersionReference codingScheme)
Activate a code system.
|
XmlRegistry.HistoryEntry |
addNewHistory(java.lang.String urn,
java.lang.String dbURL,
java.lang.String dbName,
java.lang.String tablePrefix)
Add a new history item to the registry.
|
void |
addNewItem(RegistryEntry entry)
Adds the new item.
|
void |
addNewItem(java.lang.String urn,
java.lang.String version,
java.lang.String status,
java.lang.String dbURL,
java.lang.String tag,
java.lang.String dbName,
java.lang.String tablePrefix)
Adds the new item.
|
boolean |
containsCodingSchemeEntry(AbsoluteCodingSchemeVersionReference codingScheme)
Contains coding scheme entry.
|
boolean |
containsNonCodingSchemeEntry(java.lang.String uri)
Contains non coding scheme entry.
|
void |
deactivate(XmlRegistry.DBEntry entry)
Deactivate.
|
java.util.List<RegistryEntry> |
getAllRegistryEntries()
Gets the all registry entries.
|
java.util.List<RegistryEntry> |
getAllRegistryEntriesOfType(Registry.ResourceType type)
Gets the all registry entries of type.
|
java.util.List<RegistryEntry> |
getAllRegistryEntriesOfTypeAndURI(Registry.ResourceType type,
java.lang.String uri)
Gets the all registry entries of type and URI.
|
java.util.List<RegistryEntry> |
getAllRegistryEntriesOfTypeURIAndVersion(Registry.ResourceType type,
java.lang.String uri,
java.lang.String version)
Gets the all registry entries of type, URI and version.
|
RegistryEntry |
getCodingSchemeEntry(AbsoluteCodingSchemeVersionReference codingScheme)
Gets the coding scheme entry.
|
javax.sql.DataSource |
getDataSource()
Gets the data source.
|
XmlRegistry.DBEntry |
getDBCodingSchemeEntry(AbsoluteCodingSchemeVersionReference codingScheme)
Gets the dB coding scheme entry.
|
XmlRegistry.DBEntry[] |
getDBEntries()
Gets the db entries.
|
java.util.Date |
getDeactivateDate(java.lang.String codingSchemeURN,
java.lang.String version)
Gets the deactivate date.
|
java.util.List<RegistryEntry> |
getEntriesForUri(java.lang.String uri)
Gets the entries for uri.
|
XmlRegistry.DBEntry |
getEntry(java.lang.String codingSchemeURN,
java.lang.String version)
Gets the entry.
|
XmlRegistry.HistoryEntry[] |
getHistoryEntries()
Gets the history entries.
|
XmlRegistry.HistoryEntry |
getHistoryEntry(java.lang.String urn)
Gets the history entry.
|
java.util.Date |
getLastUpdateDate(java.lang.String codingSchemeURN,
java.lang.String version)
Gets the last update date.
|
java.util.Date |
getLastUpdateTime()
Gets the last update time.
|
protected LgLoggerIF |
getLogger()
Gets the logger.
|
java.lang.String |
getNextDBIdentifier()
Gets the next db identifier.
|
java.lang.String |
getNextHistoryIdentifier()
Gets the next history identifier.
|
RegistryEntry |
getNonCodingSchemeEntry(java.lang.String uri)
Gets the non coding scheme entry.
|
protected java.io.File |
getRegistryFile()
Gets the registry file.
|
SQLConnectionInfo |
getSQLConnectionInfoForCodeSystem(AbsoluteCodingSchemeVersionReference codingSchemeVersion)
Gets the sQL connection info for code system.
|
SQLConnectionInfo[] |
getSQLConnectionInfoForHistory(java.lang.String urn)
Gets the sQL connection info for history.
|
CodingSchemeVersionStatus |
getStatus(java.lang.String codingSchemeURN,
java.lang.String version)
Gets the status.
|
protected java.lang.String |
getSupportedLexGridSchemaVersionForCodingScheme(AbsoluteCodingSchemeVersionReference ref)
Gets the supported lex grid schema version for coding scheme.
|
protected java.lang.String |
getSupportedLexGridSchemaVersionForHistory(java.lang.String uri)
Gets the supported lex grid schema version for history.
|
java.lang.String |
getTag(java.lang.String codingSchemeURN,
java.lang.String version)
Gets the tag.
|
java.lang.String |
getVersionForTag(java.lang.String urn,
java.lang.String tag)
Gets the version for tag.
|
boolean |
isActive(java.lang.String codingSchemeURN,
java.lang.String version)
Checks if is active.
|
void |
remove(AbsoluteCodingSchemeVersionReference codingSchemeVersion)
Removes the.
|
void |
removeEntry(RegistryEntry entry)
Removes the entry.
|
void |
removeHistoryEntry(java.lang.String urn)
Removes the history entry.
|
void |
setDataSource(javax.sql.DataSource dataSource)
Sets the data source.
|
void |
setDeactivateDate(AbsoluteCodingSchemeVersionReference acsvr,
java.util.Date date)
Sets the deactivate date.
|
void |
setDeactivateDateInternal(AbsoluteCodingSchemeVersionReference acsvr,
java.util.Date date)
Sets the deactivate date internal.
|
void |
setStatusPending(XmlRegistry.DBEntry entry)
Sets the status pending.
|
void |
updateCodingSchemeEntryTag(AbsoluteCodingSchemeVersionReference codingScheme,
java.lang.String newTag)
Update coding scheme entry tag.
|
void |
updateEntry(RegistryEntry entry)
Update entry.
|
void |
updateTag(AbsoluteCodingSchemeVersionReference codingScheme,
java.lang.String newTag)
Update tag.
|
void |
updateURNVersion(AbsoluteCodingSchemeVersionReference oldURNVerison,
AbsoluteCodingSchemeVersionReference newURNVerison)
Activate a code system.
|
void |
updateVersion(AbsoluteCodingSchemeVersionReference codingScheme,
java.lang.String newVersion)
Update version.
|
public XmlRegistry(SystemVariables systemVariables) throws java.lang.Exception
systemVariables
- the system variablesjava.lang.Exception
- the exceptionpublic XmlRegistry(java.lang.String pathToRegistryFile) throws java.lang.Exception
pathToRegistryFile
- the path to registry filejava.lang.Exception
- the exceptionprotected LgLoggerIF getLogger()
protected java.io.File getRegistryFile()
public CodingSchemeVersionStatus getStatus(java.lang.String codingSchemeURN, java.lang.String version)
codingSchemeURN
- the coding scheme urnversion
- the versionpublic boolean isActive(java.lang.String codingSchemeURN, java.lang.String version)
codingSchemeURN
- the coding scheme urnversion
- the versionpublic SQLConnectionInfo getSQLConnectionInfoForCodeSystem(AbsoluteCodingSchemeVersionReference codingSchemeVersion)
codingSchemeVersion
- the coding scheme versionpublic SQLConnectionInfo[] getSQLConnectionInfoForHistory(java.lang.String urn)
urn
- the urnpublic java.lang.String getTag(java.lang.String codingSchemeURN, java.lang.String version)
codingSchemeURN
- the coding scheme urnversion
- the versionpublic java.util.Date getDeactivateDate(java.lang.String codingSchemeURN, java.lang.String version)
codingSchemeURN
- the coding scheme urnversion
- the versionpublic void setDeactivateDate(AbsoluteCodingSchemeVersionReference acsvr, java.util.Date date) throws LBParameterException, LBInvocationException
acsvr
- the acsvrdate
- the dateLBParameterException
- the LB parameter exceptionLBInvocationException
- the LB invocation exceptionpublic void setDeactivateDateInternal(AbsoluteCodingSchemeVersionReference acsvr, java.util.Date date) throws LBParameterException, LBInvocationException
acsvr
- the acsvrdate
- the dateLBParameterException
- the LB parameter exceptionLBInvocationException
- the LB invocation exceptionpublic java.util.Date getLastUpdateDate(java.lang.String codingSchemeURN, java.lang.String version)
codingSchemeURN
- the coding scheme urnversion
- the versionpublic void deactivate(XmlRegistry.DBEntry entry) throws LBInvocationException, LBParameterException
entry
- the entryLBInvocationException
- the LB invocation exceptionLBParameterException
- the LB parameter exceptionpublic void setStatusPending(XmlRegistry.DBEntry entry) throws LBInvocationException, LBParameterException
entry
- the new status pendingLBInvocationException
- the LB invocation exceptionLBParameterException
- the LB parameter exceptionpublic void activate(AbsoluteCodingSchemeVersionReference codingScheme) throws LBInvocationException, LBParameterException
codingScheme
- the coding schemeLBInvocationException
- the LB invocation exceptionLBParameterException
- the LB parameter exceptionpublic void updateTag(AbsoluteCodingSchemeVersionReference codingScheme, java.lang.String newTag) throws LBInvocationException, LBParameterException
codingScheme
- the coding schemenewTag
- the new tagLBInvocationException
- the LB invocation exceptionLBParameterException
- the LB parameter exceptionpublic void updateVersion(AbsoluteCodingSchemeVersionReference codingScheme, java.lang.String newVersion) throws LBInvocationException, LBParameterException
codingScheme
- the coding schemenewVersion
- the new versionLBInvocationException
- the LB invocation exceptionLBParameterException
- the LB parameter exceptionpublic XmlRegistry.DBEntry getEntry(java.lang.String codingSchemeURN, java.lang.String version) throws LBParameterException
codingSchemeURN
- the coding scheme urnversion
- the versionLBParameterException
- the LB parameter exceptionpublic XmlRegistry.DBEntry getDBCodingSchemeEntry(AbsoluteCodingSchemeVersionReference codingScheme) throws LBParameterException
codingScheme
- the coding schemeLBParameterException
- the LB parameter exceptionpublic void addNewItem(java.lang.String urn, java.lang.String version, java.lang.String status, java.lang.String dbURL, java.lang.String tag, java.lang.String dbName, java.lang.String tablePrefix) throws java.lang.Exception
urn
- the urnversion
- the versionstatus
- the statusdbURL
- the db urltag
- the tagdbName
- the db nametablePrefix
- the table prefixjava.lang.Exception
- the exceptionpublic XmlRegistry.HistoryEntry addNewHistory(java.lang.String urn, java.lang.String dbURL, java.lang.String dbName, java.lang.String tablePrefix) throws java.lang.Exception
urn
- the urndbURL
- the db urldbName
- the db nametablePrefix
- the table prefixjava.lang.Exception
- the exceptionpublic java.lang.String getVersionForTag(java.lang.String urn, java.lang.String tag)
urn
- the urntag
- the tagpublic XmlRegistry.DBEntry[] getDBEntries()
public XmlRegistry.HistoryEntry[] getHistoryEntries()
public java.util.Date getLastUpdateTime()
getLastUpdateTime
in interface Registry
public void remove(AbsoluteCodingSchemeVersionReference codingSchemeVersion) throws InternalException, LBInvocationException, LBParameterException
codingSchemeVersion
- the coding scheme versionInternalException
- the internal exceptionLBInvocationException
- the LB invocation exceptionLBParameterException
- the LB parameter exceptionpublic XmlRegistry.HistoryEntry getHistoryEntry(java.lang.String urn) throws LBParameterException
urn
- the urnLBParameterException
- the LB parameter exceptionpublic void removeHistoryEntry(java.lang.String urn) throws InternalException, LBInvocationException, LBParameterException
urn
- the urnInternalException
- the internal exceptionLBInvocationException
- the LB invocation exceptionLBParameterException
- the LB parameter exceptionpublic java.lang.String getNextDBIdentifier() throws LBInvocationException
getNextDBIdentifier
in interface Registry
LBInvocationException
- the LB invocation exceptionUnexpectedInternalError
public java.lang.String getNextHistoryIdentifier() throws LBInvocationException
getNextHistoryIdentifier
in interface Registry
LBInvocationException
- the LB invocation exceptionUnexpectedInternalError
public void updateURNVersion(AbsoluteCodingSchemeVersionReference oldURNVerison, AbsoluteCodingSchemeVersionReference newURNVerison) throws LBInvocationException, LBParameterException
oldURNVerison
- the old urn verisonnewURNVerison
- the new urn verisonLBInvocationException
- the LB invocation exceptionLBParameterException
- the LB parameter exceptionpublic void addNewItem(RegistryEntry entry) throws java.lang.Exception
Registry
addNewItem
in interface Registry
entry
- the entryjava.lang.Exception
- the exceptionpublic java.util.List<RegistryEntry> getAllRegistryEntries()
Registry
getAllRegistryEntries
in interface Registry
public java.util.List<RegistryEntry> getAllRegistryEntriesOfType(Registry.ResourceType type)
Registry
getAllRegistryEntriesOfType
in interface Registry
type
- the typepublic java.util.List<RegistryEntry> getAllRegistryEntriesOfTypeAndURI(Registry.ResourceType type, java.lang.String uri)
Registry
getAllRegistryEntriesOfTypeAndURI
in interface Registry
type
- the resource typeuri
- the resource uripublic java.util.List<RegistryEntry> getAllRegistryEntriesOfTypeURIAndVersion(Registry.ResourceType type, java.lang.String uri, java.lang.String version)
Registry
getAllRegistryEntriesOfTypeURIAndVersion
in interface Registry
type
- the resource typeuri
- the resource uriversion
- the verionpublic java.util.List<RegistryEntry> getEntriesForUri(java.lang.String uri) throws LBParameterException
Registry
getEntriesForUri
in interface Registry
uri
- the uriLBParameterException
- the LB parameter exceptionpublic RegistryEntry getNonCodingSchemeEntry(java.lang.String uri) throws LBParameterException
Registry
getNonCodingSchemeEntry
in interface Registry
uri
- the uriLBParameterException
- the LB parameter exceptionpublic boolean containsCodingSchemeEntry(AbsoluteCodingSchemeVersionReference codingScheme)
Registry
containsCodingSchemeEntry
in interface Registry
codingScheme
- the coding schemepublic RegistryEntry getCodingSchemeEntry(AbsoluteCodingSchemeVersionReference codingScheme) throws LBParameterException
Registry
getCodingSchemeEntry
in interface Registry
codingScheme
- the coding schemeLBParameterException
- the LB parameter exceptionpublic void removeEntry(RegistryEntry entry) throws LBParameterException
Registry
removeEntry
in interface Registry
entry
- the entryLBParameterException
- the LB parameter exceptionpublic void updateEntry(RegistryEntry entry)
Registry
updateEntry
in interface Registry
entry
- the entrypublic boolean containsNonCodingSchemeEntry(java.lang.String uri)
Registry
containsNonCodingSchemeEntry
in interface Registry
uri
- the uriprotected java.lang.String getSupportedLexGridSchemaVersionForCodingScheme(AbsoluteCodingSchemeVersionReference ref) throws LBInvocationException
ref
- the refLBInvocationException
- the LB invocation exceptionprotected java.lang.String getSupportedLexGridSchemaVersionForHistory(java.lang.String uri) throws LBInvocationException
uri
- the uriLBInvocationException
- the LB invocation exceptionpublic javax.sql.DataSource getDataSource()
public void setDataSource(javax.sql.DataSource dataSource)
dataSource
- the new data sourcepublic void updateCodingSchemeEntryTag(AbsoluteCodingSchemeVersionReference codingScheme, java.lang.String newTag) throws LBParameterException
codingScheme
- the coding schemenewTag
- the new tagLBParameterException
- the LB parameter exception