/*
 * Copyright (C) 2013 Paulo Perbone. All rights reserved.
 * 
 * This file is part of JEJDBC 
 * https://github.com/perbone/jejdbc/
 *
 * JEJDBC is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * JEJDBC is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with JEJDBC. If not, see <http://www.gnu.org/licenses/>.
 */

package jejdbc.jdbc;

import java.sql.Connection;
import java.sql.DriverPropertyInfo;
import java.sql.SQLException;
import java.sql.SQLFeatureNotSupportedException;
import java.util.Properties;
import java.util.logging.Logger;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * This is the {@link java.sql.Driver} interface implementation.
 * 
 * @see java.sql.Driver
 * 
 * @author Paulo Perbone <pauloperbone@yahoo.com>
 * @since 0.1.0
 */
public class Driver implements java.sql.Driver
{
    /*
     * Self registration with the JDBC DriverManager.
     */
    static
    {
        try
        {
            java.sql.DriverManager.registerDriver(new Driver());
        }
        catch (SQLException e)
        {
            throw new RuntimeException("Can't register driver", e);
        }
    }

    private static final Pattern URL_PATTERN = Pattern.compile("jdbc:jejdbc:(?://)?([^/]+)(?:/.+)?");

    /**
     * Creates a new
     */
    public Driver()
    {
    }

    @Override
    public Connection connect(String url, Properties info) throws SQLException
    {
        // TODO Auto-generated method stub
        return null;
    }

    @Override
    public boolean acceptsURL(String url) throws SQLException
    {
        Matcher matcher = URL_PATTERN.matcher(url);

        boolean accepts = matcher.matches();

        return accepts;
    }

    @Override
    public DriverPropertyInfo[] getPropertyInfo(String url, Properties info) throws SQLException
    {
        // TODO Auto-generated method stub
        return null;
    }

    @Override
    public int getMajorVersion()
    {
        // TODO Auto-generated method stub
        return 0;
    }

    @Override
    public int getMinorVersion()
    {
        // TODO Auto-generated method stub
        return 0;
    }

    @Override
    public boolean jdbcCompliant()
    {
        return false;
    }

    @Override
    public Logger getParentLogger() throws SQLFeatureNotSupportedException
    {
        // TODO Auto-generated method stub
        return null;
    }
}
@@ -1275,16 +1275,1134 @@
 river%0A%7B%0A
+    public enum ExecutionMode%0A    %7B%0A        /**%0A         * %3Cul%3E%0A         * %3Cli%3ERead-Write from/to local database (standalone environment)%3C/li%3E%0A         * %3C/ul%3E%0A         */%0A        LOCAL,%0A%0A        /**%0A         * %3Cul%3E%0A         * %3Cli%3ERead-Write from/to local master database (HA environment)%3C/li%3E%0A         * %3Cli%3ERead-Only from local replica database (HA environment)%3C/li%3E%0A         * %3Cli%3EWrite-Forwarding to remote master database (HA environment)%3C/li%3E%0A         * %3C/ul%3E%0A         */%0A        LOCAL_HA,%0A%0A        /**%0A         * %3Cul%3E%0A         * %3Cli%3EServer mode for local database (standalone environment)%3C/li%3E%0A         * %3C/ul%3E%0A         */%0A        SERVER,%0A%0A        /**%0A         * %3Cul%3E%0A         * %3Cli%3EServer mode for local master/replica database (HA environment)%3C/li%3E%0A         * %3C/ul%3E%0A         */%0A        SERVER_HA,%0A%0A        /**%0A         * %3Cul%3E%0A         * %3Cli%3EClient mode for remote database (standalone/HA environment)%3C/li%3E%0A         * %3C/ul%3E%0A         */%0A        CLIENT,%0A%0A        /**%0A         * %3Cul%3E%0A         * %3Cli%3EProxy mode for remote database (standalone/HA environment)%3C/li%3E%0A         * %3C/ul%3E%0A         */%0A        PROXY%0A    %7D%0A%0A
     /*%0A 

Add ExecutionMode enumeration definition.