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

http://mobicents.googlecode.com/ · Java · 70 lines · 24 code · 12 blank · 34 comment · 4 complexity · db1410df3df8441650b4f18da2346b37 MD5 · raw file

  1. package javax.megaco.message.descriptor;
  2. import java.io.Serializable;
  3. import javax.megaco.message.Descriptor;
  4. import javax.megaco.message.DescriptorType;
  5. /**
  6. * The class extends JAIN MEGACO Descriptor. This class describes the event
  7. * buffer descriptor.
  8. */
  9. public class EventBufferDescriptor extends Descriptor implements Serializable {
  10. private EventBufParam[] eventBufParam;
  11. /**
  12. * Constructs a Event Buffer Descriptor with the vector of event buffer
  13. * parameter. The event buffer parameters gives the package information, the
  14. * attached stream id and the parameter name and value for the events
  15. * buffered.
  16. *
  17. * @throws IllegalArgumentException
  18. * : This exception is raised if the reference of vector of
  19. * Event Buffer Param passed to this method is NULL.
  20. */
  21. public EventBufferDescriptor(EventBufParam[] evtBufParam) throws IllegalArgumentException {
  22. super();
  23. if (evtBufParam == null) {
  24. throw new IllegalArgumentException("EventBufParam[] must not be null");
  25. }
  26. if (evtBufParam.length == 0) {
  27. throw new IllegalArgumentException("EventBufParam[] must not be empty");
  28. }
  29. this.eventBufParam = evtBufParam;
  30. super.descriptorId = DescriptorType.M_EVENT_BUF_DESC;
  31. }
  32. /**
  33. * This method cannot be overridden by the derived class. This method
  34. * returns that the descriptor identifier is of type Event Buffer
  35. * descriptor. This method overrides the corresponding method of the base
  36. * class Descriptor.
  37. *
  38. * @return Returns an integer value that identifies this object as the type
  39. * of event buffer descriptor. It returns that it is Event Buffer
  40. * Descriptor i.e., M_EVENT_BUF_DESC.
  41. */
  42. public int getDescriptorId() {
  43. return super.descriptorId;
  44. }
  45. /**
  46. * The method can be used to get the pkdgName, eventother and the event
  47. * stream in the event buffer descriptor for multiple events. This method
  48. * gives the package information, the attached stream id and the parameter
  49. * name and value for the multiple events.
  50. *
  51. * @return bufParam - The vector of object reference for the event buffer
  52. * parameter that contains the package name, item name, pramaeter
  53. * name, parameter value and the stream id.
  54. */
  55. public EventBufParam[] getEventBufParam() {
  56. return this.eventBufParam;
  57. }
  58. }