Source Code Cross Referenced for Profile.java in  » Workflow-Engines » pegasus-2.1.0 » org » griphyn » cPlanner » classes » 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 » Workflow Engines » pegasus 2.1.0 » org.griphyn.cPlanner.classes 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**
002:         * This file or a portion of this file is licensed under the terms of
003:         * the Globus Toolkit Public License, found at $PEGASUS_HOME/GTPL or
004:         * http://www.globus.org/toolkit/download/license.html.
005:         * This notice must appear in redistributions of this file
006:         * with or without modification.
007:         *
008:         * Redistributions of this Software, with or without modification, must reproduce
009:         * the GTPL in:
010:         * (1) the Software, or
011:         * (2) the Documentation or
012:         * some other similar material which is provided with the Software (if any).
013:         *
014:         * Copyright 1999-2004
015:         * University of Chicago and The University of Southern California.
016:         * All rights reserved.
017:         */package org.griphyn.cPlanner.classes;
018:
019:        import org.griphyn.common.util.Escape;
020:
021:        import java.util.ArrayList;
022:        import java.util.List;
023:
024:        /**
025:         * This Class hold informations about profiles associated with a tc.</p>
026:         *
027:         * @author Gaurang Mehta gmehta@isi.edu
028:         * @author Karan Vahi vahi@isi.edu
029:         *
030:         * @version $Revision: 109 $
031:         */
032:        public class Profile extends Data {
033:
034:            /**
035:             * A private static handle to the escape class.
036:             */
037:            private static Escape mEscape = new Escape();
038:
039:            public static final String CONDOR = "condor";
040:
041:            public static final String GLOBUS = "globus";
042:
043:            public static final String VDS = "pegasus";
044:
045:            public static final String DAGMAN = "dagman";
046:
047:            public static final String HINTS = "hints";
048:
049:            public static final String ENV = "env";
050:
051:            private String mNamespace;
052:
053:            private String mKey;
054:
055:            private String mValue;
056:
057:            /**
058:             * Returns a comma separated string containing the valid namespace types.
059:             *
060:             * @return  comma separated list.
061:             */
062:            public static String validTypesToString() {
063:                StringBuffer sb = new StringBuffer();
064:                sb.append(CONDOR).append(',').append(GLOBUS).append(',')
065:                        .append(VDS).append(',').append(DAGMAN).append(',')
066:                        .append(HINTS).append(',').append(ENV);
067:                return sb.toString();
068:            }
069:
070:            /**
071:             *
072:             * C'tpr for the class;
073:             * @throws java.lang.Exception
074:             */
075:            public Profile() {
076:                mNamespace = null;
077:                mKey = null;
078:                mValue = null;
079:
080:            }
081:
082:            /**
083:             * This constructor allows to set the namespace , key and value of the PoolProfile.
084:             *
085:             * @param namespace Takes a String as the namespace. Has to be one of the predefined types.
086:             * @param key Takes a String as the key.
087:             * @param value The value for the key as String
088:             * @throws Exception
089:             */
090:            public Profile(String namespace, String key, String value) {
091:                if (namespace.equalsIgnoreCase(CONDOR)
092:                        || namespace.equalsIgnoreCase(GLOBUS)
093:                        || namespace.equalsIgnoreCase(VDS)
094:                        || namespace.equalsIgnoreCase(DAGMAN)
095:                        || namespace.equalsIgnoreCase(HINTS)
096:                        || namespace.equalsIgnoreCase(ENV)) {
097:                    mNamespace = new String(namespace);
098:                    mKey = new String(key);
099:                    mValue = new String(value);
100:                } else {
101:                    throw new RuntimeException("Unknown namespace type "
102:                            + namespace + " . Valid types are "
103:                            + validTypesToString());
104:                }
105:            }
106:
107:            /**
108:             * This method allows to set the namespace , key and value of the Profile.
109:             *
110:             * @param namespace Takes a String as the namespace. Has to be one of the predefined types.
111:             * @param key Takes a String as the key.
112:             * @param value The value for the key as String
113:             * @throws Exception
114:             */
115:
116:            public void setProfile(String namespace, String key, String value) {
117:                if (namespace.equalsIgnoreCase(CONDOR)
118:                        || namespace.equalsIgnoreCase(GLOBUS)
119:                        || namespace.equalsIgnoreCase(VDS)
120:                        || namespace.equalsIgnoreCase(DAGMAN)
121:                        || namespace.equalsIgnoreCase(HINTS)
122:                        || namespace.equalsIgnoreCase(ENV)) {
123:                    mNamespace = new String(namespace);
124:                    mKey = new String(key);
125:                    mValue = new String(value);
126:                } else {
127:                    throw new RuntimeException(
128:                            "Unknown namespace type. Please check that "
129:                                    + "you have specified one of the valid namespace types.");
130:                }
131:            }
132:
133:            /**
134:             * Returns the Profile (namespace, value and key);
135:             * @return ArrayList
136:             */
137:            public List getProfile() {
138:                ArrayList m_profile = new ArrayList(3);
139:                m_profile.add(mNamespace);
140:                m_profile.add(mKey);
141:                m_profile.add(mValue);
142:                return m_profile;
143:            }
144:
145:            /**
146:             * Returns the NameSpace of the Profile
147:             * @return String
148:             */
149:            public String getProfileNamespace() {
150:                return mNamespace;
151:            }
152:
153:            /**
154:             * Returns the Key of the Profile
155:             * @return String
156:             */
157:            public String getProfileKey() {
158:                return mKey;
159:            }
160:
161:            /**
162:             * Returns the Value for the profile
163:             * @return String
164:             */
165:            public String getProfileValue() {
166:                return mValue;
167:            }
168:
169:            /**
170:             * Returns the textual description of the  contents of <code>Profile</code>
171:             * object in the multiline format.
172:             *
173:             * @return the textual description in multiline format.
174:             */
175:            public String toMultiLine() {
176:                return this .toString();
177:            }
178:
179:            /**
180:             * This method returns a string of the contents of this object.
181:             * The values are always escaped.
182:             *
183:             * @return String
184:             * @see org.griphyn.common.util.Escape
185:             */
186:            public String toString() {
187:                String output = "profile  " + mNamespace + " \"" + mKey
188:                        + "\" \"" + mEscape.escape(mValue) + "\"";
189:                // System.out.println(output);
190:                return output;
191:            }
192:
193:            /**
194:             * This method returns an xml of the contents of this object.
195:             * @return String.
196:             */
197:            public String toXML() {
198:                String output = "<profile namespace=\"" + mNamespace
199:                        + "\" key=\"" + mKey + "\" >" + mValue + "</profile>";
200:                // System.out.println(output);
201:                return output;
202:
203:            }
204:
205:            /**
206:             * Returns a copy of the object.
207:             *
208:             * @return copy of the object.
209:             */
210:            public Object clone() {
211:                Profile newprofile = null;
212:                try {
213:                    newprofile = new Profile(mNamespace, mKey, mValue);
214:
215:                } catch (Exception e) {
216:                }
217:                return newprofile;
218:            }
219:
220:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.