// Path: src/main/java/com/btmatthews/maven/plugins/inmemdb/Database.java
// public interface Database {
// 
//     /**
//      * Find the loader that supports the source file and use it to load the data
//      * into or execute the script against the database.
//      *
//      * @param logger Used to report errors and raise exceptions.
//      * @param source The source file containing data or script.
//      */
//     void load(Logger logger, Source source);
// }
// 
// Path: src/main/java/com/btmatthews/maven/plugins/inmemdb/Loader.java
// public interface Loader {
// 
//     /**
//      * The message key for the error reported when a source file cannot be read.
//      */
//     String CANNOT_READ_SOURCE_FILE = "cannot_read_source_file";
// 
//     /**
//      * The message key for the error reported when a source file cannot be processed.
//      */
//     String ERROR_PROCESSING_SOURCE_FILE = "error_processing_source_file";
// 
//     /**
//      * Determine whether or not the data or script can be loaded or executed.
//      *
//      * @param logger Used to report errors and raise exceptions.
//      * @param source The source file containing the data or script.
//      * @return <ul>
//      *         <li><code>true</code> if the data or script can be loaded or executed.</li>
//      *         <li><code>false</code>if the data or script cannot be loaded or executed.</li>
//      *         </ul>
//      */
//     boolean isSupported(Logger logger, Source source);
// 
//     /**
//      * Load data into or execute a script against the in-memory database.
//      *
//      * @param logger   Used to report errors and raise exceptions.
//      * @param database The in-memory database.
//      * @param source   The source file containing the data or script.
//      */
//     void load(Logger logger, Database database, Source source);
// }
// 
// Path: src/main/java/com/btmatthews/maven/plugins/inmemdb/MessageUtil.java
// public final class MessageUtil {
// 
//     /**
//      * The base name of the message resource bundle.
//      */
//     private static final String BUNDLE_NAME = "com.btmatthews.maven.plugins.inmemdb.messages";
// 
//     /**
//      * The message resource bundle.
//      */
//     private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME);
// 
//     /**
//      * Make the constructor private because this class only offers static utility methods.
//      */
//     private MessageUtil() {
//     }
// 
//     /**
//      * Retrieve the message pattern for a given message key from the resource
//      * bundle and format the message replacing the place holders with the
//      * message arguments.
//      *
//      * @param messageKey The key of the message in the resource bundle.
//      * @param arguments  The message arguments.
//      * @return The expanded message string.
//      */
//     public static String getMessage(final String messageKey,
//                                     final Object... arguments) {
//         final String messagePattern = RESOURCE_BUNDLE.getString(messageKey);
//         return MessageFormat.format(messagePattern, arguments);
//     }
// }
// 
// Path: src/main/java/com/btmatthews/maven/plugins/inmemdb/Source.java
// public interface Source {
// 
//     /**
//      * Get the source file that contains the DDL/DML script or DBUnit data set.
//      *
//      * @return The source file.
//      */
//     String getSourceFile();
// 
//     /**
//      * Determine if the table names in the source file are fully qualified.
//      *
//      * @return <ul>
//      *         <li>{@link Boolean#TRUE} if the table names are fully qualified.</li>
//      *         <li>{@link Boolean#FALSE} if the table names are not fully qualified.</li>
//      *         </ul>
//      */
//     Boolean getQualifiedTableNames();
// }


