/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

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