PageRenderTime 14ms CodeModel.GetById 4ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 1ms

/protocols/jain-megaco/megaco-api/src/main/java/javax/megaco/message/descriptor/MediaStreamParam.java

http://mobicents.googlecode.com/
Java | 132 lines | 37 code | 22 blank | 73 comment | 6 complexity | 349a460834c7c26a5bdf83601ccd829c MD5 | raw file
  1package javax.megaco.message.descriptor;
  2
  3import java.io.Serializable;
  4
  5
  6
  7/**
  8 * The MediaStreamParam object is a class that shall be used to set the local
  9 * descriptor, local control descriptor and the remote descriptor. This is an
 10 * independent class derived from java.util.Object and shall not have any
 11 * derived classes.
 12 */
 13public class MediaStreamParam implements Serializable {
 14
 15	private LocalCtrlDescriptor localCtrlDescriptor;
 16	private SDPInfo localDescriptor;
 17	private SDPInfo remoteDescriptor;
 18
 19	/**
 20	 * Constructs a Stream Parameter Object consisting of local, remote and
 21	 * local control descriptor.
 22	 */
 23	public MediaStreamParam() {
 24		super();
 25		// TODO Auto-generated constructor stub
 26	}
 27
 28	/**
 29	 * The method can be used to get the local control descriptor.
 30	 * 
 31	 * @return localControlDesc - The reference to the object corresponding to
 32	 *         the local control descriptor. This shall be returned only if the
 33	 *         local control descriptor is present in the media stream parameter
 34	 *         of the media descriptor else shall return a NULL value.
 35	 */
 36	public LocalCtrlDescriptor getLclCtrlDescriptor() {
 37		return this.localCtrlDescriptor;
 38	}
 39
 40	/**
 41	 * The method can be used to get the SDP information for local descriptor.
 42	 * 
 43	 * @return SDPinfo - The reference to the object corresponding to SDPInfo.
 44	 *         This shall be returned only if the SDP information is present in
 45	 *         the local descriptor of the media descriptor.
 46	 */
 47	public SDPInfo getLocalDescriptor() {
 48		return this.localDescriptor;
 49	}
 50
 51	/**
 52	 * The method can be used to get the SDP information for remote descriptor.
 53	 * 
 54	 * @return SDPInfo - The reference to the object corresponding to SDPInfo.
 55	 *         This shall be returned only if the SDP information is present in
 56	 *         the remote descriptor of the media descriptor.
 57	 */
 58	public SDPInfo getRemoteDescriptor() {
 59		return this.remoteDescriptor;
 60	}
 61
 62	/**
 63	 * The method can be used to set the local control descriptor within the
 64	 * media descriptor.
 65	 * 
 66	 * @param localControlDesc
 67	 *            - The reference to the object corresponding to the local
 68	 *            control descriptor.
 69	 * @throws IllegalArgumentException
 70	 *             - Thrown if local control descriptor has incompatible
 71	 *             parameters.
 72	 */
 73	public void setLclCtrlDescriptor(LocalCtrlDescriptor localControlDesc) throws IllegalArgumentException {
 74
 75		// FIXME this is not present
 76		if (localControlDesc == null) {
 77			throw new IllegalArgumentException("LocalCtrlDescriptor must not be null");
 78		}
 79
 80		// FIXME: add error checks
 81
 82		this.localCtrlDescriptor = localControlDesc;
 83	}
 84
 85	/**
 86	 * The method can be used to set the local descriptor within the media
 87	 * descriptor.
 88	 * 
 89	 * @param sdp
 90	 *            - The reference to the object corresponding to the SDPInfo for
 91	 *            setting the local descriptor.
 92	 * @throws IllegalArgumentException
 93	 *             - Thrown if sdp information has incompatible parameters.
 94	 */
 95	public void setLocalDescriptor(SDPInfo sdp) throws IllegalArgumentException {
 96		// FIXME this is not present
 97		if (sdp == null) {
 98			throw new IllegalArgumentException("SDPInfo must not be null");
 99		}
100
101		// FIXME: add error checks
102
103		this.localDescriptor = sdp;
104
105	}
106
107	/**
108	 * The method can be used to set the remote descriptor within the media
109	 * descriptor.
110	 * 
111	 * @param sdp
112	 *            - The reference to the object corresponding to the SDPInfo for
113	 *            setting the remote descriptor.
114	 * @throws IllegalArgumentException
115	 *             - Thrown if sdp information has incompatible parameters.
116	 */
117	public void setRemoteDescriptor(SDPInfo sdp) throws IllegalArgumentException {
118		// FIXME this is not present
119		if (sdp == null) {
120			throw new IllegalArgumentException("SDPInfo must not be null");
121		}
122
123		// FIXME: add error checks
124
125		this.remoteDescriptor = sdp;
126	}
127
128	// public String toString()
129	// return super.toString();
130	// }
131
132}