KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > columba > chat > config > Account


1 // The contents of this file are subject to the Mozilla Public License Version
2
// 1.1
3
//(the "License"); you may not use this file except in compliance with the
4
//License. You may obtain a copy of the License at http://www.mozilla.org/MPL/
5
//
6
//Software distributed under the License is distributed on an "AS IS" basis,
7
//WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
8
//for the specific language governing rights and
9
//limitations under the License.
10
//
11
//The Original Code is "The Columba Project"
12
//
13
//The Initial Developers of the Original Code are Frederik Dietz and Timo
14
// Stich.
15
//Portions created by Frederik Dietz and Timo Stich are Copyright (C) 2003.
16
//
17
//All Rights Reserved.
18
package org.columba.chat.config;
19
20 import org.columba.chat.config.api.IAccount;
21
22 /**
23  * Contains account-related configuration.
24  *
25  * @author fdietz
26  *
27  */

28 public class Account implements IAccount {
29
30     private String JavaDoc id;
31
32     private char[] password;
33
34     private String JavaDoc host;
35
36     private String JavaDoc resource;
37
38     private int port;
39
40     private boolean enableSSL;
41
42     public Account() {
43         host = "jabber.org";
44         port = 5222;
45         enableSSL = false;
46     }
47
48     public Account(String JavaDoc id) {
49         this();
50
51         if (id == null)
52             throw new IllegalArgumentException JavaDoc("id == null");
53
54         this.id = id;
55     }
56
57     public Account(String JavaDoc id, String JavaDoc host) {
58         this.id = id;
59         this.host = host;
60
61         port = 5222;
62         enableSSL = false;
63     }
64
65     /**
66      * @return Returns the enableSSL.
67      */

68     public boolean isEnableSSL() {
69         return enableSSL;
70     }
71
72     /**
73      * @return Returns the host.
74      */

75     public String JavaDoc getHost() {
76         return host;
77     }
78
79     /**
80      * @return Returns the id.
81      */

82     public String JavaDoc getId() {
83         return id;
84     }
85
86     /**
87      * @return Returns the password.
88      */

89     public char[] getPassword() {
90         return password;
91     }
92
93     /**
94      * @return Returns the port.
95      */

96     public int getPort() {
97         return port;
98     }
99
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 JavaDoc host) {
113         this.host = host;
114     }
115
116     /**
117      * @param id
118      * The id to set.
119      */

120     public void setId(String JavaDoc 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 JavaDoc getResource() {
144         return resource;
145     }
146
147     /**
148      * @param resource
149      * The resource to set.
150      */

151     public void setResource(String JavaDoc resource) {
152         this.resource = resource;
153     }
154 }
155
Popular Tags