PageRenderTime 23ms CodeModel.GetById 12ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

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