001: package net.sourceforge.squirrel_sql.fw.sql;
002:
003: /*
004: * Copyright (C) 2001-2002 Colin Bell
005: * colbell@users.sourceforge.net
006: *
007: * This library is free software; you can redistribute it and/or
008: * modify it under the terms of the GNU Lesser General Public
009: * License as published by the Free Software Foundation; either
010: * version 2.1 of the License, or (at your option) any later version.
011: *
012: * This library is distributed in the hope that it will be useful,
013: * but WITHOUT ANY WARRANTY; without even the implied warranty of
014: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
015: * Lesser General Public License for more details.
016: *
017: * You should have received a copy of the GNU Lesser General Public
018: * License along with this library; if not, write to the Free Software
019: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
020: */
021: import java.beans.PropertyChangeListener;
022:
023: import net.sourceforge.squirrel_sql.fw.id.IHasIdentifier;
024: import net.sourceforge.squirrel_sql.fw.id.IIdentifier;
025: import net.sourceforge.squirrel_sql.fw.persist.ValidationException;
026: import net.sourceforge.squirrel_sql.fw.util.beanwrapper.StringWrapper;
027:
028: public interface ISQLDriver extends IHasIdentifier,
029: Comparable<ISQLDriver> {
030: /**
031: * JavaBean property names for this class.
032: */
033: public interface IPropertyNames {
034: String DRIVER_CLASS = "driverClassName";
035: String ID = "identifier";
036: String JARFILE_NAME = "jarFileName";
037: String JARFILE_NAMES = "jarFileNames";
038: String NAME = "name";
039: String URL = "url";
040: String WEBSITE_URL = "websiteUrl";
041: }
042:
043: /**
044: * Assign data from the passed <CODE>ISQLDriver</CODE> to this one. This
045: * does <B>not</B> copy the identifier.
046: *
047: * @param rhs <CODE>ISQLDriver</CODE> to copy data from.
048: *
049: * @exception ValidationException
050: * Thrown if an error occurs assigning data from
051: * <CODE>rhs</CODE>.
052: */
053: void assignFrom(ISQLDriver rhs) throws ValidationException;
054:
055: /**
056: * Compare this <TT>ISQLDriver</TT> to another object. If the passed object
057: * is a <TT>ISQLDriver</TT>, then the <TT>getName()</TT> functions of the two
058: * <TT>ISQLDriver</TT> objects are used to compare them. Otherwise, it throws a
059: * ClassCastException (as <TT>ISQLDriver</TT> objects are comparable only to
060: * other <TT>ISQLDriver</TT> objects).
061: */
062: int compareTo(ISQLDriver rhs);
063:
064: IIdentifier getIdentifier();
065:
066: String getDriverClassName();
067:
068: void setDriverClassName(String driverClassName)
069: throws ValidationException;
070:
071: /**
072: * @deprecated Replaced by getJarFileURLs().
073: */
074: String getJarFileName();
075:
076: void setJarFileName(String value) throws ValidationException;
077:
078: StringWrapper[] getJarFileNameWrappers();
079:
080: StringWrapper getJarFileNameWrapper(int idx)
081: throws ArrayIndexOutOfBoundsException;
082:
083: void setJarFileNameWrappers(StringWrapper[] value);
084:
085: void setJarFileNameWrapper(int idx, StringWrapper value)
086: throws ArrayIndexOutOfBoundsException;
087:
088: String[] getJarFileNames();
089:
090: void setJarFileNames(String[] values);
091:
092: String getUrl();
093:
094: void setUrl(String url) throws ValidationException;
095:
096: String getName();
097:
098: void setName(String name) throws ValidationException;
099:
100: boolean isJDBCDriverClassLoaded();
101:
102: void setJDBCDriverClassLoaded(boolean cl);
103:
104: void addPropertyChangeListener(PropertyChangeListener listener);
105:
106: void removePropertyChangeListener(PropertyChangeListener listener);
107:
108: String getWebSiteUrl();
109:
110: void setWebSiteUrl(String url) throws ValidationException;
111: }
|