Source Code Cross Referenced for BaseCAHandler.java in  » EJB-Server-geronimo » plugins » org » apache » geronimo » console » ca » 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 » EJB Server geronimo » plugins » org.apache.geronimo.console.ca 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**
002:         *
003:         *  Licensed to the Apache Software Foundation (ASF) under one or more
004:         *  contributor license agreements.  See the NOTICE file distributed with
005:         *  this work for additional information regarding copyright ownership.
006:         *  The ASF licenses this file to You under the Apache License, Version 2.0
007:         *  (the "License"); you may not use this file except in compliance with
008:         *  the License.  You may obtain a copy of the License at
009:         *
010:         *     http://www.apache.org/licenses/LICENSE-2.0
011:         *
012:         *  Unless required by applicable law or agreed to in writing, software
013:         *  distributed under the License is distributed on an "AS IS" BASIS,
014:         *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
015:         *  See the License for the specific language governing permissions and
016:         *  limitations under the License.
017:         */package org.apache.geronimo.console.ca;
018:
019:        import javax.portlet.ActionResponse;
020:        import javax.portlet.PortletRequest;
021:        import javax.portlet.PortletSession;
022:
023:        import org.apache.commons.logging.Log;
024:        import org.apache.commons.logging.LogFactory;
025:        import org.apache.geronimo.console.MultiPageAbstractHandler;
026:        import org.apache.geronimo.console.MultiPageModel;
027:        import org.apache.geronimo.console.util.PortletManager;
028:        import org.apache.geronimo.management.geronimo.CertificateRequestStore;
029:        import org.apache.geronimo.management.geronimo.CertificateStore;
030:        import org.apache.geronimo.management.geronimo.CertificationAuthority;
031:        import org.apache.geronimo.management.geronimo.KeystoreException;
032:        import org.apache.geronimo.management.geronimo.KeystoreInstance;
033:
034:        /**
035:         * The base class for all handlers for CA portlet
036:         *
037:         * @version $Rev: 615625 $ $Date: 2008-01-27 10:12:55 -0800 (Sun, 27 Jan 2008) $
038:         */
039:        public abstract class BaseCAHandler extends MultiPageAbstractHandler {
040:            private final static Log log = LogFactory
041:                    .getLog(BaseCAHandler.class);
042:
043:            protected static final String INDEX_MODE = "index";
044:            protected static final String SETUPCA_MODE = "setupCA";
045:            protected static final String CONFIRM_CA_MODE = "confirmCA";
046:            protected static final String CADETAILS_MODE = "caDetails";
047:            protected static final String UNLOCKCA_MODE = "unlockCA";
048:            protected static final String PROCESS_CSR_MODE = "processCSR";
049:            protected static final String CERT_REQ_DETAILS_MODE = "certReqDetails";
050:            protected static final String CONFIRM_CLIENT_CERT_MODE = "confirmClientCert";
051:            protected static final String VIEW_CERT_MODE = "viewCert";
052:            protected static final String LIST_REQUESTS_ISSUE_MODE = "listRequestsIssue";
053:            protected static final String LIST_REQUESTS_VERIFY_MODE = "listRequestsVerify";
054:            protected static final String CONFIRM_CERT_REQ_MODE = "confirmCertReq";
055:
056:            // Key algorithm for CA's keypair
057:            protected static final String defaultKeyAlgorithm = "RSA";
058:            // CA's private key and self-signed certificate is stored under this keystore created using KeystoreManager
059:            // Using FileKeystoreManager, the file willbe <server-base-dir>/var/security/keystores/<defaultCAKeystore>
060:            protected static final String defaultCAKeystore = "ca-keystore";
061:            // CA's certificate store directory
062:            protected static final String defaultCAStoreDir = "var/security/ca/certs";
063:            // Certificate request store directory
064:            protected static final String defaultCSRStoreDir = "var/security/ca/requests";
065:
066:            // Name of the attribute for error message to be displayed in a page
067:            protected static final String ERROR_MSG = "errorMsg";
068:            // Name of the attribute for information message to be displayed in a page
069:            protected static final String INFO_MSG = "infoMsg";
070:
071:            /**
072:             * Constructor
073:             */
074:            protected BaseCAHandler(String mode, String viewName) {
075:                super (mode, viewName);
076:            }
077:
078:            public final static class CAModel implements  MultiPageModel {
079:                public CAModel(PortletRequest request) {
080:                }
081:
082:                public void save(ActionResponse response, PortletSession session) {
083:                }
084:            }
085:
086:            /**
087:             * This method returns CertificationAuthority GBbean.
088:             * @param request PortletRequest to execute retrieve GBean
089:             * @return  null if a CA GBean is not running.
090:             */
091:            protected CertificationAuthority getCertificationAuthority(
092:                    PortletRequest request) {
093:                Object[] cas = PortletManager.getManagementHelper(request)
094:                        .getGBeansImplementing(CertificationAuthority.class);
095:                return (CertificationAuthority) (cas != null && cas.length > 0 ? cas[0]
096:                        : null);
097:            }
098:
099:            /**
100:             * This methods creates CA's keystore using KeystoreManager.
101:             * @param request PortletRequest to get KeystoreManager
102:             * @param password Password for newly created Keystore
103:             * @throws KeystoreException 
104:             */
105:            protected KeystoreInstance createCAKeystoreInstance(
106:                    PortletRequest request, String password, String type)
107:                    throws KeystoreException {
108:                return PortletManager.getCurrentServer(request)
109:                        .getKeystoreManager().createKeystore(defaultCAKeystore,
110:                                password.toCharArray(), type);
111:            }
112:
113:            /**
114:             * This method returns CertificateRequestStore GBean.
115:             * @param request PortletRequest to execute retrieve GBean
116:             * @return  null if a CertificateRequestStore GBean is not running.
117:             */
118:            protected CertificateRequestStore getCertificateRequestStore(
119:                    PortletRequest request) {
120:                Object[] crs = PortletManager.getManagementHelper(request)
121:                        .getGBeansImplementing(CertificateRequestStore.class);
122:                return (CertificateRequestStore) (crs != null && crs.length > 0 ? crs[0]
123:                        : null);
124:            }
125:
126:            /**
127:             * This method returns CertificateStore GBean.
128:             * @param request PortletRequest to execute retrieve GBean
129:             * @return  null if a CertificateStore GBean is not running.
130:             */
131:            protected CertificateStore getCertificateStore(
132:                    PortletRequest request) {
133:                Object[] cs = PortletManager.getManagementHelper(request)
134:                        .getGBeansImplementing(CertificateStore.class);
135:                return (CertificateStore) (cs != null && cs.length > 0 ? cs[0]
136:                        : null);
137:            }
138:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.