/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

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