PageRenderTime 145ms CodeModel.GetById 105ms app.highlight 32ms RepoModel.GetById 1ms app.codeStats 1ms

/protocols/jain-megaco/megaco-api/src/main/java/javax/megaco/message/CommandResp.java

http://mobicents.googlecode.com/
Java | 681 lines | 67 code | 17 blank | 597 comment | 2 complexity | bdba86e216a1ca4477000d1f2629e2a0 MD5 | raw file
  1package javax.megaco.message;
  2
  3import javax.megaco.CommandEvent;
  4
  5/**
  6 * The class extends JAIN MEGACO Command Events. This class is used to represent
  7 * megaco command response event.Using this class the application can send
  8 * responses of MEGACO command request received from peer.
  9 */
 10public class CommandResp extends CommandEvent {
 11
 12	private int cmdRespIdentifier;
 13	private boolean isLastCommandResp;
 14
 15	/**
 16	 * Constructs a Command Response Event object. Since the constructor if
 17	 * private, the user of this class will create the object of CommandReq
 18	 * class using methods MegacoCmdRespAdd, MegacoCmdRespMove etc. This
 19	 * restricts the implementation such that the command response event objects
 20	 * created will have cmdResponseIdentifier as one of the values defined in
 21	 * the class CmdResponseType.
 22	 * 
 23	 * @param source
 24	 *            - A reference to the object, the "source", that is logically
 25	 *            deemed to be the object upon which the Event in question
 26	 *            initially occurred.
 27	 * @param assocHandle
 28	 *            - The association handle to uniquely identify the MG-MGC pair.
 29	 *            This is allocated by the stack when the Listener registers
 30	 *            with the provider with a unique MG-MGC identity.
 31	 * @param txnHandle
 32	 *            - The transaction handle that shall uniquely identify the
 33	 *            transaction id for the transaction in which the command shall
 34	 *            be sent.
 35	 * 
 36	 * <br>
 37	 *            1. The transaction handle is allocated by the stack either on
 38	 *            request from User application or on receipt of the transaction
 39	 *            indication from peer. <br>
 40	 *            2. If the response is to be sent for the transaction received,
 41	 *            then the application sends the same transaction handle that
 42	 *            has been received by it in the indication. <br>
 43	 *            3. If the confirmation is to be sent by the stack to the
 44	 *            application due to receipt of a response from the peer stack
 45	 *            for a request sent by the stack, then the transaction handle
 46	 *            shall be same as received in the command request by the stack.
 47	 * 
 48	 * @param actionHandle
 49	 *            - The action handle uniquely identifies the action within a
 50	 *            transaction. The action handle field is used for
 51	 *            request-response synchronisation.
 52	 * 
 53	 * <br>
 54	 *            1. If the request is sent from application to the remote
 55	 *            entity, then the action handle is allocated by the
 56	 *            application. On receipt of the response from the peer for the
 57	 *            same request, the stack will use the same action handle when
 58	 *            giving the confirmation to the application. <br>
 59	 *            2. If the indication received from stack is to be sent to the
 60	 *            application, then the action handle is allocated by the stack.
 61	 *            The response sent by the application to the stack mus have the
 62	 *            same action handle as received in the indication.
 63	 * 
 64	 *            Note: The action handle can be different from the context id
 65	 *            when there are multiple action in the same transaction all
 66	 *            having context id as 'null' or 'choose' or '*'.
 67	 * @param isLastCommandResp
 68	 *            - This parameter specifies whether the command response is the
 69	 *            last response for the wildcarded request received.
 70	 * @param isFirstCommandInAction
 71	 *            - This parameter specifies whether the command is the first
 72	 *            command in the action.
 73	 * @param cmdRespIdentifier
 74	 *            - Identifies the value of the command request identifier for
 75	 *            which the command response event class has been created.
 76	 * @throws IllegalArgumentException
 77	 *             : This exception is raised if the value of transaction handle
 78	 *             or the action handle passed to this method is less than 0.
 79	 */
 80	private CommandResp(java.lang.Object source, int assocHandle, int txnHandle, int actionHandle, boolean isLastCommandResp, boolean isFirstCommandInAction, int cmdRespIdentifier)
 81			throws IllegalArgumentException {
 82		super(source, assocHandle, txnHandle, actionHandle, isLastCommandResp, isFirstCommandInAction);
 83		if (txnHandle < 0 || actionHandle < 0) {
 84			IllegalArgumentException invalidArgumentException = new IllegalArgumentException("txnHandle or actionHandle cannot be less than 0 for CommandReq");
 85			// invalidArgumentException.setAssocHandle(assocHandle);
 86			throw invalidArgumentException;
 87		}
 88
 89		this.cmdRespIdentifier = cmdRespIdentifier;
 90	}
 91
 92	/**
 93	 * This method cannot be overridden by the derived class. This method
 94	 * returns that the command identifier is of type command response Event.
 95	 * This method overrides the corresponding method of the base class
 96	 * CommandEvent.
 97	 * 
 98	 * @return Returns an integer value that identifies this event object as a
 99	 *         command response event i.e. M_COMMAND_RESP.
100	 */
101	public int getCommandIdentifier() {
102		return CommandType.M_ACTION_RESP;
103	}
104
105	/**
106	 * This method identifies the Command response type of the class instance.
107	 * See javax.megaco.message.CmdResponseType for the definition of the
108	 * constants for the Command Response events.
109	 * 
110	 * @return Returns an integer value that identifies this event object as the
111	 *         type of command response event. It returns whether it is add
112	 *         response command or subract response command or audit value
113	 *         command response or audit capability command response or notify
114	 *         response or service change response or modify response or move
115	 *         response.
116	 */
117	public int getResponseIdentifier() {
118		return this.cmdRespIdentifier;
119	}
120
121	/**
122	 * Stack needs to check this field to know that all response for the
123	 * wildcarded request has been received so as to send next command request
124	 * to the application for the same transaction. Application needs this to
125	 * know that all command responses for the wildcarded command request has
126	 * been received.
127	 * 
128	 * @return Returns true if the command is the last command in the
129	 *         transaction.
130	 */
131	public boolean isLastCommandResp() {
132		return this.isLastCommandResp;
133	}
134
135	/**
136	 * Sets the flag to indicate that this command response is the last response
137	 * for the wildcarded command request received. Application will set this
138	 * field when giving the last response for the wildcarded command request
139	 * received from the stack. Similarly the stack would set this field when
140	 * giving the command responses received from the peer to the application.
141	 */
142	public void setLastCommandResp() {
143		this.isLastCommandResp = true;
144	}
145
146	/**
147	 * This method is used for creating the CommandResp class with the request
148	 * identifier set to M_ADD_RESP. This method is invoked to obtain the object
149	 * reference of the class CommandResp. This method is valid only if the
150	 * application is MG. This would be used to send ADD response for command
151	 * request request received from MGC.
152	 * 
153	 * @param source
154	 *            - A reference to the object, the "source", that is logically
155	 *            deemed to be the object upon which the Event in question
156	 *            initially occurred.
157	 * @param assocHandle
158	 *            - The association handle to uniquely identify the MG-MGC pair.
159	 *            This is allocated by the stack when the Listener registers
160	 *            with the provider with a unique MG-MGC identity.
161	 * @param txnHandle
162	 *            - The transaction handle that shall uniquely identify the
163	 *            transaction id for the transaction in which the command shall
164	 *            be sent.
165	 * 
166	 * <br>
167	 *            1. The transaction handle is allocated by the stack either on
168	 *            request from User application or on receipt of the transaction
169	 *            indication from peer. <br>
170	 *            2. If the response is to be sent for the transaction received,
171	 *            then the application sends the same transaction handle that
172	 *            has been received by it in the indication. <br>
173	 *            3. If the confirmation is to be sent by the stack to the
174	 *            application due to receipt of a response from the peer stack
175	 *            for a request sent by the stack, then the transaction handle
176	 *            shall be same as received in the command request by the stack.
177	 * 
178	 * @param actionHandle
179	 *            - The action handle uniquely identifies the action within a
180	 *            transaction. The action handle field is used for
181	 *            request-response synchronisation.
182	 * 
183	 * <br>
184	 *            1. If the request is sent from application to the remote
185	 *            entity, then the action handle is allocated by the
186	 *            application. On receipt of the response from the peer for the
187	 *            same request, the stack will use the same action handle when
188	 *            giving the confirmation to the application. <br>
189	 *            2. If the indication received from stack is to be sent to the
190	 *            application, then the action handle is allocated by the stack.
191	 *            The response sent by the application to the stack mus have the
192	 *            same action handle as received in the indication.
193	 * 
194	 *            Note: The action handle can be different from the context id
195	 *            when there are multiple action in the same transaction all
196	 *            having context id as 'null' or 'choose' or '*'.
197	 * @param isLastCommandResp
198	 *            - This parameter specifies whether the command response is the
199	 *            last response for the wildcarded request received.
200	 * @param isFirstCommandInAction
201	 *            - This parameter specifies whether the command is the first
202	 *            command in the action.
203	 * @throws IllegalArgumentException
204	 *             : This exception is raised if the value of transaction handle
205	 *             or the action handle passed to this method is less than 0.
206	 */
207	public static CommandResp MegacoCmdRespAdd(java.lang.Object source, int assocHandle, int txnHandle, int actionHandle, boolean isLastCommandResp, boolean isFirstCommandInAction)
208			throws IllegalArgumentException {
209		CommandResp resp = new CommandResp(source, assocHandle, txnHandle, actionHandle, isLastCommandResp, isFirstCommandInAction, CmdResponseType.M_ADD_RESP);
210		return resp;
211	}
212
213	/**
214	 * This method is used for creating the CommandResp class with the request
215	 * identifier set to M_MODIFY_RESP. This method is invoked to obtain the
216	 * object reference of the class CommandResp. This method is valid only if
217	 * the application is MG. This would be used to send MODIFY response for
218	 * command request request received from MGC.
219	 * 
220	 * @param source
221	 *            - A reference to the object, the "source", that is logically
222	 *            deemed to be the object upon which the Event in question
223	 *            initially occurred.
224	 * @param assocHandle
225	 *            - The association handle to uniquely identify the MG-MGC pair.
226	 *            This is allocated by the stack when the Listener registers
227	 *            with the provider with a unique MG-MGC identity.
228	 * @param txnHandle
229	 *            - The transaction handle that shall uniquely identify the
230	 *            transaction id for the transaction in which the command shall
231	 *            be sent.
232	 * 
233	 * <br>
234	 *            1. The transaction handle is allocated by the stack either on
235	 *            request from User application or on receipt of the transaction
236	 *            indication from peer. <br>
237	 *            2. If the response is to be sent for the transaction received,
238	 *            then the application sends the same transaction handle that
239	 *            has been received by it in the indication. <br>
240	 *            3. If the confirmation is to be sent by the stack to the
241	 *            application due to receipt of a response from the peer stack
242	 *            for a request sent by the stack, then the transaction handle
243	 *            shall be same as received in the command request by the stack.
244	 * 
245	 * @param actionHandle
246	 *            - The action handle uniquely identifies the action within a
247	 *            transaction. The action handle field is used for
248	 *            request-response synchronisation.
249	 * 
250	 * <br>
251	 *            1. If the request is sent from application to the remote
252	 *            entity, then the action handle is allocated by the
253	 *            application. On receipt of the response from the peer for the
254	 *            same request, the stack will use the same action handle when
255	 *            giving the confirmation to the application. <br>
256	 *            2. If the indication received from stack is to be sent to the
257	 *            application, then the action handle is allocated by the stack.
258	 *            The response sent by the application to the stack mus have the
259	 *            same action handle as received in the indication.
260	 * 
261	 *            Note: The action handle can be different from the context id
262	 *            when there are multiple action in the same transaction all
263	 *            having context id as 'null' or 'choose' or '*'.
264	 * @param isLastCommandResp
265	 *            - This parameter specifies whether the command response is the
266	 *            last response for the wildcarded request received.
267	 * @param isFirstCommandInAction
268	 *            - This parameter specifies whether the command is the first
269	 *            command in the action.
270	 * @throws IllegalArgumentException
271	 *             : This exception is raised if the value of transaction handle
272	 *             or the action handle passed to this method is less than 0.
273	 */
274	public static CommandResp MegacoCmdRespModify(java.lang.Object source, int assocHandle, int txnHandle, int actionHandle, boolean isLastCommandResp, boolean isFirstCommandInAction)
275			throws IllegalArgumentException {
276		CommandResp resp = new CommandResp(source, assocHandle, txnHandle, actionHandle, isLastCommandResp, isFirstCommandInAction, CmdResponseType.M_MODIFY_RESP);
277		return resp;
278	}
279
280	/**
281	 * This method is used for creating the CommandResp class with the request
282	 * identifier set to M_MOVE_RESP. This method is invoked to obtain the
283	 * object reference of the class CommandResp. This method is valid only if
284	 * the application is MG. This would be used to send MOVE response for
285	 * command request request received from MGC.
286	 * 
287	 * @param source
288	 *            - A reference to the object, the "source", that is logically
289	 *            deemed to be the object upon which the Event in question
290	 *            initially occurred.
291	 * @param assocHandle
292	 *            - The association handle to uniquely identify the MG-MGC pair.
293	 *            This is allocated by the stack when the Listener registers
294	 *            with the provider with a unique MG-MGC identity.
295	 * @param txnHandle
296	 *            - The transaction handle that shall uniquely identify the
297	 *            transaction id for the transaction in which the command shall
298	 *            be sent.
299	 * 
300	 * <br>
301	 *            1. The transaction handle is allocated by the stack either on
302	 *            request from User application or on receipt of the transaction
303	 *            indication from peer. <br>
304	 *            2. If the response is to be sent for the transaction received,
305	 *            then the application sends the same transaction handle that
306	 *            has been received by it in the indication. <br>
307	 *            3. If the confirmation is to be sent by the stack to the
308	 *            application due to receipt of a response from the peer stack
309	 *            for a request sent by the stack, then the transaction handle
310	 *            shall be same as received in the command request by the stack.
311	 * 
312	 * @param actionHandle
313	 *            - The action handle uniquely identifies the action within a
314	 *            transaction. The action handle field is used for
315	 *            request-response synchronisation.
316	 * 
317	 * <br>
318	 *            1. If the request is sent from application to the remote
319	 *            entity, then the action handle is allocated by the
320	 *            application. On receipt of the response from the peer for the
321	 *            same request, the stack will use the same action handle when
322	 *            giving the confirmation to the application. <br>
323	 *            2. If the indication received from stack is to be sent to the
324	 *            application, then the action handle is allocated by the stack.
325	 *            The response sent by the application to the stack mus have the
326	 *            same action handle as received in the indication.
327	 * 
328	 *            Note: The action handle can be different from the context id
329	 *            when there are multiple action in the same transaction all
330	 *            having context id as 'null' or 'choose' or '*'.
331	 * @param isLastCommandResp
332	 *            - This parameter specifies whether the command response is the
333	 *            last response for the wildcarded request received.
334	 * @param isFirstCommandInAction
335	 *            - This parameter specifies whether the command is the first
336	 *            command in the action.
337	 * @throws IllegalArgumentException
338	 *             : This exception is raised if the value of transaction handle
339	 *             or the action handle passed to this method is less than 0.
340	 */
341	public static CommandResp MegacoCmdRespMove(java.lang.Object source, int assocHandle, int txnHandle, int actionHandle, boolean isLastCommandResp, boolean isFirstCommandInAction)
342			throws IllegalArgumentException {
343		CommandResp resp = new CommandResp(source, assocHandle, txnHandle, actionHandle, isLastCommandResp, isFirstCommandInAction, CmdResponseType.M_MOVE_RESP);
344		return resp;
345	}
346
347	/**
348	 * This method is used for creating the CommandResp class with the request
349	 * identifier set to M_SERVICE_CHANGE_RESP. This method is invoked to obtain
350	 * the object reference of the class CommandResp. This method is valid for
351	 * both MG and MGC application. This would be used to send ServiceChange
352	 * response for command request request received from peer.
353	 * 
354	 * @param source
355	 *            - A reference to the object, the "source", that is logically
356	 *            deemed to be the object upon which the Event in question
357	 *            initially occurred.
358	 * @param assocHandle
359	 *            - The association handle to uniquely identify the MG-MGC pair.
360	 *            This is allocated by the stack when the Listener registers
361	 *            with the provider with a unique MG-MGC identity.
362	 * @param txnHandle
363	 *            - The transaction handle that shall uniquely identify the
364	 *            transaction id for the transaction in which the command shall
365	 *            be sent.
366	 * 
367	 * <br>
368	 *            1. The transaction handle is allocated by the stack either on
369	 *            request from User application or on receipt of the transaction
370	 *            indication from peer. <br>
371	 *            2. If the response is to be sent for the transaction received,
372	 *            then the application sends the same transaction handle that
373	 *            has been received by it in the indication. <br>
374	 *            3. If the confirmation is to be sent by the stack to the
375	 *            application due to receipt of a response from the peer stack
376	 *            for a request sent by the stack, then the transaction handle
377	 *            shall be same as received in the command request by the stack.
378	 * 
379	 * @param actionHandle
380	 *            - The action handle uniquely identifies the action within a
381	 *            transaction. The action handle field is used for
382	 *            request-response synchronisation.
383	 * 
384	 * <br>
385	 *            1. If the request is sent from application to the remote
386	 *            entity, then the action handle is allocated by the
387	 *            application. On receipt of the response from the peer for the
388	 *            same request, the stack will use the same action handle when
389	 *            giving the confirmation to the application. <br>
390	 *            2. If the indication received from stack is to be sent to the
391	 *            application, then the action handle is allocated by the stack.
392	 *            The response sent by the application to the stack mus have the
393	 *            same action handle as received in the indication.
394	 * 
395	 *            Note: The action handle can be different from the context id
396	 *            when there are multiple action in the same transaction all
397	 *            having context id as 'null' or 'choose' or '*'.
398	 * @param isLastCommandResp
399	 *            - This parameter specifies whether the command response is the
400	 *            last response for the wildcarded request received.
401	 * @param isFirstCommandInAction
402	 *            - This parameter specifies whether the command is the first
403	 *            command in the action.
404	 * @throws IllegalArgumentException
405	 *             : This exception is raised if the value of transaction handle
406	 *             or the action handle passed to this method is less than 0.
407	 */
408	public static CommandResp MegacoCmdRespSrvChng(java.lang.Object source, int assocHandle, int txnHandle, int actionHandle, boolean isLastCommandResp, boolean isFirstCommandInAction)
409			throws IllegalArgumentException {
410		CommandResp resp = new CommandResp(source, assocHandle, txnHandle, actionHandle, isLastCommandResp, isFirstCommandInAction, CmdResponseType.M_SERVICE_CHANGE_RESP);
411		return resp;
412	}
413
414	/**
415	 * This method is used for creating the CommandResp class with the request
416	 * identifier set to M_NOTIFY_RESP. This method is invoked to obtain the
417	 * object reference of the class CommandResp. This method is valid only if
418	 * the application is MGC. This would be used to send NOTIFY response for
419	 * command request request received from MG.
420	 * 
421	 * @param source
422	 *            - A reference to the object, the "source", that is logically
423	 *            deemed to be the object upon which the Event in question
424	 *            initially occurred.
425	 * @param assocHandle
426	 *            - The association handle to uniquely identify the MG-MGC pair.
427	 *            This is allocated by the stack when the Listener registers
428	 *            with the provider with a unique MG-MGC identity.
429	 * @param txnHandle
430	 *            - The transaction handle that shall uniquely identify the
431	 *            transaction id for the transaction in which the command shall
432	 *            be sent.
433	 * 
434	 * <br>
435	 *            1. The transaction handle is allocated by the stack either on
436	 *            request from User application or on receipt of the transaction
437	 *            indication from peer. <br>
438	 *            2. If the response is to be sent for the transaction received,
439	 *            then the application sends the same transaction handle that
440	 *            has been received by it in the indication. <br>
441	 *            3. If the confirmation is to be sent by the stack to the
442	 *            application due to receipt of a response from the peer stack
443	 *            for a request sent by the stack, then the transaction handle
444	 *            shall be same as received in the command request by the stack.
445	 * 
446	 * @param actionHandle
447	 *            - The action handle uniquely identifies the action within a
448	 *            transaction. The action handle field is used for
449	 *            request-response synchronisation.
450	 * 
451	 * <br>
452	 *            1. If the request is sent from application to the remote
453	 *            entity, then the action handle is allocated by the
454	 *            application. On receipt of the response from the peer for the
455	 *            same request, the stack will use the same action handle when
456	 *            giving the confirmation to the application. <br>
457	 *            2. If the indication received from stack is to be sent to the
458	 *            application, then the action handle is allocated by the stack.
459	 *            The response sent by the application to the stack mus have the
460	 *            same action handle as received in the indication.
461	 * 
462	 *            Note: The action handle can be different from the context id
463	 *            when there are multiple action in the same transaction all
464	 *            having context id as 'null' or 'choose' or '*'.
465	 * @param isLastCommandResp
466	 *            - This parameter specifies whether the command response is the
467	 *            last response for the wildcarded request received.
468	 * @param isFirstCommandInAction
469	 *            - This parameter specifies whether the command is the first
470	 *            command in the action.
471	 * @throws IllegalArgumentException
472	 *             : This exception is raised if the value of transaction handle
473	 *             or the action handle passed to this method is less than 0.
474	 */
475	public static CommandResp MegacoCmdRespNotify(java.lang.Object source, int assocHandle, int txnHandle, int actionHandle, boolean isLastCommandResp, boolean isFirstCommandInAction)
476			throws IllegalArgumentException {
477		CommandResp resp = new CommandResp(source, assocHandle, txnHandle, actionHandle, isLastCommandResp, isFirstCommandInAction, CmdResponseType.M_NOTIFY_RESP);
478		return resp;
479	}
480
481	/**
482	 * This method is used for creating the CommandResp class with the request
483	 * identifier set to M_AUDIT_CAP_RESP. This method is invoked to obtain the
484	 * object reference of the class CommandResp. This method is valid only if
485	 * the application is MG. This would be used to send AuditCapability
486	 * response for command request request received from MGC.
487	 * 
488	 * @param source
489	 *            - A reference to the object, the "source", that is logically
490	 *            deemed to be the object upon which the Event in question
491	 *            initially occurred.
492	 * @param assocHandle
493	 *            - The association handle to uniquely identify the MG-MGC pair.
494	 *            This is allocated by the stack when the Listener registers
495	 *            with the provider with a unique MG-MGC identity.
496	 * @param txnHandle
497	 *            - The transaction handle that shall uniquely identify the
498	 *            transaction id for the transaction in which the command shall
499	 *            be sent.
500	 * 
501	 * <br>
502	 *            1. The transaction handle is allocated by the stack either on
503	 *            request from User application or on receipt of the transaction
504	 *            indication from peer. <br>
505	 *            2. If the response is to be sent for the transaction received,
506	 *            then the application sends the same transaction handle that
507	 *            has been received by it in the indication. <br>
508	 *            3. If the confirmation is to be sent by the stack to the
509	 *            application due to receipt of a response from the peer stack
510	 *            for a request sent by the stack, then the transaction handle
511	 *            shall be same as received in the command request by the stack.
512	 * 
513	 * @param actionHandle
514	 *            - The action handle uniquely identifies the action within a
515	 *            transaction. The action handle field is used for
516	 *            request-response synchronisation.
517	 * 
518	 * <br>
519	 *            1. If the request is sent from application to the remote
520	 *            entity, then the action handle is allocated by the
521	 *            application. On receipt of the response from the peer for the
522	 *            same request, the stack will use the same action handle when
523	 *            giving the confirmation to the application. <br>
524	 *            2. If the indication received from stack is to be sent to the
525	 *            application, then the action handle is allocated by the stack.
526	 *            The response sent by the application to the stack mus have the
527	 *            same action handle as received in the indication.
528	 * 
529	 *            Note: The action handle can be different from the context id
530	 *            when there are multiple action in the same transaction all
531	 *            having context id as 'null' or 'choose' or '*'.
532	 * @param isLastCommandResp
533	 *            - This parameter specifies whether the command response is the
534	 *            last response for the wildcarded request received.
535	 * @param isFirstCommandInAction
536	 *            - This parameter specifies whether the command is the first
537	 *            command in the action.
538	 * @throws IllegalArgumentException
539	 *             : This exception is raised if the value of transaction handle
540	 *             or the action handle passed to this method is less than 0.
541	 */
542	public static CommandResp MegacoCmdRespAuditCap(java.lang.Object source, int assocHandle, int txnHandle, int actionHandle, boolean isLastCommandResp, boolean isFirstCommandInAction)
543			throws IllegalArgumentException {
544		CommandResp resp = new CommandResp(source, assocHandle, txnHandle, actionHandle, isLastCommandResp, isFirstCommandInAction, CmdResponseType.M_AUDIT_CAP_RESP);
545		return resp;
546	}
547
548	/**
549	 * This method is used for creating the CommandResp class with the request
550	 * identifier set to M_AUDIT_VAL_RESP. This method is invoked to obtain the
551	 * object reference of the class CommandResp. This method is valid only if
552	 * the application is MG. This would be used to send AuditValue response for
553	 * command request request received from MGC.
554	 * 
555	 * @param source
556	 *            - A reference to the object, the "source", that is logically
557	 *            deemed to be the object upon which the Event in question
558	 *            initially occurred.
559	 * @param assocHandle
560	 *            - The association handle to uniquely identify the MG-MGC pair.
561	 *            This is allocated by the stack when the Listener registers
562	 *            with the provider with a unique MG-MGC identity.
563	 * @param txnHandle
564	 *            - The transaction handle that shall uniquely identify the
565	 *            transaction id for the transaction in which the command shall
566	 *            be sent.
567	 * 
568	 * <br>
569	 *            1. The transaction handle is allocated by the stack either on
570	 *            request from User application or on receipt of the transaction
571	 *            indication from peer. <br>
572	 *            2. If the response is to be sent for the transaction received,
573	 *            then the application sends the same transaction handle that
574	 *            has been received by it in the indication. <br>
575	 *            3. If the confirmation is to be sent by the stack to the
576	 *            application due to receipt of a response from the peer stack
577	 *            for a request sent by the stack, then the transaction handle
578	 *            shall be same as received in the command request by the stack.
579	 * 
580	 * @param actionHandle
581	 *            - The action handle uniquely identifies the action within a
582	 *            transaction. The action handle field is used for
583	 *            request-response synchronisation.
584	 * 
585	 * <br>
586	 *            1. If the request is sent from application to the remote
587	 *            entity, then the action handle is allocated by the
588	 *            application. On receipt of the response from the peer for the
589	 *            same request, the stack will use the same action handle when
590	 *            giving the confirmation to the application. <br>
591	 *            2. If the indication received from stack is to be sent to the
592	 *            application, then the action handle is allocated by the stack.
593	 *            The response sent by the application to the stack mus have the
594	 *            same action handle as received in the indication.
595	 * 
596	 *            Note: The action handle can be different from the context id
597	 *            when there are multiple action in the same transaction all
598	 *            having context id as 'null' or 'choose' or '*'.
599	 * @param isLastCommandResp
600	 *            - This parameter specifies whether the command response is the
601	 *            last response for the wildcarded request received.
602	 * @param isFirstCommandInAction
603	 *            - This parameter specifies whether the command is the first
604	 *            command in the action.
605	 * @throws IllegalArgumentException
606	 *             : This exception is raised if the value of transaction handle
607	 *             or the action handle passed to this method is less than 0.
608	 */
609	public static CommandResp MegacoCmdRespAuditVal(java.lang.Object source, int assocHandle, int txnHandle, int actionHandle, boolean isLastCommandResp, boolean isFirstCommandInAction)
610			throws IllegalArgumentException {
611		CommandResp resp = new CommandResp(source, assocHandle, txnHandle, actionHandle, isLastCommandResp, isFirstCommandInAction, CmdResponseType.M_AUDIT_VAL_RESP);
612		return resp;
613	}
614
615	/**
616	 * This method is used for creating the CommandResp class with the request
617	 * identifier set to M_SUBTRACT_RESP. This method is invoked to obtain the
618	 * object reference of the class CommandResp. This method is valid only if
619	 * the application is MG. This would be used to send SUBTRACT response for
620	 * command request request received from MGC.
621	 * 
622	 * @param source
623	 *            - A reference to the object, the "source", that is logically
624	 *            deemed to be the object upon which the Event in question
625	 *            initially occurred.
626	 * @param assocHandle
627	 *            - The association handle to uniquely identify the MG-MGC pair.
628	 *            This is allocated by the stack when the Listener registers
629	 *            with the provider with a unique MG-MGC identity.
630	 * @param txnHandle
631	 *            - The transaction handle that shall uniquely identify the
632	 *            transaction id for the transaction in which the command shall
633	 *            be sent.
634	 * 
635	 * <br>
636	 *            1. The transaction handle is allocated by the stack either on
637	 *            request from User application or on receipt of the transaction
638	 *            indication from peer. <br>
639	 *            2. If the response is to be sent for the transaction received,
640	 *            then the application sends the same transaction handle that
641	 *            has been received by it in the indication. <br>
642	 *            3. If the confirmation is to be sent by the stack to the
643	 *            application due to receipt of a response from the peer stack
644	 *            for a request sent by the stack, then the transaction handle
645	 *            shall be same as received in the command request by the stack.
646	 * 
647	 * @param actionHandle
648	 *            - The action handle uniquely identifies the action within a
649	 *            transaction. The action handle field is used for
650	 *            request-response synchronisation.
651	 * 
652	 * <br>
653	 *            1. If the request is sent from application to the remote
654	 *            entity, then the action handle is allocated by the
655	 *            application. On receipt of the response from the peer for the
656	 *            same request, the stack will use the same action handle when
657	 *            giving the confirmation to the application. <br>
658	 *            2. If the indication received from stack is to be sent to the
659	 *            application, then the action handle is allocated by the stack.
660	 *            The response sent by the application to the stack mus have the
661	 *            same action handle as received in the indication.
662	 * 
663	 *            Note: The action handle can be different from the context id
664	 *            when there are multiple action in the same transaction all
665	 *            having context id as 'null' or 'choose' or '*'.
666	 * @param isLastCommandResp
667	 *            - This parameter specifies whether the command response is the
668	 *            last response for the wildcarded request received.
669	 * @param isFirstCommandInAction
670	 *            - This parameter specifies whether the command is the first
671	 *            command in the action.
672	 * @throws IllegalArgumentException
673	 *             : This exception is raised if the value of transaction handle
674	 *             or the action handle passed to this method is less than 0.
675	 */
676	public static CommandResp MegacoCmdRespSubtract(java.lang.Object source, int assocHandle, int txnHandle, int actionHandle, boolean isLastCommandResp, boolean isFirstCommandInAction)
677			throws IllegalArgumentException {
678		CommandResp resp = new CommandResp(source, assocHandle, txnHandle, actionHandle, isLastCommandResp, isFirstCommandInAction, CmdResponseType.M_SUBTRACT_RESP);
679		return resp;
680	}
681}