KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > ibm > webdav > ResourceContext


1 package com.ibm.webdav;
2
3 /*
4  * (C) Copyright IBM Corp. 2000 All rights reserved.
5  *
6  * The program is provided "AS IS" without any warranty express or
7  * implied, including the warranty of non-infringement and the implied
8  * warranties of merchantibility and fitness for a particular purpose.
9  * IBM will not be liable for any damages suffered by you as a result
10  * of using the Program. In no event will IBM be liable for any
11  * special, indirect or consequential damages or lost profits even if
12  * IBM has been advised of the possibility of their occurrence. IBM
13  * will not be liable for any third party claims against you.
14  */

15
16 /** A ResourceContext represents additional information about the resource
17  * that may effect how a method is executed, or reflect information that
18  * is returned from a method execution. It contains two HTTPHeaders object
19  * representing the method request and response Headers. A ResourceContext
20  * also includs a status code which indicates the success or failure of the
21  * method request.
22  * <p>
23  * Values for the request context are set before calling a method of
24  * Resource or Collection, and provide additional parameters for
25  * the method or context in which it is executed. After the method returns,
26  * additional information about the method execution is available in the
27  * context.</p>
28  * <p>
29  * Many of these headers are only used internally by the ResourceHTTPStub
30  * class to marshall arguments between the client and server using the HTTP
31  * protocol. Some of this information can be more conveniently obtained through
32  * the parameters and return values of class Resource.</p>
33  * <p>
34  * @author Jim Amsden &lt;jamsden@us.ibm.com&gt;
35  */

36 public class ResourceContext {
37     protected HTTPHeaders requestContext = new HTTPHeaders();
38     protected HTTPHeaders responseContext = new HTTPHeaders();
39     protected WebDAVStatus statusCode = new WebDAVStatus();
40         protected String JavaDoc methodName = "unknown";
41 /**
42  * Insert the method's description here.
43  * Creation date: (4/14/2000 3:04:10 PM)
44  * @return com.ibm.webdav.HTTPHeaders
45  */

46 public HTTPHeaders getRequestContext() {
47     return requestContext;
48 }
49 /**
50  * Insert the method's description here.
51  * Creation date: (4/14/2000 3:04:10 PM)
52  * @return com.ibm.webdav.HTTPHeaders
53  */

54 public HTTPHeaders getResponseContext() {
55     return responseContext;
56 }
57 /**
58  * Insert the method's description here.
59  * Creation date: (4/14/2000 3:04:10 PM)
60  * @return com.ibm.webdav.WebDAVStatus
61  */

62 public WebDAVStatus getStatusCode() {
63     return statusCode;
64 }
65
66 public String JavaDoc getMethodName() {
67   return methodName;
68 }
69
70 /**
71  * Insert the method's description here.
72  * Creation date: (4/14/2000 3:04:10 PM)
73  * @param newRequestContext com.ibm.webdav.HTTPHeaders
74  */

75 public void setRequestContext(HTTPHeaders newRequestContext) {
76     requestContext = newRequestContext;
77 }
78 /**
79  * Insert the method's description here.
80  * Creation date: (4/14/2000 3:04:10 PM)
81  * @param newResponseContext com.ibm.webdav.HTTPHeaders
82  */

83 public void setResponseContext(HTTPHeaders newResponseContext) {
84     responseContext = newResponseContext;
85 }
86 /**
87  * Insert the method's description here.
88  * Creation date: (4/14/2000 3:04:10 PM)
89  * @param newStatusCode com.ibm.webdav.WebDAVStatus
90  */

91 public void setStatusCode(WebDAVStatus newStatusCode) {
92     statusCode = newStatusCode;
93 }
94
95 public void setMethodName(String JavaDoc newMethodName) {
96   methodName = newMethodName;
97 }
98 }
99
Popular Tags