/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

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