PageRenderTime 114ms CodeModel.GetById 95ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

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