PageRenderTime 15ms CodeModel.GetById 1ms app.highlight 8ms RepoModel.GetById 1ms app.codeStats 1ms

/protocols/jain-megaco/megaco-api/src/main/java/javax/megaco/pkg/GenericPkg/GenParamFailureCause.java

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