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


001:        /*
002:         * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
003:         * PROPRIETARY/CONFIDENTIAL.  Use of this product is subject to license terms.
004:         */
005:        package com.sun.portal.admin.cli.commands.search;
006:
007:        import java.util.*;
008:        import java.util.logging.Logger;
009:        import java.util.logging.Level;
010:
011:        import javax.management.MBeanServerConnection;
012:        import javax.management.ObjectName;
013:        import javax.management.InstanceNotFoundException;
014:        import javax.management.MBeanException;
015:        import javax.management.ReflectionException;
016:        import javax.management.MalformedObjectNameException;
017:        import javax.management.Attribute;
018:
019:        import com.sun.enterprise.cli.framework.*;
020:
021:        import com.sun.portal.admin.cli.commands.GenericCommand;
022:        import com.sun.portal.admin.common.util.AdminUtil;
023:
024:        /**
025:         * This class implements the psadmin disable-robot-converter subcommand. The
026:         * disable-robot-converter subcommand calls the PortalDomainMBean and performs
027:         * the following tasks:
028:         * <UL>
029:         * <LI>disable robot converter properties
030:         * <UL>
031:         */
032:
033:        public class DisableRobotConverterCommand extends GenericCommand {
034:
035:            //public Logger logger = super.getLogger();
036:
037:            //command error messages
038:            public static final String ERROR_OPTION_NOT_FOUND = "error.psadmin.robot.converter.option.not.found";
039:            public static final String ERROR_ID_INVALID = "error.psadmin.robot.option.id.invalid";
040:
041:            //command options
042:            private static final String CONVERTER = "converter";
043:
044:            String converterID;
045:
046:            public void runCommand() throws CommandException,
047:                    CommandValidationException {
048:                validateOptions();
049:                validateSearchServerID();
050:
051:                converterID = getOption(CONVERTER);
052:
053:                if (converterID.equals("0")) {
054:                    throw new CommandValidationException(
055:                            getLocalizedString(ERROR_ID_INVALID));
056:                }
057:
058:                try {
059:                    LinkedList path = new LinkedList();
060:                    path.addFirst(getDomainId());
061:                    path.addFirst(getSearchServerId());
062:                    path.addFirst("robot");
063:                    ObjectName objName = AdminUtil.getResourceMBeanObjectName(
064:                            AdminUtil.SEARCH_ROBOT_MBEAN_TYPE, path);
065:
066:                    MBeanServerConnection msc = getMBeanServerConnection(
067:                            getUserId(), getPassword(), getHost());
068:
069:                    if (!converterID.equals("")) {
070:                        int cid = Integer.parseInt(converterID) - 1;
071:                        converterID = Integer.toString(cid);
072:                        Object[] params = { converterID, "no" };
073:                        String[] signature = { "java.lang.String",
074:                                "java.lang.String" };
075:                        msc.invoke(objName, "setConverter", params, signature);
076:                    }
077:
078:                } catch (InstanceNotFoundException ie) {
079:                    //logger.logp(Level.SEVERE, "DisableRobotConverterCommand", 
080:                    //		      "runCommand()", ie.getMessage(), ie);
081:                    logger.log(Level.SEVERE, "PSALI_CSPACCSH0003", ie);
082:                    throw new CommandException(getLocalizedString(
083:                            ERROR_MBEAN_INSTANCE_NOT_FOUND,
084:                            new Object[] { "setConverter" }), ie);
085:                } catch (MBeanException me) {
086:                    //logger.logp(Level.SEVERE, "DisableRobotConverterCommand", 
087:                    //                  "runCommand()", me.getMessage(), me);
088:                    logger.log(Level.SEVERE, "PSALI_CSPACCSH0003", me);
089:                    throw new CommandException(getLocalizedString(
090:                            ERROR_JMX_INVOKE, new Object[] { "setConverter" }),
091:                            me);
092:                } catch (ReflectionException re) {
093:                    //logger.logp(Level.SEVERE, "DisableRobotConverterCommand", 
094:                    //		      "runCommand()", re.getMessage(), re);
095:                    logger.log(Level.SEVERE, "PSALI_CSPACCSH0003", re);
096:                    throw new CommandException(getLocalizedString(
097:                            ERROR_MBEAN_REFLECTION_ERROR,
098:                            new Object[] { "setConverter" }), re);
099:                } catch (CommandException ce) {
100:                    //logger.logp(Level.SEVERE, "DisableRobotConverterCommand", 
101:                    //      "runCommand()", ce.getMessage(), ce);
102:                    logger.log(Level.SEVERE, "PSALI_CSPACCSH0003", ce);
103:                    throw ce;
104:                } catch (Exception ex) {
105:                    ex.printStackTrace();
106:                    //logger.logp(Level.SEVERE, "DisableRobotConverterCommand", 
107:                    //		      "runCommand()", ex.getMessage(), ex);
108:                    logger.log(Level.SEVERE, "PSALI_CSPACCSH0003", ex);
109:                    throw new CommandException(
110:                            getLocalizedString(COMMAND_FAILED), ex);
111:                } finally {
112:                    closeMBeanServerConnection();
113:                }
114:            }
115:
116:        }
ww_w___.__j_a__v_a_2s.co__m | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.