| java.lang.Object javax.sdp.SdpFactory
SdpFactory | public class SdpFactory extends Object (Code) | | The SdpFactory enables applications to encode and decode SDP messages.
The SdpFactory can be used to construct a SessionDescription
object programmatically.
The SdpFactory can also be used to construct a
SessionDescription based on the
contents of a String. Acknowledgement:
Bugs reported by Brian J. Collins .
and by Majdi Abuelbassal .
Please refer to IETF RFC 2327 for a description of SDP.
author: Olivier Deruelle author: M. Ranganathan version: 1.0 |
Method Summary | |
public Attribute | createAttribute(String name, String value) Returns Attribute object with the specified values. | public BandWidth | createBandwidth(String modifier, int value) Returns Bandwidth object with the specified values. | public Connection | createConnection(String netType, String addrType, String addr, int ttl, int numAddrs) | public Connection | createConnection(String netType, String addrType, String addr) Returns a Connection object with the specified properties and no
TTL and a default number of addresses (1). | public Connection | createConnection(String addr, int ttl, int numAddrs) Returns a Connection object with the specified properties and a
network and address type of "IN" and "IP4" respectively. | public Connection | createConnection(String addr) Returns a Connection object with the specified address. | public EMail | createEMail(String value) Returns EMail object with the specified value.
Parameters: value - the string containing the description. | public Info | createInfo(String value) Returns Info object with the specified value.
Parameters: value - the string containing the description. | public Key | createKey(String method, String key) Returns Key object with the specified value. | public Media | createMedia(String media, int port, int numPorts, String transport, Vector staticRtpAvpTypes) Returns Media object with the specified properties. | public MediaDescription | createMediaDescription(String media, int port, int numPorts, String transport, int[] staticRtpAvpTypes) Returns MediaDescription object with the specified properties. | public MediaDescription | createMediaDescription(String media, int port, int numPorts, String transport, String[] formats) Returns MediaDescription object with the specified properties. | public Origin | createOrigin(String userName, String address) Returns Origin object with the specified properties. | public Origin | createOrigin(String userName, long sessionId, long sessionVersion, String networkType, String addrType, String address) Returns Origin object with the specified properties. | public Phone | createPhone(String value) Returns Phone object with the specified value.
Parameters: value - the string containing the description. | public RepeatTime | createRepeatTime(int repeatInterval, int activeDuration, int[] offsets) Returns a RepeatTime object with the specified interval,
duration, and time offsets. | public SessionDescription | createSessionDescription() Creates a new, empty SessionDescription. | public SessionDescription | createSessionDescription(SessionDescription otherSessionDescription) Creates a new SessionDescription, deep copy of another SessionDescription.
Parameters: otherSessionDescription - - the SessionDescription to copy from. | public SessionDescription | createSessionDescription(String s) Creates a SessionDescription populated with the information
contained within the string parameter.
Note: unknown field types should not cause exceptions.
Parameters: s - s - the sdp message that is to be parsed. throws: SdpParseException - SdpParseException - if there is a problem parsing theString. | public SessionName | createSessionName(String name) Returns SessionName object with the specified name.
Parameters: name - the string containing the name of the session. | public Time | createTime(Date start, Date stop) Returns a Time specification with the specified start and stop
times. | public Time | createTime() Returns an unbounded Time specification (i.e., "t=0 0"). | public TimeDescription | createTimeDescription(Time t) Returns TimeDescription object with the specified properties.
Parameters: t - the Time that the time description applies to. | public TimeDescription | createTimeDescription() Returns TimeDescription unbounded (i.e. | public TimeDescription | createTimeDescription(Date start, Date stop) Returns TimeDescription object with the specified properties. | public TimeZoneAdjustment | createTimeZoneAdjustment(Date d, int offset) Constructs a timezone adjustment record.
Parameters: d - the Date at which the adjustment is going to takeplace. Parameters: offset - the adjustment in number of seconds relative tothe start time of the SessionDescription with which thisobject is associated. | public javax.sdp.URI | createURI(URL value) Returns URI object with the specified value. | public Version | createVersion(int value) Returns Version object with the specified values.
Parameters: value - the version number. | public String | formatMulticastAddress(String addr, int ttl, int numAddrs) Returns a String containing the computed form for a
multi-connection address. | public static Date | getDateFromNtp(long ntpTime) | public static SdpFactory | getInstance() Obtain an instance of an SdpFactory. | public static long | getNtpTime(Date d) Returns a long containing the NTP value for a given Java Date. |
createAttribute | public Attribute createAttribute(String name, String value)(Code) | | Returns Attribute object with the specified values.
Parameters: name - the namee of the attribute Parameters: value - the value of the attribute Attribute |
createBandwidth | public BandWidth createBandwidth(String modifier, int value)(Code) | | Returns Bandwidth object with the specified values.
Parameters: modifier - modifier - the bandwidth type Parameters: value - the bandwidth value measured in kilobits per second bandwidth |
createConnection | public Connection createConnection(String netType, String addrType, String addr, int ttl, int numAddrs) throws SdpException(Code) | | Returns a Connection object with the specified properties a
Parameters: netType - network type, eg "IN" for "Internet" Parameters: addrType - address type, eg "IP4" for IPv4 type addresses Parameters: addr - connection address Parameters: ttl - time to live (TTL) for multicast addresses Parameters: numAddrs - number of addresses used by the connection Connection |
createConnection | public Connection createConnection(String netType, String addrType, String addr) throws SdpException(Code) | | Returns a Connection object with the specified properties and no
TTL and a default number of addresses (1).
Parameters: netType - network type, eg "IN" for "Internet" Parameters: addrType - address type, eg "IP4" for IPv4 type addresses Parameters: addr - connection address throws: SdpException - if the parameters are null Connection |
createConnection | public Connection createConnection(String addr, int ttl, int numAddrs) throws SdpException(Code) | | Returns a Connection object with the specified properties and a
network and address type of "IN" and "IP4" respectively.
Parameters: addr - connection address Parameters: ttl - time to live (TTL) for multicast addresses Parameters: numAddrs - number of addresses used by the connection Connection |
createConnection | public Connection createConnection(String addr) throws SdpException(Code) | | Returns a Connection object with the specified address. This is
equivalent to
createConnection("IN", "IP4", addr);
Parameters: addr - connection address throws: SdpException - if the parameter is null Connection |
createEMail | public EMail createEMail(String value)(Code) | | Returns EMail object with the specified value.
Parameters: value - the string containing the description. EMail |
createInfo | public Info createInfo(String value)(Code) | | Returns Info object with the specified value.
Parameters: value - the string containing the description. Info |
createKey | public Key createKey(String method, String key)(Code) | | Returns Key object with the specified value.
Parameters: method - the string containing the method type. Parameters: key - the key to set Key |
createMedia | public Media createMedia(String media, int port, int numPorts, String transport, Vector staticRtpAvpTypes) throws SdpException(Code) | | Returns Media object with the specified properties.
Parameters: media - the media type, eg "audio" Parameters: port - port number on which to receive media Parameters: numPorts - number of ports used for this media stream Parameters: transport - transport type, eg "RTP/AVP" Parameters: staticRtpAvpTypes - vector to set throws: SdpException - Media |
createMediaDescription | public MediaDescription createMediaDescription(String media, int port, int numPorts, String transport, int[] staticRtpAvpTypes) throws IllegalArgumentException, SdpException(Code) | | Returns MediaDescription object with the specified properties.
The returned object will respond to
Media.getMediaFormats(boolean) with a Vector of media formats.
Parameters: media - media - Parameters: port - port number on which to receive media Parameters: numPorts - number of ports used for this media stream Parameters: transport - transport type, eg "RTP/AVP" Parameters: staticRtpAvpTypes - list of static RTP/AVP media payloadtypes which should be specified by the returned MediaDescriptionthrows IllegalArgumentException if passedan invalid RTP/AVP payload type throws: IllegalArgumentException - throws: SdpException - MediaDescription |
createMediaDescription | public MediaDescription createMediaDescription(String media, int port, int numPorts, String transport, String[] formats)(Code) | | Returns MediaDescription object with the specified properties.
The returned object will respond to
Media.getMediaFormats(boolean) with a Vector of String objects
specified by the 'formats argument.
Parameters: media - the media type, eg "audio" Parameters: port - port number on which to receive media Parameters: numPorts - number of ports used for this media stream Parameters: transport - transport type, eg "RTP/AVP" Parameters: formats - list of formats which should be specified by thereturned MediaDescription MediaDescription |
createOrigin | public Origin createOrigin(String userName, String address) throws SdpException(Code) | | Returns Origin object with the specified properties.
Parameters: userName - the user name. Parameters: address - the IP4 encoded address. throws: SdpException - if the parameters are null Origin |
createOrigin | public Origin createOrigin(String userName, long sessionId, long sessionVersion, String networkType, String addrType, String address) throws SdpException(Code) | | Returns Origin object with the specified properties.
Parameters: userName - String containing the user that created thestring. Parameters: sessionId - long containing the session identifier. Parameters: sessionVersion - long containing the session version. Parameters: networkType - String network type for the origin (usually"IN"). Parameters: addrType - String address type (usually "IP4"). Parameters: address - String IP address usually the address of thehost. throws: SdpException - if the parameters are null Origin object with the specified properties. |
createPhone | public Phone createPhone(String value)(Code) | | Returns Phone object with the specified value.
Parameters: value - the string containing the description. Phone |
createRepeatTime | public RepeatTime createRepeatTime(int repeatInterval, int activeDuration, int[] offsets)(Code) | | Returns a RepeatTime object with the specified interval,
duration, and time offsets.
Parameters: repeatInterval - the "repeat interval" in seconds Parameters: activeDuration - the "active duration" in seconds Parameters: offsets - the list of offsets relative to the start time ofthe Time object with which the returned RepeatTime will beassociated RepeatTime |
createSessionDescription | public SessionDescription createSessionDescription() throws SdpException(Code) | | Creates a new, empty SessionDescription. The session is set as follows:
v=0
o=this.createOrigin ("user",
InetAddress.getLocalHost().toString());
s=-
t=0 0
throws: SdpException - SdpException, - if there is a problem constructing theSessionDescription. a new, empty SessionDescription. |
createSessionDescription | public SessionDescription createSessionDescription(SessionDescription otherSessionDescription) throws SdpException(Code) | | Creates a new SessionDescription, deep copy of another SessionDescription.
Parameters: otherSessionDescription - - the SessionDescription to copy from. a new SessionDescription, exact and deep copy of the otherSessionDescription. throws: SdpException - - if there is a problem constructing the SessionDescription. |
createSessionDescription | public SessionDescription createSessionDescription(String s) throws SdpParseException(Code) | | Creates a SessionDescription populated with the information
contained within the string parameter.
Note: unknown field types should not cause exceptions.
Parameters: s - s - the sdp message that is to be parsed. throws: SdpParseException - SdpParseException - if there is a problem parsing theString. a populated SessionDescription object. |
createSessionName | public SessionName createSessionName(String name)(Code) | | Returns SessionName object with the specified name.
Parameters: name - the string containing the name of the session. SessionName |
createTime | public Time createTime(Date start, Date stop) throws SdpException(Code) | | Returns a Time specification with the specified start and stop
times.
Parameters: start - start time Parameters: stop - stop time throws: SdpException - if the parameters are null a Time specification with the specified start and stoptimes. |
createTime | public Time createTime() throws SdpException(Code) | | Returns an unbounded Time specification (i.e., "t=0 0").
throws: SdpException - an unbounded Time specification (i.e., "t=0 0"). |
createTimeDescription | public TimeDescription createTimeDescription(Time t) throws SdpException(Code) | | Returns TimeDescription object with the specified properties.
Parameters: t - the Time that the time description applies to. ReturnsTimeDescription object with the specified properties. throws: SdpException - TimeDescription |
createTimeDescription | public TimeDescription createTimeDescription(Date start, Date stop) throws SdpException(Code) | | Returns TimeDescription object with the specified properties.
Parameters: start - start time. Parameters: stop - stop time. throws: SdpException - if the parameters are null TimeDescription |
createTimeZoneAdjustment | public TimeZoneAdjustment createTimeZoneAdjustment(Date d, int offset)(Code) | | Constructs a timezone adjustment record.
Parameters: d - the Date at which the adjustment is going to takeplace. Parameters: offset - the adjustment in number of seconds relative tothe start time of the SessionDescription with which thisobject is associated. TimeZoneAdjustment |
createVersion | public Version createVersion(int value)(Code) | | Returns Version object with the specified values.
Parameters: value - the version number. Version |
formatMulticastAddress | public String formatMulticastAddress(String addr, int ttl, int numAddrs)(Code) | | Returns a String containing the computed form for a
multi-connection address.
Parameters:
addr - connection address
ttl - time to live (TTL) for multicast
addresses
numAddrs - number of addresses used by the
connection
Returns:
a String containing the computed form for a
multi-connection address.
|
getDateFromNtp | public static Date getDateFromNtp(long ntpTime)(Code) | | Parameters: ntpTime - long to set Returns a Date object for a given NTP date value. |
getInstance | public static SdpFactory getInstance()(Code) | | Obtain an instance of an SdpFactory.
This static method returns a factory instance.
Once an application has obtained a reference to an SdpFactory it can use
the factory to configure and obtain parser instances and to create SDP objects.
a factory instance |
getNtpTime | public static long getNtpTime(Date d) throws SdpParseException(Code) | | Returns a long containing the NTP value for a given Java Date.
Parameters: d - Date to set long |
|
|