Class DefaultSchemasLoader

    • 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:
        loadSchemas in interface SchemasLoader
        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)