001/**
002 *
003 * Copyright (c) 2014, the Railo Company Ltd. All rights reserved.
004 *
005 * This library is free software; you can redistribute it and/or
006 * modify it under the terms of the GNU Lesser General Public
007 * License as published by the Free Software Foundation; either 
008 * version 2.1 of the License, or (at your option) any later version.
009 * 
010 * This library is distributed in the hope that it will be useful,
011 * but WITHOUT ANY WARRANTY; without even the implied warranty of
012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
013 * Lesser General Public License for more details.
014 * 
015 * You should have received a copy of the GNU Lesser General Public 
016 * License along with this library.  If not, see <http://www.gnu.org/licenses/>.
017 * 
018 **/
019package coldfusion.server;
020
021import java.io.IOException;
022import java.sql.SQLException;
023
024import lucee.runtime.exp.SecurityException;
025import lucee.runtime.type.Array;
026import lucee.runtime.type.Struct;
027import coldfusion.sql.DataSource;
028
029
030public interface DataSourceService extends Service {
031        
032        /*
033        TODO impl
034        public abstract Query executeQuery(Connection arg0, String arg1,
035                        ParameterList arg2, Integer arg3, Integer arg4, Integer arg5,
036                        int[] arg6, int arg7, int arg8, boolean arg9, boolean arg10)
037                        throws SQLException;
038
039        public abstract Query executeQuery(Connection arg0, String arg1,
040                        ParameterList arg2, Integer arg3, Integer arg4, Integer arg5,
041                        int[] arg6, String arg7) throws SQLException;
042
043        public abstract Query executeQuery(Connection arg0, String arg1,
044                        ParameterList arg2, Integer arg3, Integer arg4, Integer arg5,
045                        int[] arg6, DataSourceDef arg7) throws SQLException;
046
047        public abstract Query executeQuery(Connection arg0, String arg1,
048                        ParameterList arg2, Integer arg3, Integer arg4, Integer arg5,
049                        int[] arg6, Object arg7) throws SQLException;
050
051        public abstract Query executeCall(Connection arg0, String arg1,
052                        ParameterList arg2, int[] arg3, Integer arg4, Integer arg5,
053                        int[] arg6, int arg7, int arg8, boolean arg9, boolean arg10)
054                        throws SQLException;
055
056        public abstract Query executeCall(Connection arg0, String arg1,
057                        ParameterList arg2, int[] arg3, Integer arg4, Integer arg5,
058                        int[] arg6, String arg7) throws SQLException;
059
060        public abstract Query executeCall(Connection arg0, String arg1,
061                        ParameterList arg2, int[] arg3, Integer arg4, Integer arg5,
062                        int[] arg6, DataSourceDef arg7) throws SQLException;
063
064        public abstract Query executeCall(Connection arg0, String arg1,
065                        ParameterList arg2, int[] arg3, Integer arg4, Integer arg5,
066                        int[] arg6, Object arg7) throws SQLException;
067*/
068        public abstract Struct getDatasources() throws SecurityException;
069
070        public abstract Struct getDrivers() throws ServiceException, SecurityException;
071
072        public abstract Array getNames() throws SecurityException;
073
074        public abstract Struct getDefaults();
075
076        public abstract Number getMaxQueryCount();
077
078        public abstract void setMaxQueryCount(Number arg0);
079
080        public abstract String encryptPassword(String arg0);
081
082        public abstract boolean verifyDatasource(String arg0) throws SQLException, SecurityException;
083
084        public abstract DataSource getDatasource(String arg0) throws SQLException, SecurityException;
085
086        public abstract String getDbdir();
087
088        public abstract Object getCachedQuery(String arg0);
089
090        public abstract void setCachedQuery(String arg0, Object arg1);
091
092        public abstract void purgeQueryCache() throws IOException;
093
094        public abstract boolean disableConnection(String arg0);
095
096        public abstract boolean isJadoZoomLoaded();
097
098        public abstract void removeDatasource(String arg0) throws SQLException, SecurityException;
099
100}