import java.util.HashMap;
import java.util.Map;
import com.btmatthews.maven.plugins.inmemdb.Database;
import com.btmatthews.maven.plugins.inmemdb.Loader;
import com.btmatthews.maven.plugins.inmemdb.MessageUtil;
import com.btmatthews.maven.plugins.inmemdb.Source;
import com.btmatthews.utils.monitor.AbstractServer;
import com.btmatthews.utils.monitor.Logger;
    public int getPort() {
        return port;
    }

    
    /**
     * Get the attributes used to connect to database
     * @return attributes
     */
    public Map<String, String> getAttributes() {
       return attributes;
    }
    
    /**
     * Get the loaders that are supported for loading data or executing scripts.
     *
     * @return Returns an array of loaders.
     */
    protected abstract Loader[] getLoaders();

    /**
     * Find the loader that supports the source file and use it to load the data
     * into or execute the script against the database.
     *
     * @param logger Used to report errors and raise exceptions.
     * @param source The source file containing data or script.
     */
    @Override
    public final void load(final Logger logger, final Source source) {
        if (source == null) {
// Path: src/main/java/com/btmatthews/maven/plugins/inmemdb/Database.java
// public interface Database {
// 
//     /**
//      * Find the loader that supports the source file and use it to load the data
//      * into or execute the script against the database.
//      *
//      * @param logger Used to report errors and raise exceptions.
//      * @param source The source file containing data or script.
//      */
//     void load(Logger logger, Source source);
// }
// 
// Path: src/main/java/com/btmatthews/maven/plugins/inmemdb/Loader.java
// public interface Loader {
// 
//     /**
//      * The message key for the error reported when a source file cannot be read.
//      */
//     String CANNOT_READ_SOURCE_FILE = "cannot_read_source_file";
// 
//     /**
//      * The message key for the error reported when a source file cannot be processed.
//      */
//     String ERROR_PROCESSING_SOURCE_FILE = "error_processing_source_file";
// 
//     /**
//      * Determine whether or not the data or script can be loaded or executed.
//      *
//      * @param logger Used to report errors and raise exceptions.
//      * @param source The source file containing the data or script.
//      * @return <ul>
//      *         <li><code>true</code> if the data or script can be loaded or executed.</li>
//      *         <li><code>false</code>if the data or script cannot be loaded or executed.</li>
//      *         </ul>
//      */
//     boolean isSupported(Logger logger, Source source);
// 
//     /**
//      * Load data into or execute a script against the in-memory database.
//      *
//      * @param logger   Used to report errors and raise exceptions.
//      * @param database The in-memory database.
//      * @param source   The source file containing the data or script.
//      */
//     void load(Logger logger, Database database, Source source);
// }
// 
// Path: src/main/java/com/btmatthews/maven/plugins/inmemdb/MessageUtil.java
// public final class MessageUtil {
// 
//     /**
//      * The base name of the message resource bundle.
//      */
//     private static final String BUNDLE_NAME = "com.btmatthews.maven.plugins.inmemdb.messages";
// 
//     /**
//      * The message resource bundle.
//      */
//     private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME);
// 
//     /**
//      * Make the constructor private because this class only offers static utility methods.
//      */
//     private MessageUtil() {
//     }
// 
//     /**
//      * Retrieve the message pattern for a given message key from the resource
//      * bundle and format the message replacing the place holders with the
//      * message arguments.
//      *
//      * @param messageKey The key of the message in the resource bundle.
//      * @param arguments  The message arguments.
//      * @return The expanded message string.
//      */
//     public static String getMessage(final String messageKey,
//                                     final Object... arguments) {
//         final String messagePattern = RESOURCE_BUNDLE.getString(messageKey);
//         return MessageFormat.format(messagePattern, arguments);
//     }
// }
// 
// Path: src/main/java/com/btmatthews/maven/plugins/inmemdb/Source.java
// public interface Source {
// 
//     /**
//      * Get the source file that contains the DDL/DML script or DBUnit data set.
//      *
//      * @return The source file.
//      */
//     String getSourceFile();
// 
//     /**
//      * Determine if the table names in the source file are fully qualified.
//      *
//      * @return <ul>
//      *         <li>{@link Boolean#TRUE} if the table names are fully qualified.</li>
//      *         <li>{@link Boolean#FALSE} if the table names are not fully qualified.</li>
//      *         </ul>
//      */
//     Boolean getQualifiedTableNames();
// }


// Path: src/main/java/com/btmatthews/maven/plugins/inmemdb/db/AbstractDatabase.java
import java.util.HashMap;
import java.util.Map;
import com.btmatthews.maven.plugins.inmemdb.Database;
import com.btmatthews.maven.plugins.inmemdb.Loader;
import com.btmatthews.maven.plugins.inmemdb.MessageUtil;
import com.btmatthews.maven.plugins.inmemdb.Source;
import com.btmatthews.utils.monitor.AbstractServer;
import com.btmatthews.utils.monitor.Logger;

    public int getPort() {
        return port;
    }

    
    /**
     * Get the attributes used to connect to database
     * @return attributes
     */
    public Map<String, String> getAttributes() {
       return attributes;
    }
    
    /**
     * Get the loaders that are supported for loading data or executing scripts.
     *
     * @return Returns an array of loaders.
     */
    protected abstract Loader[] getLoaders();

    /**
     * Find the loader that supports the source file and use it to load the data
     * into or execute the script against the database.
     *
     * @param logger Used to report errors and raise exceptions.
     * @param source The source file containing data or script.
     */
    @Override
    public final void load(final Logger logger, final Source source) {
        if (source == null) {
            final String message = MessageUtil.getMessage(UNSUPPORTED_FILE_TYPE, "null");