PageRenderTime 26ms CodeModel.GetById 18ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

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