PageRenderTime 20ms CodeModel.GetById 15ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/protocols/jain-megaco/megaco-api/src/main/java/javax/megaco/pkg/ToneDetPkg/ToneParamDur.java

http://mobicents.googlecode.com/
Java | 95 lines | 31 code | 12 blank | 52 comment | 0 complexity | f5f9b401c34078a7f90dcbcd4c51956d MD5 | raw file
 1package javax.megaco.pkg.ToneDetPkg;
 2
 3import javax.megaco.message.DescriptorType;
 4import javax.megaco.pkg.ParamValueType;
 5import javax.megaco.pkg.PkgConsts;
 6import javax.megaco.pkg.PkgItemParam;
 7
 8/**
 9 * The MEGACO parameter class for the Duration Parameter is associated with Long
10 * Tone Detect and End Tone Detect event of Network Package. This class defines
11 * all the static information for this parameter.
12 */
13public class ToneParamDur extends PkgItemParam {
14
15	/**
16	 *Identifies Duration parameter of the MEGACO Tone Detect Package. Its value shall be set equal to 0x0002.
17	 */
18	public static final int TONE_DET_PARAM_DUR = 0x0002;
19
20	protected int[] paramsItemIds = null;
21
22	/**
23	 * Constructs a parameter class for tone detect package that specifies the
24	 * parameter as tone id.
25	 */
26	public ToneParamDur() {
27		super();
28		super.paramId = TONE_DET_PARAM_DUR;
29		super.itemValueType = ParamValueType.M_INTEGER;
30		super.paramsDescriptorIds = new int[] { DescriptorType.M_OBSERVED_EVENT_DESC };
31		this.paramsItemIds = new int[] {  ToneEtdEvent.TONE_DET_ETD_EVENT, ToneLtdEvent.TONE_DET_LTD_EVENT };
32	}
33
34	/**
35	 * The method can be used to get the parameter identifier as defined in the
36	 * MEGACO packages. The implementation of this method in this class returns
37	 * Id of Tone List parameter.
38	 * 
39	 * @return paramId - Returns param id as {@link TONE_DET_PARAM_DUR}.
40	 */
41	public int getParamId() {
42
43		return super.paramId;
44	}
45
46	/**
47	 * The method can be used to get the type of the parameter as defined in the
48	 * MEGACO packages. These could be one of string or enumerated value or
49	 * integer or double value or boolean.
50	 * 
51	 * @return It returns {@link ParamValueType.M_INTEGER}
52	 *         indicating that the parameter is a string.
53	 */
54	public int getParamValueType() {
55
56		return super.itemValueType;
57	}
58
59	/**
60	 * The method can be used to get the item ids corresponding to the
61	 * parameters to which the parameter can be set. This method specifies the
62	 * valid item (event/signal) ids to which the parameter can belong to.
63	 * 
64	 * @return The integer values corresponding to start tone detected, end tone detected and long tone detected. Thus this shall return a vector containing the elements   {@link AnalogLineSOnEvt.TONE_DET_ETD_EVENT} and
65	 *         {@link ToneLtdEvent.TONE_DET_LTD_EVENT}.
66	 */
67	public int[] getParamsItemIds() {
68		return this.paramsItemIds;
69	}
70
71	/**
72	 * The method can be used to get the package id corresponding to the to
73	 * which the parameter can be set. This method specifies the package for
74	 * which the parameter is valid. Even though the parameter may be set for an
75	 * item, but the parameter may not be valid for package to which the item
76	 * belongs, but may be valid for a package which has extended this package.
77	 * 
78	 * @return This shall return {@link PkgConsts.TONE_DET_PACKAGE} as the
79	 *         integer value. The integer values are defined in
80	 *         {@link PkgConsts}.
81	 */
82	public int getParamsPkgId() {
83		return PkgConsts.TONE_GEN_PACKAGE;
84	}
85
86	/**
87	 * The method can be used to get the descriptor ids corresponding to the
88	 * parameters to which the parameter can be set.
89	 * 
90	 * @return This parameter can be present in Event descriptor. It shall thus return a value  {@link DescriptorType.M_OBSERVED_EVENT_DESC} and {@link DescriptorType.M_EVENT_DESC}.
91	 */
92	public int[] getParamsDescriptorIds() {
93		return super.paramsDescriptorIds;
94	}
95}