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

http://mobicents.googlecode.com/ · Java · 104 lines · 26 code · 11 blank · 67 comment · 2 complexity · 1a5a8f06330bb1933db384210e884529 MD5 · raw file

  1. package javax.megaco.pkg;
  2. import javax.megaco.ExceptionInfoCode;
  3. /**
  4. * The MEGACO package item parameter class is an abstract and shall be used for
  5. * setting the parameter name and value attached to an event or a signal. The
  6. * derived class for this would specify the hard coded value for their identity,
  7. * name, type and other parameters, but the value for the parameter would be set
  8. * within this base class.
  9. *
  10. *
  11. */
  12. public abstract class PkgItemParam extends PkgValueItem implements java.io.Serializable {
  13. // FIXME: jsr jdoc does not extend
  14. private ParamRelation paramRelation;
  15. protected int paramId = -1;
  16. protected int[] paramsDescriptorIds = null;
  17. protected int[] paramsItemIds = null;
  18. /**
  19. * Constructs a Jain MEGACO package item parameter Object. This is an
  20. * abstract class and can be called only by the derived classes.
  21. */
  22. public PkgItemParam() {
  23. }
  24. /**
  25. * The method can be used to get the parameter identifier as defined in the
  26. * MEGACO packages. A hardcoded value is returned by the derived class.
  27. *
  28. * @return paramId - The integer corresponding to the parameter id.
  29. */
  30. public abstract int getParamId();
  31. /**
  32. * The method can be used to get the type of the parameter as defined in the
  33. * MEGACO packages. These could be one of string or enumerated value or
  34. * integer or double value or boolean.
  35. *
  36. * @return paramType - The integer corresponding to the parameter type. The
  37. * values shall be defined in ParamValueType.
  38. */
  39. public abstract int getParamValueType();
  40. /**
  41. * The method can be used to get the relation set in the parameter for the
  42. * parameter value as defined in the MEGACO packages. The relation operator
  43. * can be one of equal, not equal, greater than or less than operator for
  44. * single value. The MEGACO parameter is accompanied by a parameter value
  45. * that can be single value or set of values or sublist of values or range
  46. * of values. The relation operator can be equal when the value is set or
  47. * sublist or range. This method specifies both the relation operator and
  48. * also specifies whether the accompaning parameter value is single value or
  49. * set of values or sublist of values or range of value. If the relation
  50. * specifies set or range or sublist, it automatically assumes the relation
  51. * to be "MEGACO_EQUAL".
  52. *
  53. * @return paramRelation - The integer corresponding to the parameter
  54. * relation. The values shall be defined in ParamRelation.
  55. */
  56. public final ParamRelation getParamsValueRelation() {
  57. return this.paramRelation;
  58. }
  59. /**
  60. * The method can be used to set the relation of the value as defined in the
  61. * MEGACO packages. The relation operator can be one of equal, not equal,
  62. * greater than or less than operator for single value. The MEGACO parameter
  63. * is accompanied by a parameter value that can be single value or set of
  64. * values or sublist of values or range of values. The relation operator can
  65. * be equal when the value is set or sublist or range. This method specifies
  66. * both the relation operator and also specifies whether the accompaning
  67. * parameter value is single value or set of values or sublist of values or
  68. * range of value. If the relation specifies set or range or sublist, it
  69. * automatically assumes the relation to be "MEGACO_EQUAL". The default
  70. * value of the relation can be set in constructor of each class that
  71. * derives this class.
  72. *
  73. * @param paramRelation
  74. * - The integer corresponding to the value relation. The values
  75. * shall be defined in ParamRelation.
  76. * @throws IllegalArgumentException
  77. * This exception is raised if the reference of Param Relation
  78. * passed to this method is NULL.
  79. */
  80. public final void setParamsValueRelation(ParamRelation paramRelation) throws IllegalArgumentException {
  81. if (paramRelation == null) {
  82. IllegalArgumentException invalidArgumentException = new IllegalArgumentException("ParamRelation cannot be null from PkgItemParam");
  83. // invalidArgumentException.setInfoCode(ExceptionInfoCode.INV_PARAM_RELATION);
  84. throw invalidArgumentException;
  85. }
  86. this.paramRelation = paramRelation;
  87. }
  88. @Override
  89. public java.lang.String toString() {
  90. // TODO
  91. return this.toString();
  92. }
  93. }