KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > jbi > serviceengine > util > soap > SOAPWrapper


1 // Copyright (c) 2004-2005 Sun Microsystems Inc., All Rights Reserved.
2

3 /*
4  * SOAPWrapper.java
5  *
6  * SUN PROPRIETARY/CONFIDENTIAL.
7  * This software is the proprietary information of Sun Microsystems, Inc.
8  * Use is subject to license terms.
9  *
10  */

11 package com.sun.enterprise.jbi.serviceengine.util.soap;
12
13 import java.util.HashMap JavaDoc;
14 import java.util.Iterator JavaDoc;
15 import java.util.Map JavaDoc;
16
17 import javax.xml.soap.SOAPMessage JavaDoc;
18
19
20 /**
21  * This object provides a wrapper for SOAP Messages and also contains status information.
22  * The wrapper allows clients to attach properties to it.
23  *
24  * @author Sun Microsystems, Inc.
25  */

26 public class SOAPWrapper
27 {
28     /**
29      * A place holder to hold additional name-value pairs.
30      */

31     private Map JavaDoc mMap;
32
33     /**
34      * Contains handle to the soap message.
35      */

36     private SOAPMessage JavaDoc mMessage;
37
38     /**
39      * Request Status.
40      */

41     private int mStatus;
42
43     /**
44      * Internal handle to the service URL.
45      */

46     private String JavaDoc mServiceURL;
47
48     /**
49      * Creates a new instance of SOAPWrapper.
50      *
51      * @param soapMessage - soap message
52      */

53     public SOAPWrapper(SOAPMessage JavaDoc soapMessage)
54     {
55         mMessage = soapMessage;
56         mMap = new HashMap JavaDoc();
57     }
58
59     /**
60      * Sets status.
61      *
62      * @param status request status
63      */

64     public void setStatus(int status)
65     {
66         mStatus = status;
67     }
68
69     /**
70      * Gets status.
71      *
72      * @return status information
73      */

74     public int getStatus()
75     {
76         return mStatus;
77     }
78
79     /**
80      * Gets Service URL.
81      *
82      * @return service URL
83      */

84     public String JavaDoc getServiceURL()
85     {
86         return mServiceURL;
87     }
88
89     /**
90      * Sets Service URL.
91      *
92      * @param serviceURL service url.
93      */

94     public void setServiceURL(String JavaDoc serviceURL)
95     {
96         mServiceURL = serviceURL;
97     }
98
99     /**
100      * Gets the soap message.
101      *
102      * @return soap message instance
103      */

104     public SOAPMessage JavaDoc getMessage()
105     {
106         return mMessage;
107     }
108
109     /**
110      * Sets a property to the SOAP Wrapper.
111      *
112      * @param propertyName property name
113      * @param value property value
114      */

115     public void setValue(String JavaDoc propertyName, Object JavaDoc value)
116     {
117         mMap.put(propertyName, value);
118     }
119
120     /**
121      * Sets a property to the SOAP Wrapper.
122      *
123      * @param propertyName property name
124      *
125      * @return property value
126      */

127     public Object JavaDoc getValue(String JavaDoc propertyName)
128     {
129         return mMap.get(propertyName);
130     }
131
132     /**
133      * Get the property list.
134      *
135      * @return a list of property names.
136      */

137     public Iterator JavaDoc getProperties()
138     {
139         return mMap.keySet().iterator();
140     }
141 }
142
Popular Tags