Source Code Cross Referenced for NetFileRequest.java in  » Portal » Open-Portal » com » sun » portal » netfile » transport » 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.netfile.transport 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package com.sun.portal.netfile.transport;
002:
003:        /**
004:         * Defines the class that holds the request information of NetFile.
005:         * This class is then sent over the wire by the class implementing NetFileTransport
006:         *
007:         * @author Suresh Yellamaraju
008:         * @version 1.0
009:         */
010:
011:        import java.io.Serializable;
012:        import com.sun.portal.log.common.PortalLogger;
013:        import java.util.Hashtable;
014:        import java.util.Enumeration;
015:
016:        import com.sun.portal.netfile.shared.*;
017:
018:        public class NetFileRequest implements  Serializable {
019:
020:            // Identifier for the request
021:            private String requestId;
022:
023:            // Session id corresponding to the request
024:            private String sessionId;
025:
026:            // iPS User id for this request and session
027:            private String userId;
028:
029:            // Constant as defined in NetFileConstants
030:            private int requestType;
031:
032:            // The variable that holds a whole object of data.
033:            // This can be null in the case where there is no specific request data
034:            // This would be a defined object such as user session object when user
035:            // is saving a NetFile session, or file data when a file is being uploaded.
036:            private Object reqObject;
037:
038:            // Control parameters that need to be passed.
039:            // For example, for compression, compression type, names of files,
040:            // machine, share, userid would be the parameters.
041:            // This would serve as a easy encapsulater for data if desired.
042:            // e.g., Compression Level in case of compression.
043:            private Hashtable nfReqParams;
044:
045:            /**
046:             * Constructor
047:             * At the time of request creation, the request id, session id, and request type
048:             * are expected to be known. The user id is optional
049:             */
050:            public NetFileRequest(String reqId, String sess, String uid,
051:                    int reqType) {
052:                if ((reqId != null) && (sess != null)) {
053:                    requestId = reqId;
054:                    sessionId = sess;
055:                    userId = uid;
056:                    requestType = reqType;
057:                }
058:            }
059:
060:            public Object getParameter(String key) throws NetFileException {
061:                if (key != null)
062:                    return nfReqParams.get(key);
063:                else
064:                    throw new NetFileException(
065:                            NetFileException.NETFILE_NULLVALUE,
066:                            "Null value in key");
067:            }
068:
069:            public void setParameter(String name, Object value)
070:                    throws NetFileException {
071:                if ((name != null) && (value != null)) {
072:
073:                    if (nfReqParams == null)
074:                        nfReqParams = new Hashtable();
075:
076:                    nfReqParams.put(name, value);
077:                } else
078:                    throw new NetFileException(
079:                            NetFileException.NETFILE_NULLVALUE,
080:                            "Null value in request parameter key and/or value");
081:            }
082:
083:            public void setParameters(Hashtable params) throws NetFileException {
084:                if (params == null) {
085:                    throw new NetFileException(
086:                            NetFileException.NETFILE_NULLVALUE,
087:                            "Request Parameters is null");
088:                }
089:                nfReqParams = params;
090:            }
091:
092:            public Enumeration getRequestParamNames() {
093:                return nfReqParams.keys();
094:            }
095:
096:            public Enumeration getRequestParamVals() {
097:                return nfReqParams.elements();
098:            }
099:
100:            public Object getRequestParams() {
101:                return nfReqParams;
102:            }
103:
104:            public void setRequestParams(Hashtable params) {
105:                nfReqParams = params;
106:            }
107:
108:            public void setRequestId(String reqId) {
109:                if (reqId != null)
110:                    requestId = reqId;
111:            }
112:
113:            public String getRequestId() {
114:                return requestId;
115:            }
116:
117:            public void setSessionId(String sessId) {
118:                if (sessId != null)
119:                    sessionId = sessId;
120:            }
121:
122:            public String getSessionId() {
123:                return sessionId;
124:            }
125:
126:            public void setUserId(String user) {
127:                if (user != null)
128:                    userId = user;
129:            }
130:
131:            public String getUserId() {
132:                return userId;
133:            }
134:
135:            public void setRequestType(int reqType) {
136:                if (reqType > 0)
137:                    requestType = reqType;
138:            }
139:
140:            public int getRequestType() {
141:                return requestType;
142:            }
143:
144:            /**
145:             * If called a valid value must be set, else
146:             * default value of NF_NOVALUE
147:             */
148:            public void setRequestObject(Object obj) throws NetFileException {
149:                if (obj != null)
150:                    reqObject = obj;
151:                else {
152:                    throw new NetFileException(
153:                            NetFileException.NETFILE_NULLVALUE,
154:                            "Additional request object cannot be set to null");
155:                }
156:            }
157:
158:            public Object getRequestObject() {
159:                return reqObject;
160:            }
161:
162:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.