Source Code Cross Referenced for GlobalConfiguration.java in  » Authentication-Authorization » ejbca » org » ejbca » core » model » ra » raadmin » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Authentication Authorization » ejbca » org.ejbca.core.model.ra.raadmin 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*************************************************************************
002:         *                                                                       *
003:         *  EJBCA: The OpenSource Certificate Authority                          *
004:         *                                                                       *
005:         *  This software is free software; you can redistribute it and/or       *
006:         *  modify it under the terms of the GNU Lesser General Public           *
007:         *  License as published by the Free Software Foundation; either         *
008:         *  version 2.1 of the License, or any later version.                    *
009:         *                                                                       *
010:         *  See terms of license at gnu.org.                                     *
011:         *                                                                       *
012:         *************************************************************************/package org.ejbca.core.model.ra.raadmin;
013:
014:        import org.ejbca.core.model.UpgradeableDataHashMap;
015:
016:        /**
017:         * This is a  class containing global configuration parameters.
018:         *
019:         * @version $Id: GlobalConfiguration.java,v 1.12 2008/02/18 14:50:49 jeklund Exp $
020:         */
021:        public class GlobalConfiguration extends UpgradeableDataHashMap
022:                implements  java.io.Serializable {
023:
024:            // Default Values
025:            public static final float LATEST_VERSION = 2;
026:
027:            public static final String EJBCA_VERSION = "@ejbca.version@";
028:
029:            /**
030:             * Setting to indicate if the secret information stored on hard tokens (i.e initial PIN/PUK codes) should
031:             * be displayed for the administrators. If false only non-sensitive information is displayed.
032:             */
033:            public static final boolean HARDTOKEN_DIPLAYSENSITIVEINFO = "@hardtoken.diplaysensitiveinfo@"
034:                    .equalsIgnoreCase("true");
035:
036:            public static final String PREFEREDINTERNALRESOURCES = "@intresources.preferredlanguage@"
037:                    .trim();
038:            public static final String SECONDARYINTERNALRESOURCES = "@intresources.secondarylanguage@"
039:                    .trim();
040:
041:            // Entries to choose from in userpreference part, defines the size of data to be displayed on one page.
042:            private final String[] DEFAULTPOSSIBLEENTRIESPERPAGE = { "10",
043:                    "25", "50", "100" };
044:            // Entries to choose from in view log part, defines the size of data to be displayed on one page.
045:            private final String[] DEFAULTPOSSIBLELOGENTRIESPERPAGE = { "10",
046:                    "25", "50", "100", "200", "400" };
047:
048:            // Path added to baseurl used as default vaule in CRLDistributionPointURI field in Certificate Profile definitions.
049:            private static final String DEFAULTCRLDISTURIPATH = "publicweb/webdist/certdist?cmd=crl&issuer=";
050:
051:            // Path added to baseurl used as default vaule in CRLDistributionPointURI field in Certificate Profile definitions.
052:            private static final String DEFAULTCRLDISTURIPATHDN = "CN=TestCA,O=AnaTom,C=SE";
053:
054:            // Path added to baseurl used as default vaule in OCSP Service Locator URI field in Certificate Profile definitions.
055:            private static final String DEFAULTOCSPSERVICELOCATORURIPATH = "publicweb/status/ocsp";
056:
057:            // Default name of headbanner in web interface.
058:            private static final String DEFAULTHEADBANNER = "head_banner.jsp";
059:            // Default name of footbanner page in web interface.
060:            private static final String DEFAULTFOOTBANNER = "foot_banner.jsp";
061:
062:            // Title of ra admin web interface.
063:            private static final String DEFAULTEJBCATITLE = "@EJBCA@ Administration";
064:
065:            // Default values for AutoEnroll
066:            private static final String AUTOENROLL_DEFAULT_ADSERVER = "dc1.company.local";
067:            private static final int AUTOENROLL_DEFAULT_ADPORT = 0;
068:            private static final String AUTOENROLL_DEFAULT_BASEDN_USER = "CN=Users,DC=company,DC=local";
069:            public static final int AUTOENROLL_DEFAULT_CA = -1;
070:            private static final String AUTOENROLL_DEFAULT_CONNECTIONDN = "CN=ADReader,CN=Users,DC=company,DC=local";
071:            private static final String AUTOENROLL_DEFAULT_CONNECTIONPWD = "foo123";
072:            private static final boolean AUTOENROLL_DEFAULT_SSLCONNECTION = false;
073:            private static final boolean AUTOENROLL_DEFAULT_USE = false;
074:
075:            // Language codes. Observe the order is important
076:            public static final int EN = 0;
077:            public static final int SE = 1;
078:
079:            // Public constants.
080:            public static final String HEADERFRAME = "topFrame"; // Name of header browser frame
081:            public static final String MENUFRAME = "leftFrame"; // Name of menu browser frame
082:            public static final String MAINFRAME = "mainFrame"; // Name of main browser frame
083:
084:            /** Creates a new instance of Globaldatauration */
085:            public GlobalConfiguration() {
086:                super ();
087:
088:                setEjbcaTitle(DEFAULTEJBCATITLE);
089:                setEnableEndEntityProfileLimitations(true);
090:                setEnableAuthenticatedUsersOnly(false);
091:                setEnableKeyRecovery(false);
092:                setIssueHardwareTokens(false);
093:            }
094:
095:            /** Initializes a new global datauration with data used in ra web interface. */
096:            public void initialize(String adminpath, String availablelanguages,
097:                    String availablethemes, String publicport,
098:                    String privateport, String publicprotocol,
099:                    String privateprotocol) {
100:
101:                String tempadminpath = adminpath.trim();
102:
103:                if (tempadminpath == null)
104:                    tempadminpath = "";
105:                if (!tempadminpath.endsWith("/") && !tempadminpath.equals("")) {
106:                    tempadminpath = tempadminpath + "/"; // Add ending '/'
107:                }
108:                if (tempadminpath.startsWith("/")) {
109:                    tempadminpath = tempadminpath.substring(1); // Remove starting '/'
110:                }
111:
112:                data.put(ADMINPATH, tempadminpath);
113:                data.put(AVAILABLELANGUAGES, availablelanguages.trim());
114:                data.put(AVAILABLETHEMES, availablethemes.trim());
115:                data.put(PUBLICPORT, publicport.trim());
116:                data.put(PRIVATEPORT, privateport.trim());
117:                data.put(PUBLICPROTOCOL, publicprotocol.trim());
118:                data.put(PRIVATEPROTOCOL, privateprotocol.trim());
119:
120:                data.put(AUTHORIZATION_PATH, tempadminpath
121:                        + "administratorprivileges");
122:                data.put(BANNERS_PATH, "banners");
123:                data.put(CA_PATH, tempadminpath + "ca");
124:                data.put(CONFIG_PATH, tempadminpath + "sysconfig");
125:                data.put(HELP_PATH, "help");
126:                data.put(IMAGES_PATH, "images");
127:                data.put(LANGUAGE_PATH, "languages");
128:                data.put(LOG_PATH, tempadminpath + "log");
129:                data.put(REPORTS_PATH, tempadminpath + "reports");
130:                data.put(RA_PATH, tempadminpath + "ra");
131:                data.put(THEME_PATH, "themes");
132:                data.put(HARDTOKEN_PATH, tempadminpath + "hardtoken");
133:
134:                data.put(LANGUAGEFILENAME, "languagefile");
135:                data.put(MAINFILENAME, "main.jsp");
136:                data.put(INDEXFILENAME, "index.jsp");
137:                data.put(MENUFILENAME, "adminmenu.jsp");
138:                data.put(ERRORPAGE, "errorpage.jsp");
139:
140:                setHeadBanner(DEFAULTHEADBANNER);
141:                setFootBanner(DEFAULTFOOTBANNER);
142:
143:            }
144:
145:            /** Checks if global datauration have been initialized. */
146:            public boolean isInitialized() {
147:                return data.get(AVAILABLELANGUAGES) != null;
148:            }
149:
150:            /** Method used by the Admin GUI. */
151:            public String getBaseUrl(String requestServerName) {
152:                return (String) data.get(GlobalConfiguration.PRIVATEPROTOCOL)
153:                        + "://"
154:                        + requestServerName
155:                        + "/"
156:                        + (String) data
157:                                .get(GlobalConfiguration.APPLICATIONPATH);
158:            }
159:
160:            public String getBaseUrl() {
161:                return (String) data.get(GlobalConfiguration.PRIVATEPROTOCOL)
162:                        + "://"
163:                        + (String) data.get(GlobalConfiguration.COMPUTERNAME)
164:                        + ":"
165:                        + (String) data.get(GlobalConfiguration.PRIVATEPORT)
166:                        + "/"
167:                        + (String) data
168:                                .get(GlobalConfiguration.APPLICATIONPATH);
169:            }
170:
171:            public void setComputerName(String computername) {
172:                data.put(COMPUTERNAME, computername);
173:            }
174:
175:            public void setApplicationPath(String applicationpath) {
176:                // Add trailing '/' if it doesn't exists.
177:                if (!applicationpath.endsWith("/")) {
178:                    data.put(APPLICATIONPATH, applicationpath + "/");
179:                } else {
180:                    data.put(APPLICATIONPATH, applicationpath);
181:                }
182:            }
183:
184:            public String getAdminWebPath() {
185:                return (String) data.get(ADMINPATH);
186:            }
187:
188:            public String getStandardCRLDistributionPointURI() {
189:                String retval = getBaseUrl();
190:                retval = retval.replaceFirst(
191:                        (String) data.get(PRIVATEPROTOCOL), (String) data
192:                                .get(PUBLICPROTOCOL));
193:                retval = retval.replaceFirst((String) data.get(PRIVATEPORT),
194:                        (String) data.get(PUBLICPORT));
195:                retval += DEFAULTCRLDISTURIPATH + DEFAULTCRLDISTURIPATHDN;
196:                return retval;
197:            }
198:
199:            public String getStandardCRLDistributionPointURINoDN() {
200:                String retval = getBaseUrl();
201:                retval = retval.replaceFirst(
202:                        (String) data.get(PRIVATEPROTOCOL), (String) data
203:                                .get(PUBLICPROTOCOL));
204:                retval = retval.replaceFirst((String) data.get(PRIVATEPORT),
205:                        (String) data.get(PUBLICPORT));
206:                retval += DEFAULTCRLDISTURIPATH;
207:                return retval;
208:            }
209:
210:            public String getStandardOCSPServiceLocatorURI() {
211:                String retval = getBaseUrl();
212:                retval = retval.replaceFirst(
213:                        (String) data.get(PRIVATEPROTOCOL), (String) data
214:                                .get(PUBLICPROTOCOL));
215:                retval = retval.replaceFirst((String) data.get(PRIVATEPORT),
216:                        (String) data.get(PUBLICPORT));
217:                retval += DEFAULTOCSPSERVICELOCATORURIPATH;
218:                return retval;
219:            }
220:
221:            /** Checks the themes paht for css files and returns an array of filenames
222:             *  without the ".css" ending. */
223:            public String[] getAvailableThemes() {
224:                String[] availablethemes;
225:                availablethemes = getAvailableThemesAsString().split(",");
226:                if (availablethemes != null) {
227:                    for (int i = 0; i < availablethemes.length; i++) {
228:                        availablethemes[i] = availablethemes[i].trim();
229:                        if (availablethemes[i].endsWith(".css")) {
230:                            availablethemes[i] = availablethemes[i].substring(
231:                                    0, availablethemes[i].length() - 4);
232:                        }
233:                    }
234:                }
235:                return availablethemes;
236:            }
237:
238:            /** Returns the default avaiable theme used by administrator preferences. */
239:            public String getDefaultAvailableTheme() {
240:                return getAvailableThemes()[0];
241:            }
242:
243:            // Methods for manipulating the headbanner filename.
244:            public String getHeadBanner() {
245:                return (String) data.get(HEADBANNER);
246:            }
247:
248:            public String getHeadBannerFilename() {
249:                String returnval = (String) data.get(HEADBANNER);
250:                return returnval.substring(returnval.lastIndexOf('/') + 1);
251:            }
252:
253:            public void setHeadBanner(String head) {
254:                data.put(HEADBANNER, ((String) data.get(ADMINPATH))
255:                        + ((String) data.get(BANNERS_PATH)) + "/" + head);
256:            }
257:
258:            // Methods for manipulating the headbanner filename.
259:            public String getFootBanner() {
260:                return (String) data.get(FOOTBANNER);
261:            }
262:
263:            public String getFootBannerFilename() {
264:                String returnval = (String) data.get(FOOTBANNER);
265:                return returnval.substring(returnval.lastIndexOf('/') + 1);
266:            }
267:
268:            public void setFootBanner(String foot) {
269:                data.put(FOOTBANNER, "/" + ((String) data.get(BANNERS_PATH))
270:                        + "/" + foot);
271:            }
272:
273:            // Methods for manipulating the title.
274:            public String getEjbcaTitle() {
275:                return (String) data.get(TITLE);
276:            }
277:
278:            public void setEjbcaTitle(String ejbcatitle) {
279:                data.put(TITLE, ejbcatitle);
280:            }
281:
282:            public String getAuthorizationPath() {
283:                return (String) data.get(AUTHORIZATION_PATH);
284:            }
285:
286:            public String getBannersPath() {
287:                return (String) data.get(BANNERS_PATH);
288:            }
289:
290:            public String getCaPath() {
291:                return (String) data.get(CA_PATH);
292:            }
293:
294:            public String getConfigPath() {
295:                return (String) data.get(CONFIG_PATH);
296:            }
297:
298:            public String getHelpPath() {
299:                return (String) data.get(HELP_PATH);
300:            }
301:
302:            public String getImagesPath() {
303:                return (String) data.get(IMAGES_PATH);
304:            }
305:
306:            public String getLanguagePath() {
307:                return (String) data.get(LANGUAGE_PATH);
308:            }
309:
310:            public String getLogPath() {
311:                return (String) data.get(LOG_PATH);
312:            }
313:
314:            public String getReportsPath() {
315:                return (String) data.get(REPORTS_PATH);
316:            }
317:
318:            public String getRaPath() {
319:                return (String) data.get(RA_PATH);
320:            }
321:
322:            public String getThemePath() {
323:                return (String) data.get(THEME_PATH);
324:            }
325:
326:            public String getHardTokenPath() {
327:                return (String) data.get(HARDTOKEN_PATH);
328:            }
329:
330:            public String getLanguageFilename() {
331:                return (String) data.get(LANGUAGEFILENAME);
332:            }
333:
334:            public String getMainFilename() {
335:                return (String) data.get(MAINFILENAME);
336:            }
337:
338:            public String getIndexFilename() {
339:                return (String) data.get(INDEXFILENAME);
340:            }
341:
342:            public String getMenuFilename() {
343:                return (String) data.get(MENUFILENAME);
344:            }
345:
346:            public String getErrorPage() {
347:                return (String) data.get(ERRORPAGE);
348:            }
349:
350:            public String[] getPossibleEntiresPerPage() {
351:                return DEFAULTPOSSIBLEENTRIESPERPAGE;
352:            }
353:
354:            public String[] getPossibleLogEntiresPerPage() {
355:                return DEFAULTPOSSIBLELOGENTRIESPERPAGE;
356:            }
357:
358:            public String getAvailableLanguagesAsString() {
359:                return (String) data.get(AVAILABLELANGUAGES);
360:            }
361:
362:            public String getAvailableThemesAsString() {
363:                return (String) data.get(AVAILABLETHEMES);
364:            }
365:
366:            public boolean getEnableEndEntityProfileLimitations() {
367:                return ((Boolean) data.get(ENABLEEEPROFILELIMITATIONS))
368:                        .booleanValue();
369:            }
370:
371:            public void setEnableEndEntityProfileLimitations(boolean value) {
372:                data.put(ENABLEEEPROFILELIMITATIONS, Boolean.valueOf(value));
373:            }
374:
375:            public boolean getEnableAuthenticatedUsersOnly() {
376:                return ((Boolean) data.get(ENABLEAUTHENTICATEDUSERSONLY))
377:                        .booleanValue();
378:            }
379:
380:            public void setEnableAuthenticatedUsersOnly(boolean value) {
381:                data.put(ENABLEAUTHENTICATEDUSERSONLY, Boolean.valueOf(value));
382:            }
383:
384:            public boolean getEnableKeyRecovery() {
385:                return ((Boolean) data.get(ENABLEKEYRECOVERY)).booleanValue();
386:            }
387:
388:            public void setEnableKeyRecovery(boolean value) {
389:                data.put(ENABLEKEYRECOVERY, Boolean.valueOf(value));
390:            }
391:
392:            public boolean getIssueHardwareTokens() {
393:                return ((Boolean) data.get(ISSUEHARDWARETOKENS)).booleanValue();
394:            }
395:
396:            public void setIssueHardwareTokens(boolean value) {
397:                data.put(ISSUEHARDWARETOKENS, Boolean.valueOf(value));
398:            }
399:
400:            /**
401:             * @return the number of required approvals to access sensitive hard token data (default 0)
402:             */
403:            public int getNumberOfApprovalsToViewPUK() {
404:                Object num = data.get(NUMBEROFAPPROVALSTOVIEWPUK);
405:                if (num == null) {
406:                    return 0;
407:                }
408:
409:                return ((Integer) num).intValue();
410:            }
411:
412:            public void setNumberOfApprovalsToViewPUK(
413:                    int numberOfHardTokenApprovals) {
414:                data.put(NUMBEROFAPPROVALSTOVIEWPUK, new Integer(
415:                        numberOfHardTokenApprovals));
416:            }
417:
418:            /**
419:             * @return the caid of the CA that should encrypt hardtoken data in the database. if CAid is 0 is the data stored unencrypted.
420:             */
421:            public int getHardTokenEncryptCA() {
422:                Object num = data.get(HARDTOKENENCRYPTCA);
423:                if (num == null) {
424:                    return 0;
425:                }
426:
427:                return ((Integer) num).intValue();
428:            }
429:
430:            /**
431:             * @param hardTokenEncryptCA the caid of the CA that should encrypt hardtoken data in the database. if CAid is 0 is the data stored unencrypted.
432:             */
433:            public void setHardTokenEncryptCA(int hardTokenEncryptCA) {
434:                data.put(HARDTOKENENCRYPTCA, new Integer(hardTokenEncryptCA));
435:            }
436:
437:            /**
438:             * @return true of email notification of requested approvals should be sent (default false)
439:             */
440:            public boolean getUseApprovalNotifications() {
441:                Object value = data.get(USEAPPROVALNOTIFICATIONS);
442:                if (value == null) {
443:                    return false;
444:                }
445:
446:                return ((Boolean) value).booleanValue();
447:            }
448:
449:            public void setUseApprovalNotifications(
450:                    boolean useApprovalNotifications) {
451:                data.put(USEAPPROVALNOTIFICATIONS, Boolean
452:                        .valueOf(useApprovalNotifications));
453:            }
454:
455:            /**
456:             * Returns the email address to the administrators that should recieve notification emails
457:             * should be an alias to all approval administrators default "" never null
458:             */
459:            public String getApprovalAdminEmailAddress() {
460:                Object value = data.get(APPROVALADMINEMAILADDRESS);
461:                if (value == null) {
462:                    return "";
463:                }
464:
465:                return (String) value;
466:            }
467:
468:            public void setApprovalAdminEmailAddress(
469:                    String approvalAdminEmailAddress) {
470:                data.put(APPROVALADMINEMAILADDRESS, approvalAdminEmailAddress);
471:            }
472:
473:            /**
474:             * Returns the email address used in the from field of approval notification emails
475:             */
476:            public String getApprovalNotificationFromAddress() {
477:                Object value = data.get(APPROVALNOTIFICATIONFROMADDR);
478:                if (value == null) {
479:                    return "";
480:                }
481:
482:                return (String) value;
483:            }
484:
485:            public void setApprovalNotificationFromAddress(
486:                    String approvalNotificationFromAddress) {
487:                data.put(APPROVALNOTIFICATIONFROMADDR,
488:                        approvalNotificationFromAddress);
489:            }
490:
491:            public void setAutoEnrollADServer(String server) {
492:                data.put(AUTOENROLL_ADSERVER, server);
493:            }
494:
495:            public String getAutoEnrollADServer() {
496:                String ret = (String) data.get(AUTOENROLL_ADSERVER);
497:                return (ret == null ? AUTOENROLL_DEFAULT_ADSERVER : ret);
498:            }
499:
500:            public void setAutoEnrollADPort(int caid) {
501:                data.put(AUTOENROLL_ADPORT, new Integer(caid));
502:            }
503:
504:            public int getAutoEnrollADPort() {
505:                Integer ret = (Integer) data.get(AUTOENROLL_ADPORT);
506:                return (ret == null ? AUTOENROLL_DEFAULT_ADPORT : ret);
507:            }
508:
509:            public void setAutoEnrollBaseDNUser(String baseDN) {
510:                data.put(AUTOENROLL_BASEDN_USER, baseDN);
511:            }
512:
513:            public String getAutoEnrollBaseDNUser() {
514:                String ret = (String) data.get(AUTOENROLL_BASEDN_USER);
515:                return (ret == null ? AUTOENROLL_DEFAULT_BASEDN_USER : ret);
516:            }
517:
518:            public void setAutoEnrollCA(int caid) {
519:                data.put(AUTOENROLL_CA, new Integer(caid));
520:            }
521:
522:            public int getAutoEnrollCA() {
523:                Integer ret = (Integer) data.get(AUTOENROLL_CA);
524:                return (ret == null ? AUTOENROLL_DEFAULT_CA : ret);
525:            }
526:
527:            public void setAutoEnrollConnectionDN(String connectionDN) {
528:                data.put(AUTOENROLL_CONNECTIONDN, connectionDN);
529:            }
530:
531:            public String getAutoEnrollConnectionDN() {
532:                String ret = (String) data.get(AUTOENROLL_CONNECTIONDN);
533:                return (ret == null ? AUTOENROLL_DEFAULT_CONNECTIONDN : ret);
534:            }
535:
536:            public void setAutoEnrollConnectionPwd(String connectionDN) {
537:                data.put(AUTOENROLL_CONNECTIONPWD, connectionDN);
538:            }
539:
540:            public String getAutoEnrollConnectionPwd() {
541:                String ret = (String) data.get(AUTOENROLL_CONNECTIONPWD);
542:                return (ret == null ? AUTOENROLL_DEFAULT_CONNECTIONPWD : ret);
543:            }
544:
545:            public void setAutoEnrollSSLConnection(boolean use) {
546:                data.put(AUTOENROLL_SSLCONNECTION, Boolean.valueOf(use));
547:            }
548:
549:            public boolean getAutoEnrollSSLConnection() {
550:                Boolean ret = (Boolean) data.get(AUTOENROLL_SSLCONNECTION);
551:                return (ret == null ? AUTOENROLL_DEFAULT_SSLCONNECTION : ret);
552:            }
553:
554:            public void setAutoEnrollUse(boolean use) {
555:                data.put(AUTOENROLL_USE, Boolean.valueOf(use));
556:            }
557:
558:            public boolean getAutoEnrollUse() {
559:                Boolean ret = (Boolean) data.get(AUTOENROLL_USE);
560:                return (ret == null ? AUTOENROLL_DEFAULT_USE : ret);
561:            }
562:
563:            /** Implemtation of UpgradableDataHashMap function getLatestVersion */
564:            public float getLatestVersion() {
565:                return LATEST_VERSION;
566:            }
567:
568:            /** Implemtation of UpgradableDataHashMap function upgrade. */
569:
570:            public void upgrade() {
571:                if (Float.compare(LATEST_VERSION, getVersion()) != 0) {
572:                    // New version of the class, upgrade
573:                    if (data.get(HARDTOKEN_PATH) == null) {
574:                        data.put(HARDTOKEN_PATH,
575:                                ((String) data.get(ADMINPATH) + "hardtoken"));
576:                    }
577:                    if (data.get(REPORTS_PATH) == null) {
578:                        data.put(REPORTS_PATH,
579:                                ((String) data.get(ADMINPATH) + "reports"));
580:                    }
581:
582:                    data.put(VERSION, new Float(LATEST_VERSION));
583:                }
584:            }
585:
586:            // Private fields.
587:
588:            // Private constants
589:            //private static final   String BASEURL             = "baseurl";
590:            private static final String COMPUTERNAME = "computername";
591:            private static final String APPLICATIONPATH = "applicationpath";
592:            private static final String ADMINPATH = "raadminpath";
593:            private static final String AVAILABLELANGUAGES = "availablelanguages";
594:            private static final String AVAILABLETHEMES = "availablethemes";
595:            private static final String PUBLICPORT = "publicport";
596:            private static final String PRIVATEPORT = "privateport";
597:            private static final String PUBLICPROTOCOL = "publicprotocol";
598:            private static final String PRIVATEPROTOCOL = "privateprotocol";
599:
600:            // Title
601:            private static final String TITLE = "title";
602:            // Banner files.
603:            private static final String HEADBANNER = "headbanner";
604:            private static final String FOOTBANNER = "footbanner";
605:            // Other configuration.
606:            private static final String ENABLEEEPROFILELIMITATIONS = "endentityprofilelimitations";
607:            private static final String ENABLEAUTHENTICATEDUSERSONLY = "authenticatedusersonly";
608:            private static final String ENABLEKEYRECOVERY = "enablekeyrecovery";
609:            private static final String ISSUEHARDWARETOKENS = "issuehardwaretokens";
610:
611:            private static final String NUMBEROFAPPROVALSTOVIEWPUK = "numberofapprovalstoviewpuk";
612:            private static final String HARDTOKENENCRYPTCA = "hardtokenencryptca";
613:            private static final String USEAPPROVALNOTIFICATIONS = "useapprovalnotifications";
614:            private static final String APPROVALADMINEMAILADDRESS = "approvaladminemailaddress";
615:            private static final String APPROVALNOTIFICATIONFROMADDR = "approvalnotificationfromaddr";
616:
617:            // Configuration for Auto Enrollment
618:            private static final String AUTOENROLL_USE = "autoenroll.use";
619:            private static final String AUTOENROLL_ADSERVER = "autoenroll.adserver";
620:            private static final String AUTOENROLL_ADPORT = "autoenroll.adport";
621:            private static final String AUTOENROLL_SSLCONNECTION = "autoenroll.sslconnection";
622:            private static final String AUTOENROLL_CONNECTIONDN = "autoenroll.connectiondn";
623:            private static final String AUTOENROLL_CONNECTIONPWD = "autoenroll.connectionpwd";
624:            private static final String AUTOENROLL_BASEDN_USER = "autoenroll.basedn.user";
625:            private static final String AUTOENROLL_CA = "autoenroll.caid";
626:
627:            // Paths
628:            private static final String AUTHORIZATION_PATH = "authorization_path";
629:            private static final String BANNERS_PATH = "banners_path";
630:            private static final String CA_PATH = "ca_path";
631:            private static final String CONFIG_PATH = "data_path";
632:            private static final String HELP_PATH = "help_path";
633:            private static final String IMAGES_PATH = "images_path";
634:            private static final String LANGUAGE_PATH = "language_path";
635:            private static final String LOG_PATH = "log_path";
636:            private static final String REPORTS_PATH = "reports_path";
637:            private static final String RA_PATH = "ra_path";
638:            private static final String THEME_PATH = "theme_path";
639:            private static final String HARDTOKEN_PATH = "hardtoken_path";
640:
641:            private static final String LANGUAGEFILENAME = "languagefilename";
642:            private static final String MAINFILENAME = "mainfilename";
643:            private static final String INDEXFILENAME = "indexfilename";
644:            private static final String MENUFILENAME = "menufilename";
645:            private static final String ERRORPAGE = "errorpage";
646:
647:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.