~ubuntu-branches/ubuntu/wily/389-ds-console/wily-proposed

« back to all changes in this revision

Viewing changes to src/com/netscape/admin/dirserv/panel/ChainingDefaultPanel.java

  • Committer: Package Import Robot
  • Author(s): Timo Aaltonen
  • Date: 2012-03-15 19:58:37 UTC
  • Revision ID: package-import@ubuntu.com-20120315195837-296zyft51thld8q7
Tags: upstream-1.2.6
ImportĀ upstreamĀ versionĀ 1.2.6

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/** BEGIN COPYRIGHT BLOCK
 
2
 * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission.
 
3
 * Copyright (C) 2005 Red Hat, Inc.
 
4
 * All rights reserved.
 
5
 * 
 
6
 * This program is free software; you can redistribute it and/or modify
 
7
 * it under the terms of the GNU General Public License as published by
 
8
 * the Free Software Foundation version 2 of the License.
 
9
 * 
 
10
 * This program is distributed in the hope that it will be useful,
 
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
13
 * GNU General Public License for more details.
 
14
 * 
 
15
 * You should have received a copy of the GNU General Public License
 
16
 * along with this program; if not, write to the Free Software
 
17
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
18
 * END COPYRIGHT BLOCK **/
 
19
 
 
20
package com.netscape.admin.dirserv.panel;
 
21
 
 
22
import java.awt.*;
 
23
import java.util.*;
 
24
import java.io.File;
 
25
import javax.swing.*;
 
26
import javax.swing.border.*;
 
27
import com.netscape.admin.dirserv.*;
 
28
import com.netscape.management.client.*;
 
29
import com.netscape.management.client.util.*;
 
30
import netscape.ldap.*;
 
31
import netscape.ldap.util.DN;
 
32
import com.netscape.management.nmclf.SuiConstants;
 
33
/**
 
34
 * Panel for Directory Server resource page
 
35
 *
 
36
 * @author  rmarco
 
37
 * @version %I%, %G%
 
38
 * @date                9/15/97
 
39
 * @see     com.netscape.admin.dirserv
 
40
 */
 
41
public class ChainingDefaultPanel extends BlankPanel 
 
