/protocols/jain-megaco/megaco-api/src/main/java/javax/megaco/AssociationEvent.java

http://mobicents.googlecode.com/ · Java · 59 lines · 14 code · 6 blank · 39 comment · 0 complexity · 0c8e57ae63acabe8e803c793ac47d113 MD5 · raw file

  1. package javax.megaco;
  2. import java.util.EventObject;
  3. public abstract class AssociationEvent extends EventObject {
  4. private int assocHandle;
  5. /**
  6. * Constructs a Association Event object. This is an abstract class and can
  7. * be called only by the derived classes.
  8. *
  9. * @param source
  10. * A reference to the object, the "source", that is logically
  11. * deemed to be the object upon which the Event in question
  12. * initially occurred.
  13. * @param assocHandle
  14. * The association handle to uniquely identify the MG-MGC pair.
  15. * This is allocated by the stack when the Listener registers
  16. * with the provider with a unique MG-MGC identity.
  17. * @throws IllegalArgumentException
  18. * if the parameters send in the constructor are invalid.
  19. */
  20. public AssociationEvent(java.lang.Object source, int assocHandle)
  21. throws IllegalArgumentException {
  22. super(source);
  23. this.assocHandle = assocHandle;
  24. }
  25. /**
  26. * Gets the Association Handle for which this association level event is to
  27. * be sent. This is required by the stack for each association level event
  28. * from the application to the stack, for stack to identify to which remote
  29. * address the command has to be sent and also from which of the local
  30. * transport it needs to be sent. This is allocated by the stack when
  31. * Listener registers with the provider.
  32. *
  33. * @return Reference to the association handle which uniquely identifies the
  34. * MG-MGC pair.
  35. */
  36. public int getAssocHandle() {
  37. return this.assocHandle;
  38. }
  39. /**
  40. * This is a virtual method and shall be defined in the derived classes. See
  41. * javax.megaco.association.AssocEventType for the definition of the
  42. * constants for the Association events. This is not set in this object but
  43. * is retrieved from the derived classes. Hence all derived classes need to
  44. * implement this method.
  45. *
  46. * @return Returns an integer value that identifies this event object as a
  47. * association creation/ deletion/ modification request event or
  48. * association creation or deletion or modification response event
  49. * or association indication event.
  50. */
  51. public abstract int getAssocOperIdentifier();
  52. //FIXME: should this be object ?
  53. }