/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

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