Source Code Cross Referenced for ListRequestsIssueHandler.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 java.io.ByteArrayInputStream;
020:        import java.io.IOException;
021:        import java.util.Map;
022:        import java.util.Properties;
023:
024:        import javax.portlet.ActionRequest;
025:        import javax.portlet.ActionResponse;
026:        import javax.portlet.PortletException;
027:        import javax.portlet.RenderRequest;
028:        import javax.portlet.RenderResponse;
029:
030:        import org.apache.commons.logging.Log;
031:        import org.apache.commons.logging.LogFactory;
032:        import org.apache.geronimo.console.MultiPageModel;
033:        import org.apache.geronimo.management.geronimo.CertificateRequestStore;
034:        import org.apache.geronimo.crypto.CaUtils;
035:        import org.apache.geronimo.crypto.asn1.x509.X509Name;
036:
037:        /**
038:         * Handler for "Requests to be fulfilled" screen.
039:         *
040:         * @version $Rev: 617588 $ $Date: 2008-02-01 10:20:07 -0800 (Fri, 01 Feb 2008) $
041:         */
042:        public class ListRequestsIssueHandler extends BaseCAHandler {
043:            private final static Log log = LogFactory
044:                    .getLog(ListRequestsIssueHandler.class);
045:
046:            public ListRequestsIssueHandler() {
047:                super (LIST_REQUESTS_ISSUE_MODE,
048:                        "/WEB-INF/view/ca/listRequestsIssue.jsp");
049:            }
050:
051:            public String actionBeforeView(ActionRequest request,
052:                    ActionResponse response, MultiPageModel model)
053:                    throws PortletException, IOException {
054:                String[] params = { ERROR_MSG, INFO_MSG };
055:                for (int i = 0; i < params.length; ++i) {
056:                    String value = request.getParameter(params[i]);
057:                    if (value != null)
058:                        response.setRenderParameter(params[i], value);
059:                }
060:                return getMode();
061:            }
062:
063:            public void renderView(RenderRequest request,
064:                    RenderResponse response, MultiPageModel model)
065:                    throws PortletException, IOException {
066:                String[] params = { ERROR_MSG, INFO_MSG };
067:                for (int i = 0; i < params.length; ++i) {
068:                    String value = request.getParameter(params[i]);
069:                    if (value != null)
070:                        request.setAttribute(params[i], value);
071:                }
072:                CertificateRequestStore csrStore = getCertificateRequestStore(request);
073:                String[] csrIds = csrStore.getVerifiedRequestIds();
074:                request.setAttribute("csrIds", csrIds);
075:            }
076:
077:            public String actionAfterView(ActionRequest request,
078:                    ActionResponse response, MultiPageModel model)
079:                    throws PortletException, IOException {
080:                String errorMsg = null;
081:                String requestId = request.getParameter("requestId");
082:                try {
083:                    response.setRenderParameter("requestId", requestId);
084:                    // Retrieve the request info based on the requestId
085:                    String certreq = getCertificateRequestStore(request)
086:                            .getRequest(requestId);
087:                    if (certreq.startsWith(CaUtils.CERT_REQ_HEADER)) {
088:                        // This is a PKCS 10 Request
089:                        Map certReqMap = CaUtils.processPKCS10Request(certreq);
090:                        // Set the subject and publickey values to be displayed in subsequent screens
091:                        response.setRenderParameter("subject", certReqMap.get(
092:                                CaUtils.CERT_REQ_SUBJECT).toString());
093:                        response
094:                                .setRenderParameter("publickey", certReqMap
095:                                        .get(CaUtils.CERT_REQ_PUBLICKEY_OBJ)
096:                                        .toString());
097:                    } else {
098:                        // This is a custom request containing SPKAC and X509Name attributes received through web browser
099:                        Properties csrProps = new Properties();
100:                        csrProps.load(new ByteArrayInputStream(certreq
101:                                .getBytes()));
102:                        String spkac = csrProps.getProperty("SPKAC");
103:                        String cn = csrProps.getProperty("CN");
104:                        String ou = csrProps.getProperty("OU");
105:                        String o = csrProps.getProperty("O");
106:                        String l = csrProps.getProperty("L");
107:                        String st = csrProps.getProperty("ST");
108:                        String c = csrProps.getProperty("C");
109:                        X509Name subject = CaUtils.getX509Name(cn, ou, o, l,
110:                                st, c);
111:                        Map certReqMap = CaUtils.processSPKAC(spkac);
112:                        // Set the subject and publickey values to be displayed in subsequent screens
113:                        response.setRenderParameter("subject", subject
114:                                .toString());
115:                        response
116:                                .setRenderParameter("publickey", certReqMap
117:                                        .get(CaUtils.CERT_REQ_PUBLICKEY_OBJ)
118:                                        .toString());
119:                    }
120:                    return CERT_REQ_DETAILS_MODE + BEFORE_ACTION;
121:                } catch (Exception e) {
122:                    errorMsg = e.toString();
123:                    log.error(
124:                            "Errors while processing a Certificate Request. id="
125:                                    + requestId, e);
126:                }
127:                response.setRenderParameter(ERROR_MSG, errorMsg);
128:                return getMode() + BEFORE_ACTION;
129:            }
130:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.