Source Code Cross Referenced for ListConfigurationsBean.java in  » Portal » Open-Portal » com » sun » portal » admin » console » ssoa » 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 » Portal » Open Portal » com.sun.portal.admin.console.ssoa 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**
002:         * $Id: ListConfigurationsBean.java,v 1.4 2005/09/21 15:29:57 fo160993 Exp $
003:         * Copyright 2005 Sun Microsystems, Inc. All
004:         * rights reserved. Use of this product is subject
005:         * to license terms. Federal Acquisitions:
006:         * Commercial Software -- Government Users
007:         * Subject to Standard License Terms and
008:         * Conditions.
009:         *
010:         * Sun, Sun Microsystems, the Sun logo, and Sun ONE
011:         * are trademarks or registered trademarks of Sun Microsystems,
012:         * Inc. in the United States and other countries.
013:         */package com.sun.portal.admin.console.ssoa;
014:
015:        import java.util.*;
016:        import java.util.logging.Level;
017:        import java.io.IOException;
018:
019:        import javax.faces.application.FacesMessage;
020:        import javax.faces.context.FacesContext;
021:        import javax.faces.validator.ValidatorException;
022:
023:        import javax.management.ObjectName;
024:        import javax.management.MBeanServerConnection;
025:        import javax.management.MalformedObjectNameException;
026:
027:        import javax.servlet.http.HttpServletRequest;
028:
029:        import com.sun.data.provider.DataProvider;
030:        import com.sun.data.provider.impl.ObjectListDataProvider;
031:        import com.sun.web.ui.component.Checkbox;
032:
033:        import com.sun.portal.admin.common.util.AdminClientUtil;
034:
035:        import com.sun.portal.admin.console.common.PSBaseBean;
036:
037:        public abstract class ListConfigurationsBean extends PSBaseBean {
038:
039:            //	public static final String ATTR_SELECTED_TEMPLATE = "ssoa.template.selected";
040:            //	public static final String ATTR_SELECTED_CONFIG = "ssoa.config.selected";
041:            //	public static final String ATTR_CURRENT_LOCATION_DN = "ssoa.dn.selected";
042:
043:            public static final String RB_NAME = "ssoa";
044:            //    public static final String GLOBAL_LOCATION_DN = "_!global!_";
045:
046:            protected Map rbMap;
047:
048:            protected DataProvider configurations;
049:            protected ObjectName objectName = null;
050:
051:            /** Creates a new instance of ListConfigurationsBean*/
052:            public ListConfigurationsBean() {
053:                log(Level.FINEST, "ListConfigurationsBean.constructor start");
054:                // Get resource bundle
055:                rbMap = getResourceStringMap(RB_NAME);
056:
057:                // MBean path of SSOAdapter.
058:                LinkedList path = new LinkedList();
059:                path.addFirst(getDomain());
060:                path.addFirst("ssoadapter");
061:
062:                try {
063:                    objectName = AdminClientUtil.getResourceMBeanObjectName(
064:                            AdminClientUtil.SSOADAPTER_MBEAN_TYPE, path);
065:                } catch (MalformedObjectNameException e) {
066:                    log(
067:                            Level.SEVERE,
068:                            "ListConfigurationsBean.constructor: Exception when getting MBean object name",
069:                            e);
070:                }
071:                //resetConfigurations();
072:            }
073:
074:            public DataProvider getConfigurations() {
075:                return configurations;
076:            }
077:
078:            // Do the mbean server connection to pull the configurations.  Will also reset the data
079:            // object to reflect the configurations.
080:            // If session attribute ATTR_SELECTED_TEMPLATE is set, pull configurations for selected template.
081:            // If session attribute ATTR_CURRENT_LOCATION_DN is set, pull configurations for selected dn.
082:            //	 public abstract void resetConfigurations();
083:
084:            public abstract String gotoConfigurationHome();
085:
086:            public void createConfiguration() {
087:                log(Level.FINEST,
088:                        "ListConfigurationsBean.createConfiguration start");
089:            }
090:
091:            public void deleteConfigurations() {
092:                log(Level.FINEST,
093:                        "ListConfigurationsBean.deleteConfigurations start");
094:                // RadioButton.getSelected(String groupName) is
095:                // a static convenience method that obtains the 
096:                // selected radio button value from the request map
097:                // ONLY when the radio button is part of a group.
098:                //
099:                List selectedcbs = Checkbox.getSelected("cb");
100:                for (Iterator i = selectedcbs.iterator(); i.hasNext();) {
101:                    deleteConfiguration((String) i.next());
102:                }
103:                // This will tell the configuration list by dn bean to re-query the list from the MBean
104:                setSessionAttribute("resetSSOA", "true");
105:            }
106:
107:            public void deleteConfiguration(String id) {
108:                //String id = (String)RadioButton.getSelected("rb"); 
109:                // The id is in the form of dn|name
110:                int sepindex = id.indexOf(ConfigurationBean.ID_SEPARATOR);
111:                String dn = id.substring(0, sepindex);
112:                String name = id.substring(sepindex + 1);
113:                //		String dn = (String) getSessionAttribute(ATTR_CURRENT_LOCATION_DN);
114:                if ((dn == null) || (dn.length() == 0))
115:                    dn = GLOBAL_LOCATION_DN;
116:                log(Level.FINEST,
117:                        "ListConfigurationsBean.deleteConfiguration: Deleting config "
118:                                + name + " from dn " + dn);
119:                if ((name == null) || (name.length() == 0)) {
120:                    log(Level.WARNING,
121:                            "ListConfigurationsBean.deleteConfiguration: Configuration name is invalid");
122:                    return;
123:                }
124:                try {
125:                    String[] signature = { String.class.getName(),
126:                            String.class.getName() };
127:                    Object[] params = { dn, name };
128:                    MBeanServerConnection connection = getMBeanServerConnection();
129:                    // This can throw AttributeNotFoundException, MBeanException, InstanceNotFoundException
130:                    // ReflectionException, RuntimeOperationsException, or IOException
131:                    connection.invoke(objectName, "deleteConfiguration",
132:                            params, signature);
133:                } catch (Exception ex) {
134:                    log(
135:                            Level.SEVERE,
136:                            "ListConfigurationsBean.deleteConfiguration: Exception when attempting to delete "
137:                                    + name, ex);
138:                }
139:                //resetConfigurations();
140:            }
141:
142:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.