Source Code Cross Referenced for AlertForm.java in  » JMX » jmanage » org » jmanage » webui » forms » 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 » JMX » jmanage » org.jmanage.webui.forms 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**
002:         * Copyright 2004-2005 jManage.org
003:         *
004:         * Licensed under the Apache License, Version 2.0 (the "License");
005:         * you may not use this file except in compliance with the License.
006:         * You may obtain a copy of the License at
007:         *
008:         *     http://www.apache.org/licenses/LICENSE-2.0
009:         *
010:         * Unless required by applicable law or agreed to in writing, software
011:         * distributed under the License is distributed on an "AS IS" BASIS,
012:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013:         * See the License for the specific language governing permissions and
014:         * limitations under the License.
015:         */package org.jmanage.webui.forms;
016:
017:        import org.jmanage.core.config.AlertSourceConfig;
018:        import org.jmanage.webui.util.WebErrorCodes;
019:        import org.jmanage.webui.validator.Validator;
020:        import org.apache.struts.action.*;
021:
022:        import javax.servlet.http.HttpServletRequest;
023:
024:        /**
025:         * Date: May 26, 2005 4:46:35 PM
026:         * @author Bhavana
027:         */
028:        public class AlertForm extends BaseForm {
029:
030:            private String alertId;
031:            private String alertName;
032:            private String[] alertDelivery;
033:            private String emailAddress;
034:            private String alertSourceType = AlertSourceConfig.SOURCE_TYPE_NOTIFICATION;
035:            private String expression;
036:            private String minAttributeValue;
037:            private String maxAttributeValue;
038:            private String stringAttributeValue;
039:
040:            public String getStringAttributeValue() {
041:                return stringAttributeValue;
042:            }
043:
044:            public void setStringAttributeValue(String stringAttributeValue) {
045:                this .stringAttributeValue = stringAttributeValue;
046:            }
047:
048:            public String getMinAttributeValue() {
049:                return minAttributeValue;
050:            }
051:
052:            public void setMinAttributeValue(String minAttributeValue) {
053:                this .minAttributeValue = minAttributeValue;
054:            }
055:
056:            public String getMaxAttributeValue() {
057:                return maxAttributeValue;
058:            }
059:
060:            public void setMaxAttributeValue(String maxAttributeValue) {
061:                this .maxAttributeValue = maxAttributeValue;
062:            }
063:
064:            public String getAlertId() {
065:                return alertId;
066:            }
067:
068:            public void setAlertId(String alertId) {
069:                this .alertId = alertId;
070:            }
071:
072:            public String getAlertName() {
073:                return alertName;
074:            }
075:
076:            public void setAlertName(String alertName) {
077:                this .alertName = alertName;
078:            }
079:
080:            public String[] getAlertDelivery() {
081:                return alertDelivery;
082:            }
083:
084:            public void setAlertDelivery(String[] alertDelivery) {
085:                this .alertDelivery = alertDelivery;
086:            }
087:
088:            public String getEmailAddress() {
089:                return emailAddress;
090:            }
091:
092:            public void setEmailAddress(String emailAddress) {
093:                this .emailAddress = emailAddress;
094:            }
095:
096:            public String getAlertSourceType() {
097:                return alertSourceType;
098:            }
099:
100:            public void setAlertSourceType(String alertSourceType) {
101:                this .alertSourceType = alertSourceType;
102:            }
103:
104:            public String getExpression() {
105:                return expression;
106:            }
107:
108:            public void setExpression(String expression) {
109:                this .expression = expression;
110:            }
111:
112:            /**
113:             * this method is needed becuase in the generic flow for attribute selection
114:             * the parameter used in attributes
115:             * @param attribute
116:             */
117:            public void setAttributes(String attribute) {
118:                setExpression(attribute);
119:            }
120:
121:            public ActionErrors validate(ActionMapping mapping,
122:                    HttpServletRequest request) {
123:                ActionErrors errors = super .validate(mapping, request);
124:                if (errors == null || errors.isEmpty()) {
125:                    if (alertDelivery[0] != null
126:                            && alertDelivery[0].equals("email")) {
127:                        Validator.validateRequired(emailAddress,
128:                                "Email Address", errors);
129:                    }
130:                    if (alertSourceType
131:                            .equals(AlertSourceConfig.SOURCE_TYPE_GAUGE_MONITOR)) {
132:                        boolean validMin = Validator.validateRequired(
133:                                minAttributeValue, "minimum attribute value",
134:                                errors);
135:                        boolean validMax = Validator.validateRequired(
136:                                maxAttributeValue, "maximum attribute value",
137:                                errors);
138:                        if (validMin && validMax) {
139:                            if (Double.valueOf(maxAttributeValue).doubleValue() < Double
140:                                    .valueOf(minAttributeValue).doubleValue()) {
141:                                errors
142:                                        .add(
143:                                                ActionErrors.GLOBAL_ERROR,
144:                                                new ActionError(
145:                                                        WebErrorCodes.MAX_ATTRIBUTE_VALUE_GREATER));
146:                            }
147:                        }
148:                    }
149:                    if (alertSourceType
150:                            .equals(AlertSourceConfig.SOURCE_TYPE_STRING_MONITOR)) {
151:                        Validator.validateRequired(stringAttributeValue,
152:                                "Attribute Value", errors);
153:                    }
154:                }
155:                return errors;
156:            }
157:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.