001: package net.sourceforge.squirrel_sql.plugins.sqlval;
002:
003: /*
004: * Copyright (C) 2002-2003 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.io.Serializable;
022:
023: public class WebServicePreferences implements Cloneable, Serializable {
024: static final String UNSUPPORTED = "Unsupported";
025:
026: /** If <TT>true</TT> use anonymous logon. */
027: private boolean _useAnonymousLogon = true;
028:
029: /** User Name to use to logon to web service. */
030: private String _userName = "";
031:
032: /** Password to use to logon to web service. */
033: private String _password = "";
034:
035: /** If <TT>true</TT> use anonymous client. */
036: private boolean _useAnonymousClient = false;
037:
038: /** Client Name. */
039: private String _clientName;
040:
041: /** Client version. */
042: private String _clientVersion;
043:
044: public WebServicePreferences() {
045: super ();
046: }
047:
048: /**
049: * Return a copy of this object.
050: */
051: public Object clone() {
052: try {
053: return super .clone();
054: } catch (CloneNotSupportedException ex) {
055: throw new InternalError(ex.getMessage()); // Impossible.
056: }
057: }
058:
059: /**
060: * If <TT>true</TT> use anonymous logon to the web service.
061: *
062: * @return <TT>true</TT> if anonymous logon to be used.
063: */
064: public boolean getUseAnonymousLogon() {
065: return _useAnonymousLogon;
066: }
067:
068: /**
069: * Specify whether to use anonymous logon.
070: *
071: * @param value <TT>true</TT> if anonymous logon to be used.
072: */
073: public void setUseAnonymousLogon(boolean value) {
074: _useAnonymousLogon = value;
075: }
076:
077: /**
078: * Retrieve the name to use to logon to the web service. This is only
079: * used if <TT>useAnonymousLogon</TT> is false.
080: *
081: * @return User name.
082: */
083: public String getUserName() {
084: return _userName;
085: }
086:
087: /**
088: * Set the user name for logging on to the web service.
089: *
090: * @param value User name
091: */
092: public void setUserName(String value) {
093: _userName = value;
094: }
095:
096: /**
097: * Retrieve the password to use to logon to the web service. This is only
098: * used if <TT>useAnonymousLogon</TT> is false. Deliberately not a JavaBean
099: * method so that unencrypted passwords will not be stored to disk.
100: *
101: * @return Password.
102: */
103: public String retrievePassword() {
104: return _password;
105: }
106:
107: /**
108: * Set the password name for logging on to the web service.
109: *
110: * @param value Password
111: */
112: public void setPassword(String value) {
113: _password = value;
114: }
115:
116: /**
117: * If <TT>true</TT> use anonymous client.
118: *
119: * @return <TT>true</TT> if anonymous client to be used.
120: */
121: public boolean getUseAnonymousClient() {
122: return _useAnonymousClient;
123: }
124:
125: /**
126: * Specify whether to use anonymous client.
127: *
128: * @param value <TT>true</TT> if anonymous client to be used.
129: */
130: public void setUseAnonymousClient(boolean value) {
131: _useAnonymousClient = value;
132: }
133:
134: /**
135: * Retrieve the client to use. This is only
136: * used if <TT>useAnonymousClient</TT> is false.
137: *
138: * @return Client name.
139: */
140: public String getClientName() {
141: return _clientName;
142: }
143:
144: /**
145: * Set the client name.
146: *
147: * @param value Client name
148: */
149: public void setClientName(String value) {
150: _clientName = value;
151: }
152:
153: /**
154: * Retrieve the client version to use. This is only
155: * used if <TT>useAnonymousLogon</TT> is false.
156: *
157: * @return Client version.
158: */
159: public String getClientVersion() {
160: return _clientVersion;
161: }
162:
163: /**
164: * Set the client version.
165: *
166: * @param value Client version
167: */
168: public void setClientVersion(String value) {
169: _clientVersion = value;
170: }
171: }
|