42
                                                                  implements  SuiConstants{
 
43
                                                                
 
44
    public ChainingDefaultPanel(IDSModel model, LDAPEntry InstEntry) {
 
45
                super( model, _section, true );
 
46
                _helpToken = "configuration-chaining-default-help";
 
47
                _dnEntry =  DEFAULT_PREFIX + InstEntry.getDN();
 
48
                _configEntry = InstEntry;
 
49
                _model = model;
 
50
                _refreshWhenSelect = false;                     
 
51
        }
 
52
 
 
53
        public void init() {
 
54
                if (_isInitialized) {
 
55
                        return;
 
56
                }
 
57
                linkData();
 
58
                _myPanel.setLayout(new GridBagLayout());
 
59
                createTwinArea((Container) _myPanel);
 
60
                addBottomGlue();
 
61
                _isInitialized = true;
 
62
                
 
63
        }
 
64
 
 
65
 
 
66
 
 
67
        private void createTwinArea( Container myContainer ) {
 
68
                
 
69
                GridBagConstraints pgbc = new GridBagConstraints();
 
70
        pgbc.gridx      = 0;
 
71
        pgbc.gridy      = 0;
 
72
        pgbc.gridwidth   = 1;
 
73
        pgbc.gridheight = 1;
 
74
        pgbc.weightx    = 1;
 
75
        pgbc.weighty    = 0;
 
76
        pgbc.fill       = pgbc.BOTH;
 
77
        pgbc.anchor     = pgbc.NORTHWEST;
 
78
        pgbc.insets     = new Insets(DEFAULT_PADDING,DEFAULT_PADDING,
 
79
                                                                        0,DEFAULT_PADDING);
 
80
        pgbc.ipadx = 0;
 
81
        pgbc.ipady = 0; 
 
82
        JPanel leftPanel = new GroupPanel( 
 
83
                                                                DSUtil._resource.getString( _section, 
 
84
                                                                                                                        "client-title" ),
 
85
                                                                true);
 
86
                JPanel rightPanel = new GroupPanel( 
 
87
                                                                DSUtil._resource.getString( _section, 
 
88
                                                                                                                        "cascade-title" ),
 
89
                                                                true);
 
90
                JPanel bottomPanel = new GroupPanel(
 
91
                                                                DSUtil._resource.getString( _section,
 
92
                                                                                                                        "connection-mgt-title" ),
 
93
                                                                true);                                                                  
 
94
                
 
95
                pgbc.gridy = 0;
 
96
                pgbc.gridwidth = 1;
 
97
                pgbc.fill = pgbc.BOTH;   
 
98
                myContainer.add( leftPanel, pgbc );
 
99
                
 
100
                pgbc.gridx++;
 
101
                myContainer.add( rightPanel, pgbc );
 
102
 
 
103
                pgbc.gridx = 0;
 
104
                pgbc.gridy++;
 
105
                pgbc.gridwidth = pgbc.REMAINDER;
 
106
                myContainer.add( bottomPanel, pgbc );
 
107
 
 
108
                createClientArea( leftPanel );
 
109
                createCascadeArea( rightPanel );
 
110
                createConnMgt( bottomPanel );
 
111
        }
 
112
 
 
113
        private void createClientArea( JPanel panel ) {
 
114
 
 
115
                GridBagLayout chbag = new GridBagLayout();
 
116
                GridBagConstraints gbc = new GridBagConstraints() ;
 
117
        gbc.gridx      = 0;
 
118
        gbc.gridy      = 0;
 
119
        gbc.gridwidth    = 1;
 
120
        gbc.gridheight = 1;
 
121
        gbc.weightx    = 1;
 
122
        gbc.weighty    = 0;
 
123
        gbc.fill       = gbc.HORIZONTAL;
 
124
        gbc.anchor     = gbc.NORTHWEST;
 
125
        gbc.insets     = new Insets(0,DEFAULT_PADDING,
 
126
                                                                        0,DEFAULT_PADDING);
 
127
        gbc.ipadx = 0;
 
128
        gbc.ipady = 0;
 
129
                
 
130
                panel.setLayout(chbag);
 
131
                
 
132
                /**
 
133
                 * Hidden because to dangerous, it transfort every damn anonymous
 
134
                 * into proxy user on remote server
 
135
                 *
 
136
                 * panel.add( _cbnsproxiedauthorization, gbc );
 
137
                 * gbc.gridy++;
 
138
                 */
 
139
                gbc.gridwidth = gbc.REMAINDER;
 
140
                gbc.fill = gbc.NONE;
 
141
                panel.add(_cbnsreferralonscopedsearch, gbc );
 
142
                gbc.fill = gbc.HORIZONTAL;
 
143
 
 
144
                gbc.insets.top = DEFAULT_PADDING;
 
145
                gbc.gridy++;
 
146
        gbc.gridx = 0;
 
147
                gbc.gridwidth    = 1;
 
148
 
 
149
                addEntryField( panel,
 
150
                                           gbc,
 
151
                                           _lfnsslapd_sizelimit,
 
152
                                           _tfnsslapd_sizelimit,
 
153
                                           lns_sizelimit_unit );
 
154
                gbc.gridy++;
 
155
        gbc.gridx = 0;
 
156
                addEntryField( panel,
 
157
                                           gbc,
 
158
                                           _lfnsslapd_timelimit,
 
159
                                           _tfnsslapd_timelimit,
 
160
                                           lns_timelimit_unit );
 
161
 
 
162
                gbc.insets = new Insets(0, 0, 0, 0);
 
163
                gbc.gridy++;
 
164
                gbc.fill =gbc.VERTICAL;
 
165
                gbc.weighty = 1.0;
 
166
                gbc.gridwidth = gbc.REMAINDER;
 
167
                panel.add(Box.createVerticalGlue(), gbc);
 
168
        }
 
169
 
 
170
        private void createCascadeArea( JPanel panel ) {
 
171
 
 
172
                GridBagLayout chbag = new GridBagLayout();
 
173
                GridBagConstraints gbc = new GridBagConstraints() ;
 
174
        gbc.gridx      = 0;
 
175
        gbc.gridy      = 0;
 
176
        gbc.gridwidth  = 1;
 
177
        gbc.gridheight = 1;
 
178
        gbc.weightx    = 1;
 
179
        gbc.weighty    = 0;
 
180
        gbc.fill       = gbc.HORIZONTAL;
 
181
        gbc.anchor     = gbc.NORTHWEST;
 
182
        gbc.insets     = new Insets(0,DEFAULT_PADDING,
 
183
                                                                        0,DEFAULT_PADDING);
 
184
        gbc.ipadx = 0;
 
185
        gbc.ipady = 0;
 
186
                
 
187
                panel.setLayout(chbag);
 
188
                
 
189
                /**
 
190
                 * Hidden because to dangerous, it transfort every damn anonymous
 
191
                 * into proxy user on remote server
 
192
                 *
 
193
                 * panel.add( _cbnsproxiedauthorization, gbc );
 
194
                 * gbc.gridy++;
 
195
                 */
 
196
 
 
197
                gbc.gridwidth  = gbc.REMAINDER;
 
198
                gbc.fill = gbc.NONE;
 
199
                panel.add(_cbnschecklocalaci, gbc );
 
200
                gbc.fill = gbc.HORIZONTAL;
 
201
                gbc.gridy++;
 
202
        gbc.gridx = 0;
 
203
                gbc.insets.top = DEFAULT_PADDING;
 
204
 
 
205
                gbc.gridwidth  = 1;
 
206
                addEntryField( panel,
 
207
                                           gbc,
 
208
                                           _lfnshoplimit,
 
209
                                           _tfnshoplimit);
 
210
 
 
211
                gbc.insets = new Insets(0, 0, 0, 0);
 
212
                gbc.gridy++;
 
213
                gbc.fill =gbc.VERTICAL;
 
214
                gbc.weighty = 1.0;
 
215
                gbc.gridwidth = gbc.REMAINDER;
 
216
                panel.add(Box.createVerticalGlue(), gbc);               
 
217
        }
 
218
 
 
219
 
 
220
        private void createConnMgt( JPanel panel ) {
 
221
        
 
222
                GridBagLayout chbag = new GridBagLayout();
 
223
                GridBagConstraints gbc = new GridBagConstraints() ;
 
224
        gbc.gridx      = 0;
 
225
        gbc.gridy      = 0;
 
226
        gbc.gridwidth    = 1;
 
227
        gbc.gridheight = 1;
 
228
        gbc.weightx    = 1;
 
229
        gbc.weighty    = 0;
 
230
        gbc.fill       = gbc.HORIZONTAL;
 
231
        gbc.anchor     = gbc.NORTHWEST;
 
232
        gbc.insets     = new Insets(0,DEFAULT_PADDING,
 
233
                                                                        0,DEFAULT_PADDING);
 
234
        gbc.ipadx = 0;
 
235
        gbc.ipady = 0;
 
236
                
 
237
                panel.setLayout(chbag);
 
238
                
 
239
                gbc.gridy++;
 
240
        gbc.gridx = 0;
 
241
                //              JLabel lmax = makeJLabel( _section, "shared-label-max-conn");
 
242
                //              panel.add( lmax, gbc );
 
243
                //              gbc.gridx = 1;
 
244
                addEntryField( panel,
 
245
                                           gbc,
 
246
                                           _lfnsbindconnectionslimit,
 
247
                                           _tfnsbindconnectionslimit );
 
248
                addEntryField( panel,
 
249
                                           gbc,
 
250
                                           _lfnsoperationconnectionslimit,
 
251
                                           _tfnsoperationconnectionslimit );
 
252
 
 
253
                gbc.insets.top = DEFAULT_PADDING;
 
254
                gbc.gridy++;
 
255
        gbc.gridx = 0;
 
256
                //              JLabel lbind = makeJLabel( _section, "shared-label-bind");
 
257
                //              panel.add( lbind, gbc );
 
258
                //              gbc.gridx = 1;
 
259
                addEntryField( panel,
 
260
                                           gbc,
 
261
                                           _lfnsbindtimeout,
 
262
                                           _tfnsbindtimeout );
 
263
                addEntryField( panel,
 
264
                                           gbc,
 
265
                                           _lfnsbindretrylimit,
 
266
                                           _tfnsbindretrylimit );               
 
267
 
 
268
                gbc.gridy++;
 
269
        gbc.gridx = 0;
 
270
                addEntryField( panel,
 
271
                                           gbc,
 
272
                                           _lfnsconcurrentbindlimit,
 
273
                                           _tfnsconcurrentbindlimit );
 
274
 
 
275
                addEntryField( panel,
 
276
                                           gbc,
 
277
                                           _lfnsconcurrentoperationslimit,
 
278
                                           _tfnsconcurrentoperationslimit );
 
279
                gbc.gridy++;
 
280
        gbc.gridx = 0;
 
281
 
 
282
                addEntryField( panel,
 
283
                                           gbc,
 
284
                                           _lfnsabandonedsearchcheckinterval,
 
285
                                           _tfnsabandonedsearchcheckinterval);
 
286
                addEntryField( panel,
 
287
                                           gbc,
 
288
                                           _lfnsconnectionlife,
 
289
                                           _tfnsconnectionlife );
 
290
                
 
291
                gbc.insets = new Insets(0, 0, 0, 0);
 
292
                gbc.gridy++;
 
293
                gbc.fill =gbc.VERTICAL;
 
294
                gbc.weighty = 1.0;
 
295
                gbc.gridwidth = gbc.REMAINDER;
 
296
                panel.add(Box.createVerticalGlue(), gbc);
 
297
 
 
298
        }
 
299
 
 
300
    protected void addEntryField( JPanel panel, 
 
301
                                                                  GridBagConstraints gbc,
 
302
                                                                  JComponent label,
 
303
                                                                  JComponent field, 
 
304
                                                                  JLabel label2 ) {
 
305
                Component endGlue = STRETCH_FIELDS ? null : Box.createGlue();
 
306
                Component lastItem =
 
307
                        STRETCH_FIELDS ? ((label2 != null) ? label2 : field) : endGlue;
 
308
                gbc.fill = gbc.NONE;
 
309
                gbc.weightx = 0.0;
 
310
        gbc.gridwidth = 1;
 
311
                //              gbc.gridx = 0;
 
312
                gbc.anchor = gbc.EAST;
 
313
                int space = UIFactory.getComponentSpace();
 
314
                gbc.insets = new Insets( space, space, 0, space/2 );
 
315
                panel.add( label, gbc );
 
316
 
 
317
                gbc.gridx++;
 
318
                gbc.anchor = gbc.WEST;
 
319
                gbc.insets = new Insets( space, 0, 0, 0 );
 
320
                if ( STRETCH_FIELDS ) {
 
321
                        gbc.fill = gbc.HORIZONTAL;
 
322
                        gbc.weightx = 1.0;
 
323
                }
 
324
                gbc.gridwidth = (lastItem == field) ? gbc.REMAINDER : 1;
 
325
                panel.add( field, gbc );
 
326
 
 
327
                if ( label2 != null ) {
 
328
                        gbc.gridx++;
 
329
                        gbc.fill = gbc.NONE;
 
330
                        gbc.weightx = 0.0;
 
331
                        gbc.insets = new Insets( space, space/2, 0, 0 );
 
332
                        gbc.gridwidth = (lastItem == label2) ? gbc.REMAINDER : 1;
 
333
                        panel.add( label2, gbc );
 
334
                }
 
335
 
 
336
                if ( !STRETCH_FIELDS ) {
 
337
                        gbc.gridx++;
 
338
                        gbc.anchor = gbc.EAST;
 
339
                        gbc.fill = gbc.HORIZONTAL;
 
340
                        gbc.weightx = 1.0;
 
341
                        gbc.gridwidth = gbc.REMAINDER;
 
342
                        panel.add( endGlue, gbc );
 
343
                }
 
344
        }
 
345
 
 
346
    /**
 
347
         * Add a label and a textfield to a panel, assumed to be using
 
348
         * GridBagLayout.
 
349
         */
 
350
    protected void addEntryField( JPanel panel,
 
351
                                                                  GridBagConstraints gbc,
 
352
                                                                  JComponent label,
 
353
                                                                  JComponent field ) {
 
354
                addEntryField( panel, gbc, label, field, null );
 
355
        }
 
356
 
 
357
        private void linkData() {
 
358
                //              String defDN = DEFAULT_PREFIX + _dnEntry;
 
359
                DSEntrySet entries = getDSEntrySet();
 
360
 
 
361
                /* nsslapd-timelimit */
 
362
                _tfnsslapd_timelimit = makeNumericalJTextField( _section,
 
363
                                                                                                                "nsslapd-timelimit");
 
364
                _lfnsslapd_timelimit = makeJLabel( _section,
 
365
                                                                                   "nsslapd-timelimit");
 
366
                _lfnsslapd_timelimit.setLabelFor(_tfnsslapd_timelimit);
 
367
                lns_timelimit_unit = makeJLabel( _section,
 
368
                                                                                 "nsslapd-timelimit-unit");
 
369
                lns_timelimit_unit.setLabelFor(_tfnsslapd_timelimit);
 
370
 
 
371
                DSEntryInteger nsTimelimitDSEntry = new DSEntryInteger( null,
 
372
                                                                                                _tfnsslapd_timelimit,
 
373
                                                                                                _lfnsslapd_timelimit,
 
374
                                                                                                TIMELIMIT_MIN_VAL,
 
375
                                                                                                TIMELIMIT_MAX_VAL,
 
376
                                                                                                1 );
 
377
                entries.add( _dnEntry,
 
378
                                         TIMELIMIT_ATTR,
 
379
                                         nsTimelimitDSEntry );
 
380
 
 
381
                setComponentTable( _tfnsslapd_timelimit,
 
382
                                                   nsTimelimitDSEntry );
 
383
 
 
384
                                                  
 
385
                /* nsslapd-sizelimit */
 
386
                _tfnsslapd_sizelimit = makeNumericalJTextField(_section,
 
387
                                                                                                           "nsslapd-sizelimit");
 
388
                _lfnsslapd_sizelimit = makeJLabel(_section,
 
389
                                                                                  "nsslapd-sizelimit");
 
390
                _lfnsslapd_sizelimit.setLabelFor(_tfnsslapd_sizelimit);
 
391
                lns_sizelimit_unit = makeJLabel(_section,
 
392
                                                                                           "nsslapd-sizelimit-unit");
 
393
                lns_sizelimit_unit.setLabelFor(_tfnsslapd_sizelimit);
 
394
 
 
395
                DSEntryInteger nsSizelimitDSEntry = new DSEntryInteger( null,
 
396
                                                                                                _tfnsslapd_sizelimit,
 
397
                                                                                                _lfnsslapd_sizelimit,
 
398
                                                                                                SIZELIMIT_MIN_VAL,
 
399
                                                                                                SIZELIMIT_MAX_VAL,
 
400
                                                                                                1 );
 
401
                entries.add( _dnEntry,
 
402
                                         SIZELIMIT_ATTR,
 
403
                                         nsSizelimitDSEntry );
 
404
 
 
405
                setComponentTable( _tfnsslapd_sizelimit,
 
406
                                                   nsSizelimitDSEntry );
 
407
 
 
408
                
 
409
                /* nsbindconnectionslimit */
 
410
                _tfnsbindconnectionslimit = makeNumericalJTextField( _section,
 
411
                                                                                                "nsbindconnectionslimit");
 
412
                _lfnsbindconnectionslimit = makeJLabel( _section,
 
413
                                                                                                "nsbindconnectionslimit");
 
414
                _lfnsbindconnectionslimit.setLabelFor(_tfnsbindconnectionslimit);
 
415
                lnsbindconnectionslimit_unit = makeJLabel( _section,
 
416
                                                                                                "nsbindconnectionslimit-unit");
 
417
                
 
418
                DSEntryInteger nsBindConnDSEntry = new DSEntryInteger( null,
 
419
                                                                                                _tfnsbindconnectionslimit,
 
420
                                                                                                _lfnsbindconnectionslimit,
 
421
                                                                                                1,
 
422
                                                                                                50,
 
423
                                                                                                1 );
 
424
                entries.add( _dnEntry,
 
425
                                         BINDCONNDSENTRY_ATTR,
 
426
                                         nsBindConnDSEntry );
 
427
 
 
428
                setComponentTable( _tfnsbindconnectionslimit,
 
429
                                                   nsBindConnDSEntry );
 
430
 
 
431
                /* nsoperationconnectionslimit */
 
432
                _tfnsoperationconnectionslimit = makeNumericalJTextField( _section,
 
433
                                                                                                "nsoperationconnectionslimit");
 
434
                _lfnsoperationconnectionslimit = makeJLabel( _section,
 
435
                                                                                                "nsoperationconnectionslimit");
 
436
                _lfnsoperationconnectionslimit.setLabelFor(_tfnsoperationconnectionslimit);
 
437
                lnsoperationconnectionslimit_unit = makeJLabel( _section,
 
438
                                                                                                "nsoperationconnectionslimit-unit");
 
439
                
 
440
                DSEntryInteger nsoperationconnectionslimitDSEntry = 
 
441
                                                                                new DSEntryInteger( null,
 
442
                                                                                                _tfnsoperationconnectionslimit,
 
443
                                                                                                _lfnsoperationconnectionslimit,
 
444
                                                                                                1,
 
445
                                                                                                50,
 
446
                                                                                                1 );
 
447
                entries.add( _dnEntry,
 
448
                                         OPCONLIMIT_ATTR,
 
449
                                         nsoperationconnectionslimitDSEntry );
 
450
 
 
451
                setComponentTable( _tfnsoperationconnectionslimit,
 
452
                                                   nsoperationconnectionslimitDSEntry );                
 
453
 
 
454
                /* nsabandonedsearchcheckinterval */
 
455
                _tfnsabandonedsearchcheckinterval = makeNumericalJTextField( _section,
 
456
                                                                                                "nsabandonedsearchcheckinterval");
 
457
                _lfnsabandonedsearchcheckinterval = makeJLabel( _section,
 
458
                                                                                                "nsabandonedsearchcheckinterval");
 
459
                _lfnsabandonedsearchcheckinterval.setLabelFor(_tfnsabandonedsearchcheckinterval);
 
460
                lnsabandonedsearchcheckinterval_unit = makeJLabel( _section,
 
461
                                                                                                "nsabandonedsearchcheckinterval-unit");
 
462
                
 
463
                DSEntryInteger nsabandonedsearchcheckintervalDSEntry = 
 
464
                                                        new DSEntryInteger( null,
 
465
                                                                                                _tfnsabandonedsearchcheckinterval,
 
466
                                                                                                _lfnsabandonedsearchcheckinterval,
 
467
                                                                                                0,
 
468
                                                                                                MAX_INT_VAL,
 
469
                                                                                                1 );
 
470
                entries.add( _dnEntry,
 
471
                                         ABANDON_ATTR,
 
472
                                         nsabandonedsearchcheckintervalDSEntry );
 
473
 
 
474
                setComponentTable( _tfnsabandonedsearchcheckinterval,
 
475
                                                   nsabandonedsearchcheckintervalDSEntry );     
 
476
        
 
477
                /* nsconcurrentbindlimit */
 
478
                _tfnsconcurrentbindlimit = makeNumericalJTextField( _section,
 
479
                                                                                                "nsconcurrentbindlimit");
 
480
                _lfnsconcurrentbindlimit = makeJLabel( _section,
 
481
                                                                                                "nsconcurrentbindlimit");
 
482
                _lfnsconcurrentbindlimit.setLabelFor(_tfnsconcurrentbindlimit);
 
483
                lnsconcurrentbindlimit_unit = makeJLabel( _section,
 
484
                                                                                                "nsconcurrentbindlimit-unit");
 
485
                
 
486
                DSEntryInteger nsconcurrentbindlimitDSEntry = new DSEntryInteger( null,
 
487
                                                                                                _tfnsconcurrentbindlimit,
 
488
                                                                                                _lfnsconcurrentbindlimit,
 
489
                                                                                                1,
 
490
                                                                                                25,
 
491
                                                                                                1 );
 
492
                entries.add( _dnEntry,
 
493
                                         CONBINDLIMIT_ATTR,
 
494
                                         nsconcurrentbindlimitDSEntry );
 
495
 
 
496
                setComponentTable( _tfnsconcurrentbindlimit,
 
497
                                                   nsconcurrentbindlimitDSEntry );              
 
498
 
 
499
                /* nsconcurrentoperationslimit */
 
500
                _tfnsconcurrentoperationslimit = makeNumericalJTextField( _section,
 
501
                                                                                                "nsconcurrentoperationslimit");
 
502
                _lfnsconcurrentoperationslimit = makeJLabel( _section,
 
503
                                                                                                "nsconcurrentoperationslimit");
 
504
                _lfnsconcurrentoperationslimit.setLabelFor(_tfnsconcurrentoperationslimit);
 
505
                lnsconcurrentoperationslimit_unit = makeJLabel( _section,
 
506
                                                                                                "nsconcurrentoperationslimit-unit");
 
507
                
 
508
                DSEntryInteger nsconcurrentoperationslimitDSEntry = new DSEntryInteger( null,
 
509
                                                                                                _tfnsconcurrentoperationslimit,
 
510
                                                                                                _lfnsconcurrentoperationslimit,
 
511
                                                                                                1,
 
512
                                                                                                50,
 
513
                                                                                                1 );
 
514
                entries.add( _dnEntry,
 
515
                                         CONOPLIMIT_ATTR,
 
516
                                         nsconcurrentoperationslimitDSEntry );
 
517
 
 
518
                setComponentTable( _tfnsconcurrentoperationslimit,
 
519
                                                   nsconcurrentoperationslimitDSEntry );                
 
520
                /* nsproxiedauthorization */
 
521
                _cbnsproxiedauthorization = makeJCheckBox( _section,
 
522
                                                                                                   "nsproxiedauthorization",
 
523
                                                                                                   true);
 
524
                
 
525
                DSEntryBoolean  nsproxiedauthorizationDSEntry = new DSEntryBoolean( "1",
 
526
                                                                                                _cbnsproxiedauthorization );
 
527
                entries.add( _dnEntry,
 
528
                                         PROXAUTH_ATTR,
 
529
                                         nsproxiedauthorizationDSEntry );
 
530
 
 
531
                setComponentTable( _cbnsproxiedauthorization,
 
532
                                                   nsproxiedauthorizationDSEntry );
 
533
 
 
534
                /* nsconnectionlife */
 
535
                _tfnsconnectionlife = makeNumericalJTextField( _section,
 
536
                                                                                                "nsconnectionlife");
 
537
                _lfnsconnectionlife = makeJLabel( _section,
 
538
                                                                                                "nsconnectionlife");
 
539
                _lfnsconnectionlife.setLabelFor(_tfnsconnectionlife);
 
540
                lnsconnectionlife_unit = makeJLabel( _section,
 
541
                                                                                                "nsconnectionlife-unit");
 
542
                
 
543
                DSEntryInteger nsconnectionlifeDSEntry = new DSEntryInteger( null,
 
544
                                                                                                _tfnsconnectionlife,
 
545
                                                                                                _lfnsconnectionlife,
 
546
                                                                                                0,
 
547
                                                                                                MAX_INT_VAL,
 
548
                                                                                                1 );
 
549
                entries.add( _dnEntry,
 
550
                                         CONLIFE_ATTR,
 
551
                                         nsconnectionlifeDSEntry );
 
552
 
 
553
                setComponentTable( _tfnsconnectionlife,
 
554
                                                   nsconnectionlifeDSEntry );
 
555
        
 
556
                /* nsbindtimeout */
 
557
                _tfnsbindtimeout = makeNumericalJTextField( _section,
 
558
                                                                                                "nsbindtimeout");
 
559
                _lfnsbindtimeout = makeJLabel( _section,
 
560
                                                                                                "nsbindtimeout");
 
561
                _lfnsbindtimeout.setLabelFor(_tfnsbindtimeout);
 
562
                lnsbindtimeout_unit = makeJLabel( _section,
 
563
                                                                                                "nsbindtimeout-unit");
 
564
                
 
565
                DSEntryInteger nsbindtimeoutDSEntry = new DSEntryInteger( null,
 
566
                                                                                                _tfnsbindtimeout,
 
567
                                                                                                _lfnsbindtimeout,
 
568
                                                                                                0,
 
569
                                                                                                BINDTIMEOUT_MAX_VAL,
 
570
                                                                                                1 );
 
571
                entries.add( _dnEntry,
 
572
                                         BINDTIMEOUT_ATTR,
 
573
                                         nsbindtimeoutDSEntry );
 
574
 
 
575
                setComponentTable( _tfnsbindtimeout,
 
576
                                                   nsbindtimeoutDSEntry );
 
577
 
 
578
                /* nsreferralonscopedsearch */
 
579
                _cbnsreferralonscopedsearch = makeJCheckBox( _section,
 
580
                                                                                                "nsreferralonscopedsearch",
 
581
                                                                                                 true );
 
582
                
 
583
                DSEntryBoolean nsreferralonscopedsearchDSEntry = new DSEntryBoolean( "0",
 
584
                                                                                                _cbnsreferralonscopedsearch );
 
585
                entries.add( _dnEntry,
 
586
                                         REFONSEARCH_ATTR,
 
587
                                         nsreferralonscopedsearchDSEntry );
 
588
 
 
589
                setComponentTable( _cbnsreferralonscopedsearch,
 
590
                                                   nsreferralonscopedsearchDSEntry );
 
591
                
 
592
                /* nschecklocalaci */
 
593
                _cbnschecklocalaci = makeJCheckBox( _section,
 
594
                                                                                        "nschecklocalaci");
 
595
                
 
596
                DSEntryBoolean nschecklocalaciDSEntry = new DSEntryBoolean( "0",
 
597
                                                                                                _cbnschecklocalaci );
 
598
                entries.add( _dnEntry,
 
599
                                         CHECKLOCALACI_ATTR,
 
600
                                         nschecklocalaciDSEntry );
 
601
 
 
602
                setComponentTable( _cbnschecklocalaci,
 
603
                                                   nschecklocalaciDSEntry );            
 
604
 
 
605
                /* nsbindretrylimit */
 
606
                _tfnsbindretrylimit = makeNumericalJTextField( _section,
 
607
                                                                                                "nsbindretrylimit");
 
608
                _lfnsbindretrylimit = makeJLabel( _section,
 
609
                                                                                                "nsbindretrylimit");
 
610
                _lfnsbindretrylimit.setLabelFor(_tfnsbindretrylimit);
 
611
                
 
612
                DSEntryInteger nsbindretrylimitDSEntry = new DSEntryInteger( null,
 
613
                                                                                                _tfnsbindretrylimit,
 
614
                                                                                                _lfnsbindretrylimit,
 
615
                                                                                                0,
 
616
                                                                                                BINDRETRY_MAX_VAL,
 
617
                                                                                                1 );
 
618
                entries.add( _dnEntry,
 
619
                                         BINDRETRY_ATTR,
 
620
                                         nsbindretrylimitDSEntry );
 
621
 
 
622
                setComponentTable( _tfnsbindretrylimit,
 
623
                                                   nsbindretrylimitDSEntry );
 
624
                
 
625
                /* nshoplimit */
 
626
                _tfnshoplimit = makeNumericalJTextField( _section,
 
627
                                                                                                "nshoplimit");
 
628
                _lfnshoplimit = makeJLabel( _section,
 
629
                                                                                                "nshoplimit");
 
630
                _lfnshoplimit.setLabelFor(_tfnshoplimit);
 
631
                
 
632
                DSEntryInteger nshoplimitDSEntry = new DSEntryInteger( null,
 
633
                                                                                                _tfnshoplimit,
 
634
                                                                                                _lfnshoplimit,
 
635
                                                                                                0,
 
636
                                                                                                20,
 
637
                                                                                                1 );
 
638
                entries.add( _dnEntry,
 
639
                                         HOPLIMIT_ATTR,
 
640
                                         nshoplimitDSEntry );
 
641
 
 
642
                setComponentTable( _tfnshoplimit,
 
643
                                                   nshoplimitDSEntry );         
 
644
 
 
645
 
 
646
        }
 
647
 
 
648
 
 
649
        private IDSModel                        _model = null;
 
650
        private LDAPEntry                       _configEntry = null;
 
651
        private String                          _dnEntry;
 
652
        private JTextField                      _tfnsslapd_timelimit;
 
653
        private JLabel                          _lfnsslapd_timelimit;
 
654
        private JTextField                      _tfnsslapd_sizelimit;
 
655
        private JLabel                          _lfnsslapd_sizelimit;
 
656
        private JLabel                          _lfnsbindconnectionslimit;
 
657
        private JTextField                      _tfnsbindconnectionslimit;
 
658
        private JTextField                      _tfnsoperationconnectionslimit;
 
659
        private JLabel                          _lfnsoperationconnectionslimit;
 
660
        private JTextField                      _tfnsabandonedsearchcheckinterval;
 
661
        private JLabel                          _lfnsabandonedsearchcheckinterval;
 
662
        private JTextField                      _tfnsconcurrentbindlimit;
 
663
        private JLabel                          _lfnsconcurrentbindlimit;
 
664
        private JTextField                      _tfnsconcurrentoperationslimit;
 
665
        private JLabel                          _lfnsconcurrentoperationslimit;
 
666
        private JCheckBox                       _cbnsproxiedauthorization;
 
667
        private JTextField                      _tfnsconnectionlife;
 
668
        private JLabel                          _lfnsconnectionlife;
 
669
        private JTextField                      _tfnsbindtimeout;
 
670
        private JLabel                          _lfnsbindtimeout;
 
671
        private JCheckBox                       _cbnsreferralonscopedsearch;
 
672
        private JCheckBox                       _cbnschecklocalaci;
 
673
        private JTextField                      _tfnsbindretrylimit;
 
674
        private JLabel                          _lfnsbindretrylimit;
 
675
        private JTextField                      _tfnshoplimit;
 
676
        private JLabel                          _lfnshoplimit;
 
677
        private JLabel                          lns_sizelimit_unit;
 
678
        private JLabel                          lns_timelimit_unit;
 
679
        private JLabel                          lnsbindtimeout_unit;
 
680
        private JLabel                          lnsconnectionlife_unit;
 
681
        private JLabel                          lnsconcurrentoperationslimit_unit;
 
682
        private JLabel                          lnsconcurrentbindlimit_unit;
 
683
        private JLabel                          lnsabandonedsearchcheckinterval_unit;
 
684
        private JLabel                          lnsbindconnectionslimit_unit;
 
685
        private JLabel                          lnsoperationconnectionslimit_unit;
 
686
 
 
687
        private static final String TIMELIMIT_ATTR = "nsslapd-timelimit";
 
688
        private static final String SIZELIMIT_ATTR = "nsslapd-sizelimit";
 
689
        private static final String BINDCONNDSENTRY_ATTR = "nsbindconnectionslimit";
 
690
        private static final String OPCONLIMIT_ATTR = "nsoperationconnectionslimit";
 
691
        private static final String ABANDON_ATTR = "nsabandonedsearchcheckinterval";
 
692
        private static final String CONBINDLIMIT_ATTR = "nsconcurrentbindlimit";
 
693
        private static final String CONOPLIMIT_ATTR = "nsconcurrentoperationslimit";
 
694
        private static final String PROXAUTH_ATTR = "nsproxiedauthorization";
 
695
        private static final String CONLIFE_ATTR = "nsconnectionlife";
 
696
        private static final String BINDTIMEOUT_ATTR = "nsbindtimeout";
 
697
        private static final String REFONSEARCH_ATTR = "nsreferralonscopedsearch";
 
698
        private static final String CHECKLOCALACI_ATTR = "nschecklocalaci";
 
699
        private static final String BINDRETRY_ATTR = "nsbindretrylimit";
 
700
        private static final String HOPLIMIT_ATTR = "nshoplimit";
 
701
 
 
702
 
 
703
 
 
704
                                                                          
 
705
        private static final String DEFAULT_PREFIX = "cn=default instance config,";
 
706
        private static final String _section = "chaining-default";
 
707
        private static final int MAX_INT_VAL = 2147483647;
 
708
        private static final int TIMELIMIT_MAX_VAL = MAX_INT_VAL;
 
709
        private static final int TIMELIMIT_MIN_VAL = -1;
 
710
        private static final int SIZELIMIT_MAX_VAL = MAX_INT_VAL;
 
711
        private static final int SIZELIMIT_MIN_VAL = -1;                                                                
 
712
        private static final int BINDTIMEOUT_MAX_VAL = 3600;
 
713
        private static final int BINDRETRY_MAX_VAL = 10;
 
714
          
 
715
    //copy from BlankPanel
 
716
    final static int DEFAULT_PADDING = 6;
 
717
    final static Insets DEFAULT_EMPTY_INSETS = new Insets(0,0,0,0);
 
718
    final static Insets BOTTOM_INSETS = new Insets(6,6,6,6);
 
719
}
 
720