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


001:        /*
002:         * Created on Apr 6, 2005
003:         *
004:         * TODO To change the template for this generated file go to
005:         * Window - Preferences - Java - Code Style - Code Templates
006:         */
007:        package com.sun.portal.sra.admin.attribute.handlers;
008:
009:        import java.util.Collections;
010:        import java.util.List;
011:        import java.util.Map;
012:        import java.util.Set;
013:        import java.util.logging.Logger;
014:
015:        import com.sun.portal.admin.common.AttrOptionConstants;
016:        import com.sun.portal.admin.common.PSMBeanException;
017:        import com.sun.portal.admin.server.AdminServerUtil;
018:        import com.sun.portal.fabric.common.AttributeHandler;
019:        import com.sun.portal.fabric.common.AttributeOperations;
020:        import com.sun.portal.log.common.PortalLogger;
021:
022:        /**
023:         * @author ss150821
024:         * 
025:         */
026:        public class GatewayAttributeHandler implements  AttributeHandler {
027:
028:            private static String _compName = null;
029:
030:            private static String _domainId = null;
031:
032:            private static String _portalId = null;
033:
034:            protected AttributeOperations _attrOps = null;
035:
036:            private static Logger logger = PortalLogger
037:                    .getLogger(GatewayAttributeHandler.class);
038:
039:            private static String loggerName = "debug.com.sun.portal.admin.mbeans";
040:
041:            private static final String ATTRIBUTE_PREFIX = "sunPortalGateway";
042:
043:            public void init(String component, String domainId, String portalId)
044:                    throws PSMBeanException {
045:                _compName = component;
046:                _domainId = domainId;
047:                _portalId = portalId;
048:
049:                try {
050:                    _attrOps = new GatewayAttributeOperations(AdminServerUtil
051:                            .getSSOToken());
052:                } catch (Exception e) {
053:                    throw new PSMBeanException(
054:                            "error.psadmin.handler.init.failed",
055:                            e.getMessage(), e);
056:                }
057:            }
058:
059:            public void validate(List values, Map optionsMap)
060:                    throws PSMBeanException {
061:                return;
062:            }
063:
064:            public String getAttributeName(String userFriendlyName) {
065:                if (userFriendlyName.toLowerCase().startsWith(
066:                        ATTRIBUTE_PREFIX.toLowerCase()))
067:                    return userFriendlyName;
068:                else
069:                    return ATTRIBUTE_PREFIX + userFriendlyName;
070:            }
071:
072:            public String getComponentName(String userFriendlyName) {
073:                return userFriendlyName;
074:            }
075:
076:            private void replaceUserFriendlyAttributeNameWithActual(
077:                    Map optionsMap) {
078:                String passedInAttribName = (String) optionsMap
079:                        .get(AttrOptionConstants.OPT_ATTR_NAME);
080:                optionsMap.put(AttrOptionConstants.OPT_ATTR_NAME,
081:                        getAttributeName(passedInAttribName));
082:            }
083:
084:            public List getAttribute(Map optionsMap) throws PSMBeanException {
085:                replaceUserFriendlyAttributeNameWithActual(optionsMap);
086:                String component = (String) optionsMap
087:                        .get(AttrOptionConstants.OPT_COMPONENT);
088:                String attribute = (String) optionsMap
089:                        .get(AttrOptionConstants.OPT_ATTR_NAME);
090:
091:                try {
092:                    logger.info("PSSR_CSPS_ADM_ATTRIB_HNDLRS000");
093:                    return _attrOps.getAttribute(component, attribute,
094:                            optionsMap);
095:                } catch (Exception e) {
096:                    logger.info("PSSR_CSPS_ADM_ATTRIB_HNDLRS001");
097:                    throw new PSMBeanException("error.psadmin.get.failed", e
098:                            .getMessage(), e);
099:                }
100:            }
101:
102:            public void setAttribute(List values, Map optionsMap)
103:                    throws PSMBeanException {
104:                replaceUserFriendlyAttributeNameWithActual(optionsMap);
105:                String component = (String) optionsMap
106:                        .get(AttrOptionConstants.OPT_COMPONENT);
107:                String attribute = (String) optionsMap
108:                        .get(AttrOptionConstants.OPT_ATTR_NAME);
109:                try {
110:                    _attrOps.setAttribute(component, attribute, values,
111:                            optionsMap);
112:                } catch (Exception e) {
113:                    logger.info("PSSR_CSPS_ADM_ATTRIB_HNDLRS002");
114:                    throw new PSMBeanException("error.psadmin.set.failed", e
115:                            .getMessage(), e);
116:                }
117:            }
118:
119:            public Map listAttributes(Map optionsMap) throws PSMBeanException {
120:                String component = (String) optionsMap
121:                        .get(AttrOptionConstants.OPT_COMPONENT);
122:                Map values = _attrOps.listAttributes(component, optionsMap);
123:                return values == null ? Collections.EMPTY_MAP : values;
124:            }
125:
126:            public void setAttributes(Map nameValues, Map optionsMap)
127:                    throws PSMBeanException {
128:                String component = (String) optionsMap
129:                        .get(AttrOptionConstants.OPT_COMPONENT);
130:
131:                try {
132:                    _attrOps.setAttributes(component, nameValues, optionsMap);
133:                } catch (Exception e) {
134:                    logger.info("PSSR_CSPS_ADM_ATTRIB_HNDLRS002");
135:                    throw new PSMBeanException("error.psadmin.set.failed", e
136:                            .getMessage(), e);
137:                }
138:            }
139:
140:            public Map getAttributes(Map optionsMap) throws PSMBeanException {
141:                String component = (String) optionsMap
142:                        .get(AttrOptionConstants.OPT_COMPONENT);
143:                Set attributes = (Set) optionsMap
144:                        .get(AttrOptionConstants.OPT_ATTR_NAMES);
145:
146:                try {
147:                    logger.info("PSSR_CSPS_ADM_ATTRIB_HNDLRS000");
148:                    return _attrOps.getAttributes(component, attributes,
149:                            optionsMap);
150:                } catch (Exception e) {
151:                    logger.info("PSSR_CSPS_ADM_ATTRIB_HNDLRS001");
152:                    throw new PSMBeanException("error.psadmin.get.failed", e
153:                            .getMessage(), e);
154:                }
155:            }
156:
157:        }
w___w_w___.__j___a_v___a_2__s_.___co___m___ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.