001: // The contents of this file are subject to the Mozilla Public License Version
002: // 1.1
003: //(the "License"); you may not use this file except in compliance with the
004: //License. You may obtain a copy of the License at http://www.mozilla.org/MPL/
005: //
006: //Software distributed under the License is distributed on an "AS IS" basis,
007: //WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
008: //for the specific language governing rights and
009: //limitations under the License.
010: //
011: //The Original Code is "The Columba Project"
012: //
013: //The Initial Developers of the Original Code are Frederik Dietz and Timo
014: // Stich.
015: //Portions created by Frederik Dietz and Timo Stich are Copyright (C) 2003.
016: //
017: //All Rights Reserved.
018: package org.columba.chat.config;
019:
020: import org.columba.chat.config.api.IAccount;
021:
022: /**
023: * Contains account-related configuration.
024: *
025: * @author fdietz
026: *
027: */
028: public class Account implements IAccount {
029:
030: private String id;
031:
032: private char[] password;
033:
034: private String host;
035:
036: private String resource;
037:
038: private int port;
039:
040: private boolean enableSSL;
041:
042: public Account() {
043: host = "jabber.org";
044: port = 5222;
045: enableSSL = false;
046: }
047:
048: public Account(String id) {
049: this ();
050:
051: if (id == null)
052: throw new IllegalArgumentException("id == null");
053:
054: this .id = id;
055: }
056:
057: public Account(String id, String host) {
058: this .id = id;
059: this .host = host;
060:
061: port = 5222;
062: enableSSL = false;
063: }
064:
065: /**
066: * @return Returns the enableSSL.
067: */
068: public boolean isEnableSSL() {
069: return enableSSL;
070: }
071:
072: /**
073: * @return Returns the host.
074: */
075: public String getHost() {
076: return host;
077: }
078:
079: /**
080: * @return Returns the id.
081: */
082: public String getId() {
083: return id;
084: }
085:
086: /**
087: * @return Returns the password.
088: */
089: public char[] getPassword() {
090: return password;
091: }
092:
093: /**
094: * @return Returns the port.
095: */
096: public int getPort() {
097: return port;
098: }
099:
100: /**
101: * @param enableSSL
102: * The enableSSL to set.
103: */
104: public void setEnableSSL(boolean enableSSL) {
105: this .enableSSL = enableSSL;
106: }
107:
108: /**
109: * @param host
110: * The host to set.
111: */
112: public void setHost(String host) {
113: this .host = host;
114: }
115:
116: /**
117: * @param id
118: * The id to set.
119: */
120: public void setId(String id) {
121: this .id = id;
122: }
123:
124: /**
125: * @param password
126: * The password to set.
127: */
128: public void setPassword(char[] password) {
129: this .password = password;
130: }
131:
132: /**
133: * @param port
134: * The port to set.
135: */
136: public void setPort(int port) {
137: this .port = port;
138: }
139:
140: /**
141: * @return Returns the resource.
142: */
143: public String getResource() {
144: return resource;
145: }
146:
147: /**
148: * @param resource
149: * The resource to set.
150: */
151: public void setResource(String resource) {
152: this.resource = resource;
153: }
154: }
|