org.LexGrid.LexBIG.Impl.loaders
Class MetaDataLoaderImpl

java.lang.Object
  extended by org.LexGrid.LexBIG.Impl.Extensions.AbstractExtendable
      extended by org.LexGrid.LexBIG.Impl.loaders.BaseLoader
          extended by org.LexGrid.LexBIG.Impl.loaders.MetaDataLoaderImpl
All Implemented Interfaces:
java.io.Serializable, Extendable, Loader, MetaData_Loader, StatusReporter

public class MetaDataLoaderImpl
extends BaseLoader
implements MetaData_Loader

Class to load OBO files.

Version:
subversion $Revision: $ checked in on $Date: $
Author:
Dan Armbrust
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.LexGrid.LexBIG.Impl.loaders.BaseLoader
BaseLoader.DoConversion
 
Field Summary
 
Fields inherited from class org.LexGrid.LexBIG.Impl.loaders.BaseLoader
ASYNC_OPTION, FAIL_ON_ERROR_OPTION, inUse, LOADER_POST_PROCESSOR_OPTION, LOADER_PREFERENCE_FILE_OPTION, MANIFEST_FILE_OPTION, SUPPLEMENT_OPTION
 
Fields inherited from interface org.LexGrid.LexBIG.Extensions.Load.MetaData_Loader
description, name
 
Constructor Summary
MetaDataLoaderImpl()
           
 
Method Summary
protected  ExtensionDescription buildExtensionDescription()
          Builds the extension description.
protected  OptionHolder declareAllowedOptions(OptionHolder holder)
           
protected  URNVersionPair[] doLoad()
           
 void loadAuxiliaryData(java.util.Map<java.lang.Object,java.lang.Object> source, AbsoluteCodingSchemeVersionReference codingSchemeVersion, boolean overwrite, boolean stopOnErrors, boolean async)
          Load auxiliary (non-LexGrid) metadata from the given map into a searchable metadata index within the LexBIG system.
 void loadAuxiliaryData(java.net.URI source, AbsoluteCodingSchemeVersionReference codingSchemeVersion, boolean overwrite, boolean stopOnErrors, boolean async)
          Load auxiliary (non-LexGrid) metadata from the specified XML file into a searchable metadata index within the LexBIG system.
 void loadLexGridManifest(CodingSchemeManifest source, AbsoluteCodingSchemeVersionReference codingSchemeURNVersion, boolean stopOnErrors, boolean async)
          Loads metadata specified by the given manifest to a previously loaded coding scheme in the LexBIG repository.
 void loadLexGridManifest(java.net.URI source, AbsoluteCodingSchemeVersionReference codingSchemeURNVersion, boolean stopOnErrors, boolean async)
          Loads metadata specified by the given manifest to a previously loaded coding scheme in the LexBIG repository.
 void validateAuxiliaryData(java.net.URI source, AbsoluteCodingSchemeVersionReference codingSchemeVersion, int validationLevel)
          Validate content for a candidate resource without performing a load.
 void validateLexGridManifest(java.net.URI source, AbsoluteCodingSchemeVersionReference codingSchemeVersion, int validationLevel)
          Validate content for a candidate resource without performing a load.
 
Methods inherited from class org.LexGrid.LexBIG.Impl.loaders.BaseLoader
addBooleanOptionValue, baseLoad, buildRootNode, clearLog, constructVersionPairsFromCodingSchemes, createCachingMessageDirectorIF, createDefaultInserter, createDefaultInserter, doesOptionExist, doIndex, doPostProcessing, doTransitiveAndIndex, doTransitiveTable, getAbsoluteCodingSchemeVersionReferenceFromOptionString, getCodingSchemeManifest, getCodingSchemeManifestURI, getCodingSchemeReferences, getDescription, getLoaderPreferences, getLog, getLogger, getManifestUtil, getMessageDirector, getName, getOntologyFormat, getOptions, getPostProcessor, getProvider, getResourceUri, getStatus, getStringFromURI, getVersion, isDoApplyPostLoadManifest, isDoComputeTransitiveClosure, isDoIndexing, isDoRegister, isDoRemoveOnFailure, isInUse, load, lock, persistCodingSchemeToDatabase, persistCodingSchemeToDatabase, register, register, setCachingMessageDirectorIF, setCodingSchemeManifest, setCodingSchemeManifestURI, setCodingSchemeReferences, setDoApplyPostLoadManifest, setDoComputeTransitiveClosure, setDoIndexing, setDoRegister, setDoRemoveOnFailure, setInUse, setLoaderPreferences, setLoaderPreferences, setManifestUtil, setOptions, setResourceUri, setStatus, unlock, urnVersionPairToAbsoluteCodingSchemeVersionReference
 
