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

http://mobicents.googlecode.com/ · Java · 158 lines · 37 code · 21 blank · 100 comment · 2 complexity · 1bdd013c78b669fadf23ce9c49aee7d8 MD5 · raw file

  1. package javax.megaco.message.descriptor;
  2. import java.io.Serializable;
  3. import javax.megaco.pkg.PkgEventItem;
  4. import javax.megaco.pkg.PkgItemStr;
  5. /**
  6. * The RequestedEventParam object is a class that shall be used to set the event
  7. * params within the event descriptor. The class optionally provides interface
  8. * to specify the package name, item name and the associated parameters in the
  9. * string format. This is an independent class derived from java.util.Object and
  10. * shall not have any derived classes.
  11. *
  12. *
  13. */
  14. public class RequestedEventParam implements Serializable {
  15. private PkgEventItem eventItem = null;
  16. private PkgItemStr itemStr = null;
  17. private EmbedFirstEventParam embedFirstEventParam = null;
  18. private EventParam eventParam = null;
  19. /**
  20. *
  21. * Constructs Requested event parameter object with the {@link PkgEventItem}
  22. * object. This is used to set the first level event parameters.
  23. *
  24. * @param eventItem
  25. * @throws IllegalArgumentException
  26. * - Thrown if an invalid eventItem object reference is set.
  27. */
  28. public RequestedEventParam(PkgEventItem eventItem) throws IllegalArgumentException {
  29. // FIXME: add error throw ? - what does invalind even item reference
  30. // mean ?
  31. this.eventItem = eventItem;
  32. }
  33. /**
  34. *
  35. * Constructs Requested event parameter object with the PkgItemStr object.
  36. * This method would be used if the package parameters are to be conveyed in
  37. * the string format. This is used to set the first level event parameters.
  38. *
  39. * @param eventItemStr
  40. * @throws IllegalArgumentException
  41. * IllegalArgumentException - Thrown if an invalid eventItemStr
  42. * object reference is set.
  43. */
  44. public RequestedEventParam(PkgItemStr eventItemStr) throws IllegalArgumentException {
  45. // FIXME: add error throw ?
  46. this.itemStr = eventItemStr;
  47. }
  48. /**
  49. * The method can be used the to retrieve the embedded event information.
  50. *
  51. * @return embedFirst - The object identifier corresponding to the embedded
  52. * first. This object interface may optionally be there. If
  53. * emberFirstEventParam is not set, then this method would return
  54. * NULL.
  55. */
  56. public EmbedFirstEventParam getEmbedFirstEventParam() {
  57. return this.embedFirstEventParam;
  58. }
  59. /**
  60. * The method can be used the to set the object reference to the embeded
  61. * event which has reference to the its event parameters, request id, and
  62. * its package object. This method validates whether the package name, event
  63. * id and the parameter can be set for the embedded event descriptor. In
  64. * case of an error, an exception is raised.
  65. *
  66. * @param embedEvent
  67. * - The objectIdentifier corresponding to the embedded event
  68. * descriptor.
  69. * @throws IllegalArgumentException
  70. * : This exception is raised if the reference of embed first
  71. * event parameter passed to this method is NULL.
  72. */
  73. public void setEmbedFirstEventParam(EmbedFirstEventParam embedEvent) throws IllegalArgumentException {
  74. if (embedEvent == null) {
  75. throw new IllegalArgumentException();
  76. }
  77. this.embedFirstEventParam = embedEvent;
  78. }
  79. /**
  80. * The method can be used the to retrieve the parameters corresponding to
  81. * whether the keep alive token is set, the digit map name or digit map
  82. * value is set or the embeded signal is set or stream id is set.
  83. *
  84. * @return EventParam - object identifier corresponding to the event
  85. * parameters corresponding to the non embedded event id. This
  86. * object interface may optionally be there. If the event parameter
  87. * is not set then this returns a NULL value.
  88. */
  89. public EventParam getEventParam() {
  90. return this.eventParam;
  91. }
  92. /**
  93. * The method can be used the to set the object reference to the event
  94. * parameter which has reference to whether keepactive token is present,
  95. * signal descriptor, digit map descriptor stream id. In case of an error,
  96. * an exception is raised.
  97. *
  98. * @param eventParam
  99. * - The objectIdentifier corresponding to the event paramater of
  100. * first level event.
  101. * @throws IllegalArgumentException
  102. * - Thrown if an illegal event is set in the embedded event
  103. * descriptor.
  104. */
  105. public void setEventParam(EventParam eventParam) throws IllegalArgumentException {
  106. // FIXME: add checks
  107. this.eventParam = eventParam;
  108. }
  109. /**
  110. * The method can be used to get the package name in the Event descriptor.
  111. * This method gives the package information, the attached event information
  112. * and the parameter name and value for the event id.
  113. *
  114. * @return package - The object reference for the Event Item. This has the
  115. * object reference of corresponding megaco package and has the
  116. * reference of the parameter info associated with it. If the
  117. * parameter has not been set, then this method shall return NULL.
  118. */
  119. public PkgEventItem getMegacoPkgEventItem() {
  120. return this.eventItem;
  121. }
  122. /**
  123. * The method can be used to get the pkdgName as set in the Event
  124. * descriptor. This method gives the package information, the attached event
  125. * information and the parameter name and value. Compared to the
  126. * getMegacoPkgEventItem() method, this method returnes the package
  127. * parameters in the string format.
  128. *
  129. * @return The object reference for the megaco package item. This class
  130. * holds information about package name, item name and the
  131. * parameters in the string format. If the parameter has not been
  132. * set, then this method shall return NULL.
  133. */
  134. public PkgItemStr getMegacoPkgItemStr() {
  135. return this.itemStr;
  136. }
  137. }