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

http://mobicents.googlecode.com/ · Java · 83 lines · 15 code · 5 blank · 63 comment · 2 complexity · 93f37c84a7cb4e380987b13eef1584c5 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 action request event i.e. when an action comes or is to be sent
  6. * without a command, but has context parameters.
  7. *
  8. *
  9. */
  10. public class ContextInfoReq extends CommandEvent {
  11. /**
  12. * Constructs a Context Information Request Event object.
  13. *
  14. * @param source
  15. * - A reference to the object, the "source", that is logically
  16. * deemed to be the object upon which the Event in question
  17. * initially occurred.
  18. * @param assocHandle
  19. * - The association handle to uniquely identify the MG-MGC pair.
  20. * This is allocated by the stack when the Listener registers
  21. * with the provider with a unique MG-MGC identity.
  22. * @param transactionHandle
  23. * - The transaction handle that shall uniquely identify the
  24. * transaction id for the transaction in which the command shall
  25. * be sent.
  26. *
  27. * <br>
  28. * 1. The transaction handle is allocated by the stack either on
  29. * request from User application or on receipt of the transaction
  30. * indication from peer. <br>
  31. * 2. If the response is to be sent for the transaction received,
  32. * then the application sends the same transaction handle that
  33. * has been received by it in the indication. <br>
  34. * 3. If the confirmation is to be sent by the stack to the
  35. * application due to receipt of a response from the peer stack
  36. * for a request sent by the stack, then the transaction handle
  37. * shall be same as received in the command request by the stack.
  38. *
  39. * @param actionHandle
  40. * - The action handle uniquely identifies the action within a
  41. * transaction. The action handle field is used for
  42. * request-response synchronisation.
  43. *
  44. * <br>
  45. * 1. If the request is sent from application to the remote
  46. * entity, then the action handle is allocated by the
  47. * application. On receipt of the response from the peer for the
  48. * same request, the stack will use the same action handle when
  49. * giving the confirmation to the application. <br>
  50. * 2. If the indication received from stack is to be sent to the
  51. * application, then the action handle is allocated by the stack.
  52. * The response sent by the application to the stack mus have the
  53. * same action handle as received in the indication.
  54. *
  55. * Note: The action handle can be different from the context id
  56. * when there are multiple action in the same transaction all
  57. * having context id as 'null' or 'choose' or '*'.
  58. * @param isLastActionInTransaction
  59. * - This parameter specifies whether the action is last action
  60. * in the transaction.
  61. * @throws IllegalArgumentException
  62. * : This exception is raised if the value of transaction handle
  63. * or the action handle passed to this method is less than 0.
  64. */
  65. public ContextInfoReq(java.lang.Object source, int assocHandle, int transactionHandle, int actionHandle, boolean isLastActionInTransaction) throws IllegalArgumentException {
  66. super(source, assocHandle, transactionHandle, actionHandle, false, isLastActionInTransaction);
  67. if (transactionHandle < 0 || actionHandle < 0) {
  68. IllegalArgumentException invalidArgumentException = new IllegalArgumentException("txnHandle or actionHandle cannot be less than 0 for ContextInfoReq");
  69. // invalidArgumentException.setAssocHandle(assocHandle);
  70. throw invalidArgumentException;
  71. }
  72. }
  73. @Override
  74. public int getCommandIdentifier() {
  75. // TODO Auto-generated method stub
  76. return CommandType.M_ACTION_REQ;
  77. }
  78. }