Methods inherited from class org.LexGrid.LexBIG.Impl.Extensions.AbstractExtendable
getExtensionDescription
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.LexGrid.LexBIG.Extensions.Load.Loader
clearLog, getCodingSchemeManifest, getCodingSchemeManifestURI, getCodingSchemeReferences, getLoaderPreferences, getLog, getOntologyFormat, getOptions, getStatus, load, setCodingSchemeManifest, setCodingSchemeManifestURI, setLoaderPreferences, setLoaderPreferences
 
Methods inherited from interface org.LexGrid.LexBIG.Extensions.Extendable
getDescription, getName, getProvider, getVersion
 

Constructor Detail

MetaDataLoaderImpl

public MetaDataLoaderImpl()
Method Detail

buildExtensionDescription

protected ExtensionDescription buildExtensionDescription()
Description copied from class: AbstractExtendable
Builds the extension description.

Specified by:
buildExtensionDescription in class AbstractExtendable
Returns:
the extension description

validateAuxiliaryData

public void validateAuxiliaryData(java.net.URI source,
                                  AbsoluteCodingSchemeVersionReference codingSchemeVersion,
                                  int validationLevel)
                           throws LBParameterException
Description copied from interface: MetaData_Loader
Validate content for a candidate resource without performing a load. Returns without exception if validation succeeds.

Specified by:
validateAuxiliaryData in interface MetaData_Loader
Parameters:
source - URI of the XML-based auxiliary metadata file to check.
codingSchemeVersion - The target coding scheme name and version.
validationLevel - Supported levels of validation include: 0 = Verify the XML is well formed.
Throws:
LBParameterException

loadAuxiliaryData

public void loadAuxiliaryData(java.net.URI source,
                              AbsoluteCodingSchemeVersionReference codingSchemeVersion,
                              boolean overwrite,
                              boolean stopOnErrors,
                              boolean async)
                       throws LBParameterException,
                              LBInvocationException
Description copied from interface: MetaData_Loader
Load auxiliary (non-LexGrid) metadata from the specified XML file into a searchable metadata index within the LexBIG system. All tags and values are interpreted as simple text-based key/value pairs.

Specified by:
loadAuxiliaryData in interface MetaData_Loader
Parameters:
source - URI of the XML file containing custom metadata.
codingSchemeVersion - The target coding scheme name and version.
overwrite - If true, existing metadata for the scheme will be erased. If false, new metadata will be appended to existing metadata.
stopOnErrors - True means stop if any load error is detected. False means attempt to load what can be loaded if recoverable errors are encountered.
async - Flag controlling whether load occurs in the calling thread. If true, the load will occur in a separate asynchronous process. If false, this method blocks until the load operation completes or fails. Regardless of setting, the getStatus and getLog calls are used to fetch results.
Throws:
LBParameterException
LBInvocationException

loadAuxiliaryData

public void loadAuxiliaryData(java.util.Map<java.lang.Object,java.lang.Object> source,
                              AbsoluteCodingSchemeVersionReference codingSchemeVersion,
                              boolean overwrite,
                              boolean stopOnErrors,
                              boolean async)
                       throws LBException
Description copied from interface: MetaData_Loader
Load auxiliary (non-LexGrid) metadata from the given map into a searchable metadata index within the LexBIG system. All map keys and values are interpreted as simple text.

