KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > sync4j > framework > core > bootstrap > BootStrap


1 /**
2  * Copyright (C) 2003-2005 Funambol
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  */

18
19 package sync4j.framework.core.bootstrap;
20
21 import java.io.Serializable JavaDoc;
22
23 import org.apache.commons.lang.builder.ToStringBuilder;
24
25 /**
26  * Contains the info to bootstrap a device.
27  *
28  * @author Stefano Nichele @ Funambol
29  * @version $Id: BootStrap.java,v 1.1 2005/05/16 17:32:54 nichele Exp $
30  */

31 public class BootStrap implements Serializable JavaDoc {
32
33     // -------------------------------------------------------------- Properties
34
private String JavaDoc msisdn;
35     private String JavaDoc username;
36     private String JavaDoc password;
37     private String JavaDoc deviceId;
38     private String JavaDoc imsi;
39     private String JavaDoc userPin;
40     private byte[] bootstrapMessage;
41     private String JavaDoc digest;
42     private int authMethod;
43     private boolean imsiInSemiOctet;
44
45     /**
46      * Gets the msisdn
47      * @return the msisdn
48      */

49     public String JavaDoc getMsisdn() {
50         return msisdn;
51     }
52
53     /**
54      * Sets the msisdn
55      * @param msisdn the msisdn to sets
56      */

57     public void setMsisdn(String JavaDoc msisdn) {
58         this.msisdn = msisdn;
59     }
60
61     /**
62      * Gets the username
63      * @return the username
64      */

65     public String JavaDoc getUsername() {
66         return username;
67     }
68
69     /**
70      * Sets the username
71      * @param username the username to sets
72      */

73     public void setUsername(String JavaDoc username) {
74         this.username = username;
75     }
76
77     /**
78      * Gets the password
79      * @return the password
80      */

81     public String JavaDoc getPassword() {
82         return password;
83     }
84
85     /**
86      * Sets the password
87      * @param password the password to sets
88      */

89     public void setPassword(String JavaDoc password) {
90         this.password = password;
91     }
92
93     /**
94      * Gets the deviceId
95      * @return the deviceId
96      */

97     public String JavaDoc getDeviceId() {
98         return deviceId;
99     }
100
101     /**
102      * Sets the deviceId
103      * @param deviceId the deviceId to sets
104      */

105     public void setDeviceId(String JavaDoc deviceId) {
106         this.deviceId = deviceId;
107     }
108
109     /**
110      * Gets the imsi
111      * @return the imsi
112      */

113     public String JavaDoc getImsi() {
114         return imsi;
115     }
116
117     /**
118      * Sets the imsi
119      * @param imsi the imsi to sets
120      */

121     public void setImsi(String JavaDoc imsi) {
122         this.imsi = imsi;
123     }
124
125     /**
126      * Gets the bootstrapMessage
127      * @return the bootstrapMessage
128      */

129     public byte[] getBootstrapMessage() {
130         return bootstrapMessage;
131     }
132
133     /**
134      * Sets the bootstrapMessage
135      * @param bootstrapMessage the bootstrapMessage to sets
136      */

137     public void setBootstrapMessage(byte[] bootstrapMessage) {
138         this.bootstrapMessage = bootstrapMessage;
139     }
140
141     /**
142      * Gets the digest
143      * @return the digest
144      */

145     public String JavaDoc getDigest() {
146         return digest;
147     }
148
149     /**
150      * Sets the digest
151      * @param digest the digest to sets
152      */

153     public void setDigest(String JavaDoc digest) {
154         this.digest = digest;
155     }
156
157     /**
158      * Gets the authMethod
159      * @return the authMethod
160      */

161     public int getAuthMethod() {
162         return authMethod;
163     }
164
165     /**
166      * Sets the authMethod
167      * @param authMethod the authMethod to sets
168      */

169     public void setAuthMethod(int authMethod) {
170         this.authMethod = authMethod;
171     }
172
173     /**
174      * Gets the imsiInSemiOctet
175      * @return the imsiInSemiOctet
176      */

177     public boolean isImsiInSemiOctet() {
178         return imsiInSemiOctet;
179     }
180
181     /**
182      * Sets if the imsi must be codified in semi-octet
183      * @param imsiInSemiOctet the imsi must be codified in semi-octet ?
184      */

185     public void setImsiInSemiOctet(boolean imsiInSemiOctet) {
186         this.imsiInSemiOctet = imsiInSemiOctet;
187     }
188
189     /**
190      * Gets the userPin
191      * @return the userPin
192      */

193     public String JavaDoc getUserPin() {
194         return userPin;
195     }
196
197     /**
198      * Sets the userPin
199      * @param userPin the userPin to sets
200      */

201     public void setUserPin(String JavaDoc userPin) {
202         this.userPin = userPin;
203     }
204
205     // ------------------------------------------------------------ Constructors
206

207     /**
208      * Creates a new Bootstrap
209      */

210     public BootStrap() {
211     }
212
213     /**
214      * Creates a new Bootstrap with the given parameters
215      */

216     public BootStrap(String JavaDoc msisdn,
217                      String JavaDoc username,
218                      String JavaDoc password,
219                      String JavaDoc deviceId,
220                      String JavaDoc imsi,
221                      String JavaDoc userPin,
222                      byte[] bootstrapMessage,
223                      String JavaDoc digest,
224                      int authMethod,
225                      boolean imsiInSemiOctet) {
226
227         this.msisdn = msisdn;
228         this.username = username;
229         this.password = password;
230         this.deviceId = deviceId;
231         this.imsi = imsi;
232         this.userPin = userPin;
233         this.bootstrapMessage = bootstrapMessage;
234         this.digest = digest;
235         this.authMethod = authMethod;
236         this.imsiInSemiOctet = imsiInSemiOctet;
237
238     }
239
240     // --------------------------------------------------------- Pubblic Methods
241

242     /**
243      * Returns a String representation of this Bootstrap
244      * @return String
245      */

246     public String JavaDoc toString() {
247         ToStringBuilder sb = new ToStringBuilder(this);
248
249         sb.append("msisdn" , msisdn);
250         sb.append("username", username);
251         sb.append("password", password);
252         sb.append("deviceId", deviceId);
253         sb.append("imsi" , imsi);
254         sb.append("userPin" , userPin);
255         sb.append("authMethod" , authMethod);
256         sb.append("bootstrapMessage", bootstrapMessage);
257         sb.append("digest" , digest);
258         sb.append("imsiInSemiOctet" , imsiInSemiOctet);
259
260
261         return sb.toString();
262     }
263
264
265 }
Popular Tags