All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cdc.util.rdb.tools.dump.SchemaConfig Maven / Gradle / Ivy

package cdc.util.rdb.tools.dump;

import java.util.HashMap;
import java.util.Map;
import java.util.Set;

/**
 * Schema configuration.
 *
 * @author Damien Carbonne
 *
 */
public final class SchemaConfig extends AbstractNamedConfig {
    private final Map tables = new HashMap<>();

    SchemaConfig(DatabaseConfig parent,
                 String internal) {
        super(parent, internal);
        setProcessing(Processing.INHERIT);
    }

    @Override
    public DatabaseConfig getParent() {
        return (DatabaseConfig) super.getParent();
    }

    @Override
    public EffectiveProcessing getEffectiveProcessing() {
        return toEffectiveProcessing(tables.values());
    }

    public Set getTableNames() {
        return tables.keySet();
    }

    public TableConfig getOrCreateTableConfig(String tableName) {
        return tables.computeIfAbsent(tableName, s -> new TableConfig(this, s));
    }

    /**
     * Returns the configuration associated to a table.
     *
     * @param tableName The internal table name.
     * @return The configuration associated to {@code tableName} or null.
     */
    public TableConfig getTableConfig(String tableName) {
        return tables.get(tableName);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy