KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > axis2 > addressing > MessageInformationHeadersCollection


1 /*
2  * Copyright 2004,2005 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package org.apache.axis2.addressing;
17
18 import org.apache.axis2.addressing.miheaders.RelatesTo;
19 import org.apache.axis2.om.OMElement;
20 import org.apache.axis2.soap.SOAPHeader;
21
22 import java.util.ArrayList JavaDoc;
23
24 /**
25  * This holds the WSA Message Information Headers
26  */

27 public class MessageInformationHeadersCollection {
28
29     /**
30      * The address of the intended receiver of the message. This is mandatory
31      */

32     private EndpointReference to;
33
34     /**
35      * Reference of the endpoint where the message originated from
36      */

37     private EndpointReference from;
38
39     /**
40      * Pair of values that indicate how this message related to another message
41      */

42     private RelatesTo relatesTo;
43
44     /**
45      * identifies the intended receiver for replies to the message
46      */

47     private EndpointReference replyTo;
48
49     /**
50      * identifies the intended receiver for faults related to the message
51      */

52     private EndpointReference faultTo;
53
54     /**
55      * Field action
56      */

57     private String JavaDoc action;
58
59     /**
60      * Field messageId
61      */

62     private String JavaDoc messageId;
63
64     private ArrayList JavaDoc referenceParameters;
65
66
67     /**
68      * Addressing Header MUST have a to and an action
69      *
70      * @param wsaTo
71      * @param action
72      */

73     public MessageInformationHeadersCollection(EndpointReference wsaTo, String JavaDoc action) {
74         this.to = wsaTo;
75         this.action = action;
76     }
77
78     public MessageInformationHeadersCollection() {
79     }
80
81     /**
82      * Method toOM
83      *
84      * @param soapHeader
85      */

86     public void toOM(SOAPHeader soapHeader) {
87         throw new UnsupportedOperationException JavaDoc();
88     }
89
90     // ------------------- Setters and Getters --------------------------------------
91

92     /**
93      * Method getTo
94      *
95      * @return
96      */

97     public EndpointReference getTo() {
98
99         return to;
100     }
101
102     /**
103      * Method setTo
104      *
105      * @param to
106      */

107     public void setTo(EndpointReference to) {
108         this.to = to;
109     }
110
111     /**
112      * Method getFrom
113      *
114      * @return
115      */

116     public EndpointReference getFrom() {
117         return from;
118     }
119
120     /**
121      * Method setFrom
122      *
123      * @param from
124      */

125     public void setFrom(EndpointReference from) {
126         this.from = from;
127     }
128
129     /**
130      * Method getReplyTo
131      *
132      * @return
133      */

134     public EndpointReference getReplyTo() {
135
136         return replyTo;
137     }
138
139     /**
140      * Method setReplyTo
141      *
142      * @param replyTo
143      */

144     public void setReplyTo(EndpointReference replyTo) {
145         this.replyTo = replyTo;
146     }
147
148     /**
149      * Method getFaultTo
150      *
151      * @return
152      */

153     public EndpointReference getFaultTo() {
154
155         return faultTo;
156     }
157
158     /**
159      * Method setFaultTo
160      *
161      * @param faultTo
162      */

163     public void setFaultTo(EndpointReference faultTo) {
164         this.faultTo = faultTo;
165     }
166
167     /**
168      * Method getAction
169      *
170      * @return
171      */

172     public String JavaDoc getAction() {
173         return action;
174     }
175
176     /**
177      * Method setAction
178      *
179      * @param action
180      */

181     public void setAction(String JavaDoc action) {
182         this.action = action;
183     }
184
185     /**
186      * Method getMessageId
187      *
188      * @return
189      */

190     public String JavaDoc getMessageId() {
191         return messageId;
192     }
193
194     /**
195      * Method setMessageId
196      *
197      * @param messageId
198      */

199     public void setMessageId(String JavaDoc messageId) {
200         this.messageId = messageId;
201     }
202
203     /**
204      * Method getRelatesTo
205      *
206      * @return
207      */

208     public RelatesTo getRelatesTo() {
209
210         return relatesTo;
211     }
212
213     /**
214      * Method setRelatesTo
215      *
216      * @param relatesTo
217      */

218     public void setRelatesTo(RelatesTo relatesTo) {
219
220         this.relatesTo = relatesTo;
221     }
222
223     public ArrayList JavaDoc getReferenceParameters() {
224         return referenceParameters;
225     }
226
227     public void setReferenceParameters(ArrayList JavaDoc referenceParameters) {
228         this.referenceParameters = referenceParameters;
229     }
230
231     public void addReferenceParameter(OMElement referenceParameter){
232         if(referenceParameters == null){
233             referenceParameters = new ArrayList JavaDoc(5);
234         }
235         referenceParameters.add(referenceParameter);
236     }
237
238     // --------------------------------------------------------------------------------------------
239
}
240
Popular Tags