KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > directory > ldapstudio > browser > core > model > ConnectionParameter


1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one
3  * or more contributor license agreements. See the NOTICE file
4  * distributed with this work for additional information
5  * regarding copyright ownership. The ASF licenses this file
6  * to you under the Apache License, Version 2.0 (the
7  * "License"); you may not use this file except in compliance
8  * with the License. You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing,
13  * software distributed under the License is distributed on an
14  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15  * KIND, either express or implied. See the License for the
16  * specific language governing permissions and limitations
17  * under the License.
18  *
19  */

20
21 package org.apache.directory.ldapstudio.browser.core.model;
22
23
24 import java.io.Serializable JavaDoc;
25
26
27 /**
28  * A Bean class to hold the connection parameters.
29  * It is used to make connections persistent.
30  *
31  * @author <a HREF="mailto:dev@directory.apache.org">Apache Directory Project</a>
32  * @version $Rev$, $Date$
33  */

34 public class ConnectionParameter implements Serializable JavaDoc
35 {
36
37     /** The serialVersionUID. */
38     private static final long serialVersionUID = 3679909600732887964L;
39
40     /** The symbolic name. */
41     private String JavaDoc name;
42
43     /** The host name or IP address of the LDAP server. */
44     private String JavaDoc host;
45
46     /** The encryption method, one of IConnection.ENCYRPTION_NONE, IConnection.ENCYRPTION_LDAPS or IConnection.ENCYRPTION_STARTTLS. */
47     private int encryptionMethod;
48
49     /** The port of the LDAP server. */
50     private int port;
51
52     /** Flag indicating if base DNs should be fetched from namingContexts attribute of the Root DSE. */
53     private boolean fetchBaseDNs;
54
55     /** The user provided base DN. */
56     private DN baseDN;
57
58     /** The time limit im milliseconds. */
59     private int timeLimit;
60
61     /** The count limit. */
62     private int countLimit;
63
64     /** The alias dereferencing method, one of IConnection.DEREFERENCE_ALIASES_NEVER, IConnection.DEREFERENCE_ALIASES_ALWAYS, IConnection.DEREFERENCE_ALIASES_FINDING or IConnection.DEREFERENCE_ALIASES_SEARCH. */
65     private int aliasesDereferencingMethod;
66
67     /** The referrals handling method, one of IConnection.HANDLE_REFERRALS_IGNORE or IConnection.HANDLE_REFERRALS_FOLLOW. */
68     private int referralsHandlingMethod;
69
70     /** The authentication method, one of IConnection.AUTH_ANONYMOUS or IConnection.AUTH_SIMPLE */
71     private int authMethod;
72
73     /** The bind principal, typically a DN. */
74     private String JavaDoc bindPrincipal;
75
76     /** The bind password. */
77     private String JavaDoc bindPassword;
78
79     /** The connection provider class name. */
80     private String JavaDoc connectionProviderClassName;
81
82
83     /**
84      * Creates a new instance of ConnectionParameter.
85      */

86     public ConnectionParameter()
87     {
88     }
89
90
91     /**
92      * Gets the user provided base DN.
93      *
94      * @return the user provided base DN
95      */

96     public DN getBaseDN()
97     {
98         return baseDN;
99     }
100
101
102     /**
103      * Sets the user provided base DN.
104      *
105      * @param baseDN the user provided base DN
106      */

107     public void setBaseDN( DN baseDN )
108     {
109         this.baseDN = baseDN;
110     }
111
112
113     /**
114      * Gets the count limit, 0 means no limit.
115      *
116      * @return the count limit
117      */

118     public int getCountLimit()
119     {
120         return countLimit;
121     }
122
123
124     /**
125      * Sets the count limit, 0 means no limit.
126      *
127      * @param countLimit the count limit
128      */

129     public void setCountLimit( int countLimit )
130     {
131         this.countLimit = countLimit;
132     }
133
134
135     /**
136      * Gets the host name or IP address of the LDAP server.
137      *
138      * @return the host
139      */

140     public String JavaDoc getHost()
141     {
142         return host;
143     }
144
145
146     /**
147      * Sets the host name or IP address of the LDAP server.
148      *
149      * @param host the host
150      */

151     public void setHost( String JavaDoc host )
152     {
153         this.host = host;
154     }
155
156
157     /**
158      * Gets the symbolic name.
159      *
160      * @return the name
161      */

162     public String JavaDoc getName()
163     {
164         return name;
165     }
166
167
168     /**
169      * Sets the symbolic name.
170      *
171      * @param name the name
172      */

173     public void setName( String JavaDoc name )
174     {
175         this.name = name;
176     }
177
178
179     /**
180      * Gets the port.
181      *
182      * @return the port
183      */

184     public int getPort()
185     {
186         return port;
187     }
188
189
190     /**
191      * Sets the port.
192      *
193      * @param port the port
194      */

195     public void setPort( int port )
196     {
197         this.port = port;
198     }
199
200
201     /**
202      * Gets the time limit in milliseconds, 0 means no limit.
203      *
204      * @return the time limit
205      */

206     public int getTimeLimit()
207     {
208         return timeLimit;
209     }
210
211
212     /**
213      * Sets the time limit in milliseconds, 0 means no limit.
214      *
215      * @param timeLimit the time limit
216      */

217     public void setTimeLimit( int timeLimit )
218     {
219         this.timeLimit = timeLimit;
220     }
221
222
223     /**
224      * Checks if base DNs should be fetched.
225      * If true the base DNs are fetched from the namingContexts
226      * attribute of the Root DSE.
227      *
228      * @return true, if base DNs should be fetched
229      */

230     public boolean isFetchBaseDNs()
231     {
232         return fetchBaseDNs;
233     }
234
235
236     /**
237      * Sets the fetch base DNs flag.
238      * If true the base DNs are fetched from the namingContexts
239      * attribute of the Root DSE.
240      *
241      * @param fetchBaseDNs the fetch base DNs flag
242      */

243     public void setFetchBaseDNs( boolean fetchBaseDNs )
244     {
245         this.fetchBaseDNs = fetchBaseDNs;
246     }
247
248
249     /**
250      * Sets the bind DN.
251      *
252      * @param bindDN the bind DN
253      *
254      * @deprecated use setBindPrincipal( String ) instead
255      */

256     public void setBindDN( DN bindDN )
257     {
258         this.setBindPrincipal( bindDN.toString() );
259     }
260
261
262     /**
263      * Gets the bind principal, typically a DN.
264      *
265      * @return the bind principal
266      */

267     public String JavaDoc getBindPrincipal()
268     {
269         return bindPrincipal;
270     }
271
272
273     /**
274      * Sets the bind principal, typically a DN.
275      *
276      * @param bindPrincipal the bind principal
277      */

278     public void setBindPrincipal( String JavaDoc bindPrincipal )
279     {
280         this.bindPrincipal = bindPrincipal;
281     }
282
283
284     /**
285      * Gets the bind password.
286      *
287      * @return the bind password
288      */

289     public String JavaDoc getBindPassword()
290     {
291         return bindPassword;
292     }
293
294
295     /**
296      * Sets the bind password.
297      *
298      * @param bindPassword the bind password
299      */

300     public void setBindPassword( String JavaDoc bindPassword )
301     {
302         this.bindPassword = bindPassword;
303     }
304
305
306     /**
307      * Gets the auth method, one of IConnection.AUTH_ANONYMOUS
308      * or IConnection.AUTH_SIMPLE.
309      *
310      * @return the auth method
311      */

312     public int getAuthMethod()
313     {
314         return authMethod;
315     }
316
317
318     /**
319      * Sets the auth method, one of IConnection.AUTH_ANONYMOUS
320      * or IConnection.AUTH_SIMPLE.
321      *
322      * @param authMethod the auth method
323      */

324     public void setAuthMethod( int authMethod )
325     {
326         this.authMethod = authMethod;
327     }
328
329
330     /**
331      * Gets the connection provider class name.
332      *
333      * @return the connection provider class name
334      */

335     public String JavaDoc getConnectionProviderClassName()
336     {
337         return connectionProviderClassName;
338     }
339
340
341     /**
342      * Sets the connection provider class name.
343      *
344      * @param connectionProviderClassName the connection provider class name
345      */

346     public void setConnectionProviderClassName( String JavaDoc connectionProviderClassName )
347     {
348         this.connectionProviderClassName = connectionProviderClassName;
349     }
350
351
352     /**
353      * Gets the encryption method, one of IConnection.ENCYRPTION_NONE,
354      * IConnection.ENCYRPTION_LDAPS or IConnection.ENCYRPTION_STARTTLS.
355      *
356      * @return the encryption method
357      */

358     public int getEncryptionMethod()
359     {
360         return encryptionMethod;
361     }
362
363
364     /**
365      * Sets the encryption method, one of IConnection.ENCYRPTION_NONE,
366      * IConnection.ENCYRPTION_LDAPS or IConnection.ENCYRPTION_STARTTLS.
367      *
368      * @param encryptionMethod the encryption method
369      */

370     public void setEncryptionMethod( int encryptionMethod )
371     {
372         this.encryptionMethod = encryptionMethod;
373     }
374
375
376     /**
377      * Gets the aliases dereferencing method, one of IConnection.DEREFERENCE_ALIASES_NEVER,
378      * IConnection.DEREFERENCE_ALIASES_ALWAYS, IConnection.DEREFERENCE_ALIASES_FINDING
379      * or IConnection.DEREFERENCE_ALIASES_SEARCH.
380      *
381      * @return the aliases dereferencing method
382      */

383     public int getAliasesDereferencingMethod()
384     {
385         return aliasesDereferencingMethod;
386     }
387
388
389     /**
390      * Sets the aliases dereferencing method, one of IConnection.DEREFERENCE_ALIASES_NEVER,
391      * IConnection.DEREFERENCE_ALIASES_ALWAYS, IConnection.DEREFERENCE_ALIASES_FINDING
392      * or IConnection.DEREFERENCE_ALIASES_SEARCH.
393      *
394      * @param aliasesDereferencingMethod the aliases dereferencing method
395      */

396     public void setAliasesDereferencingMethod( int aliasesDereferencingMethod )
397     {
398         this.aliasesDereferencingMethod = aliasesDereferencingMethod;
399     }
400
401
402     /**
403      * Gets the referrals handling method, one of IConnection.HANDLE_REFERRALS_IGNORE
404      * or IConnection.HANDLE_REFERRALS_FOLLOW.
405      *
406      * @return the referrals handling method
407      */

408     public int getReferralsHandlingMethod()
409     {
410         return referralsHandlingMethod;
411     }
412
413
414     /**
415      * Sets the referrals handling method, one of IConnection.HANDLE_REFERRALS_IGNORE or
416      * IConnection.HANDLE_REFERRALS_FOLLOW.
417      *
418      * @param referralsHandlingMethod the referrals handling method
419      */

420     public void setReferralsHandlingMethod( int referralsHandlingMethod )
421     {
422         this.referralsHandlingMethod = referralsHandlingMethod;
423     }
424
425 }
426
Popular Tags