PageRenderTime 27ms CodeModel.GetById 18ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 0ms

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