Specified by:
loadAuxiliaryData in interface MetaData_Loader
Parameters:
source - Map defining custom metadata. All keys and values are evaluated as strings when inserted to the index.
codingSchemeVersion - The target coding scheme name and version.
overwrite - If true, existing metadata for the scheme will be erased. If false, new metadata will be appended to existing metadata.
stopOnErrors - True means stop if any load error is detected. False means attempt to load what can be loaded if recoverable errors are encountered.
async - Flag controlling whether load occurs in the calling thread. If true, the load will occur in a separate asynchronous process. If false, this method blocks until the load operation completes or fails. Regardless of setting, the getStatus and getLog calls are used to fetch results.
Throws:
LBException - If resources cannot be accessed or another load operation is already in progress.

loadLexGridManifest

public void loadLexGridManifest(CodingSchemeManifest source,
                                AbsoluteCodingSchemeVersionReference codingSchemeURNVersion,
                                boolean stopOnErrors,
                                boolean async)
                         throws LBException
Description copied from interface: MetaData_Loader
Loads metadata specified by the given manifest to a previously loaded coding scheme in the LexBIG repository.

Specified by:
loadLexGridManifest in interface MetaData_Loader
Parameters:
source - The manifest to apply.
codingSchemeURNVersion - The target coding scheme name and version.
stopOnErrors - True means stop if any load error is detected. False means attempt to load what can be loaded if recoverable errors are encountered.
async - Flag controlling whether load occurs in the calling thread. If true, the load will occur in a separate asynchronous process. If false, this method blocks until the load operation completes or fails. Regardless of setting, the getStatus and getLog calls are used to fetch results.
Throws:
LBException - If resources cannot be accessed or another load operation is already in progress.

loadLexGridManifest

public void loadLexGridManifest(java.net.URI source,
                                AbsoluteCodingSchemeVersionReference codingSchemeURNVersion,
                                boolean stopOnErrors,
                                boolean async)
                         throws LBException
Description copied from interface: MetaData_Loader
Loads metadata specified by the given manifest to a previously loaded coding scheme in the LexBIG repository.

Specified by:
loadLexGridManifest in interface MetaData_Loader
Parameters:
source - URI of the xml file containing the manifest definition.
codingSchemeURNVersion - The target coding scheme name and version.
stopOnErrors - True means stop if any load error is detected. False means attempt to load what can be loaded if recoverable errors are encountered.
async - Flag controlling whether load occurs in the calling thread. If true, the load will occur in a separate asynchronous process. If false, this method blocks until the load operation completes or fails. Regardless of setting, the getStatus and getLog calls are used to fetch results.
Throws:
LBException - If resources cannot be accessed or another load operation is already in progress.

validateLexGridManifest

public void validateLexGridManifest(java.net.URI source,
                                    AbsoluteCodingSchemeVersionReference codingSchemeVersion,
                                    int validationLevel)
                             throws LBException
Description copied from interface: MetaData_Loader
Validate content for a candidate resource without performing a load. Returns without exception if validation succeeds.

Specified by:
validateLexGridManifest in interface MetaData_Loader
Parameters:
source - URI of the XML-based manifest file to check.
codingSchemeVersion - The target coding scheme name and version.
validationLevel - Supported levels of validation include: 0 = Verify the XML is well formed. 1 = Verify the XML is valid in context of the LexGrid Manifest Schema.
Throws:
LBException

declareAllowedOptions

protected OptionHolder declareAllowedOptions(OptionHolder holder)
Specified by:
declareAllowedOptions in class BaseLoader

doLoad

protected URNVersionPair[] doLoad()
                           throws CodingSchemeAlreadyLoadedException
Specified by:
doLoad in class BaseLoader
Throws:
CodingSchemeAlreadyLoadedException

Copyright: (c) 2004-2006 Mayo Foundation for Medical Education and Research (MFMER). All rights reserved. MAYO, MAYO CLINIC, and the triple-shield Mayo logo are trademarks and service marks of MFMER.