PageRenderTime 28ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

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

http://mobicents.googlecode.com/
Java | 136 lines | 26 code | 24 blank | 86 comment | 0 complexity | 0e0f301447520a3c41455680983f9f25 MD5 | raw file
Possible License(s): LGPL-3.0, GPL-3.0, LGPL-2.1, GPL-2.0, CC-BY-SA-3.0, CC0-1.0, Apache-2.0, BSD-3-Clause
  1. package javax.megaco.pkg;
  2. import java.util.Arrays;
  3. import javax.megaco.MethodInvocationException;
  4. import javax.megaco.ParameterNotSetException;
  5. /**
  6. * The MEGACO statistics item class is an abstract class defined as the base
  7. * class for all the statistics items in the MEGACO Package. This class shall be
  8. * used for setting the statistics and their values. This extends the PkgItem
  9. * class. This is an abstract class and hence cannot be created as a separate
  10. * object.
  11. *
  12. *
  13. */
  14. public abstract class PkgStatsItem extends PkgValueItem {
  15. //FIXME: orignaly it only extends PkgItem
  16. private ParamRelation paramRelation;
  17. protected int statisticsId = -1;
  18. /**
  19. * Constructs a Jain MEGACO Package Statistics Item Object. This is an
  20. * abstract class and can be called only by the derived classes.
  21. */
  22. public PkgStatsItem() {
  23. }
  24. /**
  25. * The method can be used to get the statistics identifier. This method
  26. * gives the statistics id of the package. This is an abstract method and is
  27. * defined by the methods of the derived class which shall return an hard
  28. * coded value for the statistics id.
  29. *
  30. * @return statisticsId - The integer corresponding to the statistics id.
  31. */
  32. public abstract int getStatisticsId();
  33. /**
  34. * The method can be used to get the statistics identifier. This method
  35. * gives the statistics id of the package. This is an abstract method and is
  36. * defined by the methods of the derived class which shall return an hard
  37. * coded value for the statistics id.
  38. *
  39. * statisticsId - The integer corresponding to the statistics id.
  40. */
  41. public abstract int getItemId();
  42. /**
  43. * This method overrides the corresponding method in PkgItem. This shall
  44. * return an hard coded value to indicate the item type is statistics.
  45. *
  46. * itemType - An integer value for the item type corresponding to the
  47. * statistics. This shall return {@link javax.megaco.pkg.PkgItemType.M_STATISTICS}.
  48. */
  49. public final int getItemType() {
  50. return PkgItemType.M_STATISTICS;
  51. }
  52. /**
  53. * The method can be used to get the type of the value as defined in the
  54. * MEGACO packages. These could be one of string or enumerated value or
  55. * integer or boolean or double value.
  56. *
  57. * @return valueType - The integer corresponding to the value type. The
  58. * values shall be defined in ParamValueType.
  59. */
  60. public abstract int getItemValueType();
  61. /**
  62. * The method can be used to get the relation of the value as defined in the
  63. * MEGACO packages. The relation operator can be one of equal, not equal,
  64. * greater than or less than operator for single value. The MEGACO parameter
  65. * is accompanied by a parameter value that can be single value or set of
  66. * values or sublist of values or range of values. The relation operator can
  67. * be equal when the value is set or sublist or range. This method specifies
  68. * both the relation operator and also specifies whether the accompaning
  69. * parameter value is single value or set of values or sublist of values or
  70. * range of value. If the relation specifies set or range or sublist, it
  71. * automatically assumes the relation to be "MEGACO_EQUAL".
  72. *
  73. * @return paramRelation - The int corresponding to the value relation. The
  74. * values shall be defined in ParamRelation.
  75. */
  76. public final ParamRelation getItemsValueRelation() throws javax.megaco.ParameterNotSetException {
  77. return paramRelation;
  78. }
  79. /**
  80. * The method can be used to get the descriptor ids corresponding to the
  81. * item. This shall be overriden by the derived class and would be returned
  82. * a hardcoded value from the derived class.
  83. *
  84. * @return descriptorId - The vector of integers corresponding to the
  85. * descriptor to which the item can be used. The values shall be
  86. * defined in DescriptorType.
  87. */
  88. public abstract int[] getItemsDescriptorIds();
  89. /**
  90. * The method can be used to set the relation of the value as defined in the
  91. * MEGACO packages. The relation operator can be one of equal, not equal,
  92. * greater than or less than operator for single value. The MEGACO parameter
  93. * is accompanied by a parameter value that can be single value or set of
  94. * values or sublist of values or range of values. The relation operator can
  95. * be equal when the value is set or sublist or range. This method specifies
  96. * both the relation operator and also specifies whether the accompaning
  97. * parameter value is single value or set of values or sublist of values or
  98. * range of value. If the relation specifies set or range or sublist, it
  99. * automatically assumes the relation to be "MEGACO_EQUAL".
  100. *
  101. * @param paramRelation
  102. * paramRelation - The integer corresponding to the value
  103. * relation. The values shall be defined in ParamRelation.
  104. */
  105. public final void setItemsValueRelation(ParamRelation paramRelation) {
  106. this.paramRelation = paramRelation;
  107. }
  108. public java.lang.String toString() {
  109. return super.toString() + " : Value = " + getValueAsString() + "]";
  110. }
  111. }