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