PageRenderTime 31ms CodeModel.GetById 18ms app.highlight 9ms RepoModel.GetById 1ms app.codeStats 0ms

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

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