Class DefaultSchemasLoader
- java.lang.Object
-
- com.marklogic.client.ext.helper.LoggingObject
-
- com.marklogic.client.ext.file.GenericFileLoader
-
- com.marklogic.client.ext.schemasloader.impl.DefaultSchemasLoader
-
- All Implemented Interfaces:
FileLoader,SchemasLoader
public class DefaultSchemasLoader extends GenericFileLoader implements SchemasLoader
-
-
Field Summary
-
Fields inherited from class com.marklogic.client.ext.helper.LoggingObject
logger
-
-
Constructor Summary
Constructors Constructor Description DefaultSchemasLoader(com.marklogic.client.DatabaseClient schemasDatabaseClient)Simplest constructor for using this class.DefaultSchemasLoader(com.marklogic.client.DatabaseClient schemasDatabaseClient, java.lang.String tdeValidationDatabase)If you want to validate TDE templates before they're loaded, you need to provide a second DatabaseClient that connects to the content database associated with the schemas database that schemas will be loaded into.DefaultSchemasLoader(BatchWriter batchWriter)Assumes that the BatchWriter has already been initialized.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetTdeValidationDatabase()protected voidinitializeDefaultSchemasLoader()Adds the DocumentFileProcessors and FileFilters specific to loading schemas, which will then be used to construct a DocumentFileReader by the parent class.java.util.List<DocumentFile>loadSchemas(java.lang.String... paths)Run the given paths through the DocumentFileReader, and then send the result to the BatchWriter, and then return the result.voidsetTdeValidationDatabase(java.lang.String tdeValidationDatabase)-
Methods inherited from class com.marklogic.client.ext.file.GenericFileLoader
addDocumentFileProcessor, addFileFilter, applyTokenReplacerOnKnownDocumentProcessors, buildDocumentFileProcessors, getBatchWriter, getDocumentFileProcessors, getDocumentFileReader, getDocumentFiles, getFileFilters, getTokenReplacer, initializeDocumentFileReader, isLogFileUris, loadFiles, prepareAbstractDocumentFileReader, setAdditionalBinaryExtensions, setBatchSize, setBatchWriter, setCollections, setDocumentFileProcessors, setDocumentFileReader, setFileFilters, setLogFileUris, setPermissions, setTokenReplacer, setWaitForCompletion, writeBatchOfDocuments, writeDocumentFiles
-
Methods inherited from class com.marklogic.client.ext.helper.LoggingObject
format
-
-
-
-
Constructor Detail
-
DefaultSchemasLoader
public DefaultSchemasLoader(com.marklogic.client.DatabaseClient schemasDatabaseClient)
Simplest constructor for using this class. Just provide a DatabaseClient, and this will use sensible defaults for how documents are read and written. Note that the DatabaseClient will not be released after this class is done with it, as this class wasn't the one that created it.- Parameters:
schemasDatabaseClient-
-
DefaultSchemasLoader
public DefaultSchemasLoader(com.marklogic.client.DatabaseClient schemasDatabaseClient, java.lang.String tdeValidationDatabase)If you want to validate TDE templates before they're loaded, you need to provide a second DatabaseClient that connects to the content database associated with the schemas database that schemas will be loaded into. This is because the "tde.validate" function must run against the content database.- Parameters:
schemasDatabaseClient-tdeValidationDatabase-
-
DefaultSchemasLoader
public DefaultSchemasLoader(BatchWriter batchWriter)
Assumes that the BatchWriter has already been initialized.- Parameters:
batchWriter-
-
-
Method Detail
-
initializeDefaultSchemasLoader
protected void initializeDefaultSchemasLoader()
Adds the DocumentFileProcessors and FileFilters specific to loading schemas, which will then be used to construct a DocumentFileReader by the parent class.
-
loadSchemas
public java.util.List<DocumentFile> loadSchemas(java.lang.String... paths)
Run the given paths through the DocumentFileReader, and then send the result to the BatchWriter, and then return the result.- Specified by:
loadSchemasin interfaceSchemasLoader- Parameters:
paths-- Returns:
- a DocumentFile for each file that was loaded as a schema
-
getTdeValidationDatabase
public java.lang.String getTdeValidationDatabase()
-
setTdeValidationDatabase
public void setTdeValidationDatabase(java.lang.String tdeValidationDatabase)
-
-