Source Code Cross Referenced for WorkDir.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 in file GTPL, or at
004:         * http://www.globus.org/toolkit/download/license.html. This notice must
005:         * appear in redistributions of this file, with or without modification.
006:         *
007:         * Redistributions of this Software, with or without modification, must
008:         * reproduce the GTPL in: (1) the Software, or (2) the Documentation or
009:         * some other similar material which is provided with the Software (if
010:         * any).
011:         *
012:         * Copyright 1999-2004 University of Chicago and The University of
013:         * Southern California. All rights reserved.
014:         */
015:
016:        package org.griphyn.cPlanner.classes;
017:
018:        /**
019:         * This is a data class that is used to store information about the scratch
020:         * work directory or the execution mount point on the remote pool.
021:         * <p>
022:         * The various attributes that can be associated with the work directory
023:         * displayed in the following table.
024:         *
025:         * <p>
026:         * <table border="1">
027:         * <tr align="left"><th>Attribute Name</th><th>Attribute Description</th></tr>
028:         * <tr align="left"><th>path</th>
029:         *  <td>the absolute path on the remote site to the work directory.</td>
030:         * </tr>
031:         * <tr align="left"><th>total size</th>
032:         *  <td>the total scratch space available under the work directory.</td>
033:         * </tr>
034:         * <tr align="left"><th>free size</th>
035:         *  <td>the free space available under the work directory.</td>
036:         * </tr>
037:         * </table>
038:
039:         *
040:         * @author Gaurang Mehta gmehta@isi.edu
041:         * @author Karan Vahi vahi@isi.edu
042:         *
043:         * @version $Revision: 109 $
044:         */
045:        public class WorkDir {
046:
047:            /**
048:             * Array storing the names of the attributes that are stored with the
049:             * work directory.
050:             */
051:            public static final String[] WORKDIRINFO = { "path", "total-size",
052:                    "free-size" };
053:
054:            /**
055:             * The constant to be passed to the accessor functions to get or set the
056:             * path to the work directory.
057:             */
058:            public static final int WORKDIR = 0;
059:
060:            /**
061:             * The constant to be passed to the accessor functions to get or set the
062:             * total space available.
063:             */
064:            public static final int TOTAL_SIZE = 1;
065:
066:            /**
067:             * The constant to be passed to the accessor functions to get or set the
068:             * free space available.
069:             */
070:            public static final int FREE_SIZE = 2;
071:
072:            /**
073:             * The path to the work directory.
074:             */
075:            private String mWorkDir;
076:
077:            /**
078:             * The total space available at the file system under this directory.
079:             */
080:            private String mTotalSize;
081:
082:            /**
083:             * The free space available at the file system under this directory.
084:             */
085:            private String mFreeSize;
086:
087:            /**
088:             * The default constructor. Sets all the variables to null.
089:             */
090:            public WorkDir() {
091:                mWorkDir = null;
092:                mTotalSize = null;
093:                mFreeSize = null;
094:            }
095:
096:            /**
097:             * Returns the attribute value of a particular attribute of the work
098:             * directory.
099:             *
100:             * @param key the key/attribute name.
101:             *
102:             * @return the attribute value
103:             * @throws RuntimeException if illegal key defined.
104:             */
105:            public String getInfo(int key) {
106:                switch (key) {
107:                case 0:
108:                    return mWorkDir;
109:
110:                case 1:
111:                    return mTotalSize;
112:
113:                case 2:
114:                    return mFreeSize;
115:
116:                default:
117:                    throw new RuntimeException("Illegal workdir key type="
118:                            + key + ". Use on of the predefined types");
119:                }
120:            }
121:
122:            /**
123:             * Sets an attribute associated with the work directory.
124:             *
125:             * @param key  the attribute key, which is one of the predefined keys.
126:             * @param value value of the attribute.
127:             *
128:             * @throws Exception if illegal key defined.
129:             */
130:            public void setInfo(int key, String value) throws RuntimeException {
131:                switch (key) {
132:                case 0:
133:                    mWorkDir = value == null ? null : new String(value);
134:                    break;
135:
136:                case 1:
137:                    mTotalSize = value == null ? null : new String(value);
138:                    break;
139:
140:                case 2:
141:                    mFreeSize = value == null ? null : new String(value);
142:                    break;
143:
144:                default:
145:                    throw new RuntimeException("Illegal workdir key type="
146:                            + key + ". Use on of the predefined types");
147:                }
148:            }
149:
150:            /**
151:             * Returns the textual description of the  contents of <code>WorkDir</code>
152:             * object in the multiline format.
153:             *
154:             * @return the textual description in multiline format.
155:             */
156:            public String toMultiLine() {
157:                String output = "workdir \"" + mWorkDir + "\"";
158:                return output;
159:            }
160:
161:            /**
162:             * Returns the textual description of the  contents of <code>WorkDir</code>
163:             * object.
164:             *
165:             * @return the textual description.
166:             */
167:            public String toString() {
168:                String output = "workdir \"" + mWorkDir + "\"";
169:                if (mWorkDir != null) {
170:                    output += " " + WORKDIRINFO[0] + "=" + mWorkDir;
171:                }
172:                if (mTotalSize != null) {
173:                    output += " " + WORKDIRINFO[1] + "=" + mTotalSize;
174:                }
175:                if (mFreeSize != null) {
176:                    output += " " + WORKDIRINFO[2] + "=" + mFreeSize;
177:                }
178:                output += " )";
179:                // System.out.println(output);
180:                return output;
181:            }
182:
183:            /**
184:             * Returns the XML description of the  contents of <code>WorkDir</code>
185:             * object.
186:             *
187:             * @return the xml description.
188:             */
189:            public String toXML() {
190:                String output = "";
191:                if (mWorkDir != null) {
192:                    output += "<workdirectory";
193:
194:                    if (mTotalSize != null) {
195:                        output += " " + WORKDIRINFO[1] + "=\"" + mTotalSize
196:                                + "\"";
197:                    }
198:                    if (mFreeSize != null) {
199:                        output += " " + WORKDIRINFO[2] + "=\"" + mFreeSize
200:                                + "\"";
201:                    }
202:                    output += " >";
203:                    output += mWorkDir;
204:                }
205:                output += "</workdirectory>";
206:
207:                return output;
208:            }
209:
210:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.