PageRenderTime 41ms CodeModel.GetById 28ms app.highlight 8ms RepoModel.GetById 1ms app.codeStats 1ms

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

http://mobicents.googlecode.com/
Java | 111 lines | 31 code | 17 blank | 63 comment | 4 complexity | 1cf829b86d014259454b783d72829054 MD5 | raw file
  1package javax.megaco.message.descriptor;
  2
  3import java.io.Serializable; //FIXME: this requires JSIP
  4
  5import javax.sdp.SessionDescription;
  6
  7/**
  8 * The SDPInfo object is a class that shall be used to set the Media
  9 * description, Session Description and Time description of the SDP. These would
 10 * be defined in javax.sdp package. This is an independent class derived from
 11 * java.util.Object and shall not have any derived classes.
 12 */
 13public class SDPInfo implements Serializable {
 14
 15	private SessionDescription sessionDescription = null;
 16	private String sessionDescStr = null;
 17
 18	/**
 19	 * Constructs an object of type megaco SDP info which shall be used within
 20	 * the media descriptor to set the local and remote descriptor.
 21	 */
 22	public SDPInfo() {
 23	}
 24
 25	/**
 26	 * The method is used to get the session description of the SDP which would
 27	 * be set in local or remote descriptor. In an SDP this information
 28	 * necessarily needs to be set.
 29	 * 
 30	 * @return session - The reference to the object corresponding to the
 31	 *         session description. If the session description is not set then
 32	 *         it shall return a null value.
 33	 */
 34	public SessionDescription getSessionDescription() {
 35		return this.sessionDescription;
 36	}
 37
 38	/**
 39	 * The method can be used to set the session description within an SDP for
 40	 * local/remote descriptor.
 41	 * 
 42	 * @param session
 43	 *            - The reference to the object corresponding to the session
 44	 *            description.
 45	 * @throws IllegalArgumentException
 46	 *             - Thrown if parameters set in the session description are
 47	 *             such that the object cannot be set for the local/remote
 48	 *             descriptor.
 49	 * @throws javax.megaco.ParamNotSupportedException
 50	 *             - Thrown if parameters set in the session description are
 51	 *             such that they are not supported.
 52	 */
 53	public void setSessionDescription(SessionDescription session) throws IllegalArgumentException, javax.megaco.ParamNotSupportedException {
 54
 55		// FIXME: add checks
 56		if (session == null) {
 57			throw new IllegalArgumentException("SessionDescription must not be null.");
 58		}
 59
 60		this.sessionDescription = session;
 61
 62	}
 63
 64	/**
 65	 * The method is used to get the session description of the SDP which would
 66	 * be set in local or remote descriptor. The SDP info returned is in the
 67	 * string format. The applications may use this method if it is not
 68	 * concerned with the parameters contained in the SDP info. The SDP string
 69	 * obtained may be processed later or may be tunnelled to the other layer
 70	 * for processing.
 71	 * 
 72	 * @return session - The reference to the object corresponding to the
 73	 *         session description string. If the session description string is
 74	 *         not set then it shall return a null value.
 75	 */
 76	public java.lang.String getSessionDescStr() {
 77		return this.sessionDescStr;
 78	}
 79
 80	/**
 81	 * The method can be used to set the session description string within an
 82	 * SDP for local/remote descriptor. The applications may use this method in
 83	 * case it has pre-encoded SDP string with itself. The pre-encoded SDP
 84	 * string may be obtained either at the time of configuration of the
 85	 * application or may be obtained in the commands exchanged for the call.
 86	 * The SDP info string as set in this method must be in the format as
 87	 * defined by the RFC 2327 for IN SDP and RFC 3018 for ATM SDP.
 88	 * 
 89	 * @param session
 90	 *            - The reference to the object corresponding to the session
 91	 *            description string.
 92	 * @throws IllegalArgumentException
 93	 *             This exception is raised if the reference of session
 94	 *             description string passed to this method is NULL.
 95	 */
 96	public void setSessionDescStr(java.lang.String session)
 97
 98	throws IllegalArgumentException {
 99
100		if (session == null) {
101			throw new IllegalArgumentException("SessionDescription must not be null.");
102		}
103		this.sessionDescStr = session;
104
105	}
106
107	public java.lang.String toString() {
108		return super.toString();
109	}
110
111}