| java.lang.Object gov.nist.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.
Please refer to IETF RFC 2327 for a description of SDP.
This code is in the public domain.
version: 1.0 |
Method Summary | |
public AttributeField | createAttribute(String name, String value) Returns Attribute object with the specified values. | public BandwidthField | createBandwidth(String modifier, int value) Returns Bandwidth object with the specified values. | public ConnectionField | createConnection(String netType, String addrType, String addr, int ttl, int numAddrs) | public ConnectionField | 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 ConnectionField | 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 ConnectionField | createConnection(String addr) Returns a Connection object with the specified address. | public EmailField | createEMail(String value) Returns EMail object with the specified value.
Parameters: value - the string containing the description. | public InformationField | createInfo(String value) Returns Info object with the specified value.
Parameters: value - the string containing the description. | public KeyField | createKey(String method, String key) Returns Key object with the specified value. | public MediaField | createMedia(String media, int port, int numPorts, String transport, Vector staticRtpAvpTypes) Returns Media object with the specified properties. | public MediaDescriptionImpl | createMediaDescription(String media, int port, int numPorts, String transport, int[] staticRtpAvpTypes) Returns MediaDescription object with the specified properties. | public MediaDescriptionImpl | createMediaDescription(String media, int port, int numPorts, String transport, String[] formats) Returns MediaDescription object with the specified properties. | public OriginField | createOrigin(String userName, String address) Returns Origin object with the specified properties. | public OriginField | createOrigin(String userName, long sessionId, long sessionVersion, String networkType, String addrType, String address) Returns Origin object with the specified properties. | public PhoneField | createPhone(String value) Returns Phone object with the specified value.
Parameters: value - the string containing the description. | public RepeatField | createRepeatTime(int repeatInterval, int activeDuration, int[] offsets) Returns a RepeatTime object with the specified interval,
duration, and time offsets. | public SessionDescriptionImpl | createSessionDescription() Creates a new, empty SessionDescription. | public SessionDescriptionImpl | 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 - if there is aproblem parsing the String. | public SessionNameField | createSessionName(String name) Returns SessionName object with the specified name.
Parameters: name - the string containing the name of the session. | public TimeField | createTime(Date start, Date stop) Returns a Time specification with the specified start and stop
times. | public TimeField | createTime() Returns an unbounded Time specification (i.e., "t=0 0"). | public TimeDescriptionImpl | createTimeDescription(TimeField t) Returns TimeDescription object with the specified properties.
Parameters: t - the Time that the time description applies to. | public TimeDescriptionImpl | createTimeDescription() Returns TimeDescription unbounded (i.e. | public TimeDescriptionImpl | createTimeDescription(Date start, Date stop) Returns TimeDescription object with the specified properties. | public ZoneField | 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 URIField | createURI(String value) Returns URI object with the specified value. | public ProtoVersionField | createVersion(int value) Returns Version object with the specified values.
Parameters: value - the version number. | public static Vector | findSessions(String source) Returns a collection of Strings containing session description.
Parameters: source - String containing session descriptions. | 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) Converts a NTP to regular date value. | public static SdpFactory | getInstance() Obtains an instance of an SdpFactory. | public static long | getNtpTime(Date d) Returns a long containing the NTP value for a given Java Date. |
sessionDescriptionsList | protected static Vector sessionDescriptionsList(Code) | | Session description.
|
SdpFactory | public SdpFactory()(Code) | | Creates new SdpFactory
|
createAttribute | public AttributeField createAttribute(String name, String value)(Code) | | Returns Attribute object with the specified values.
Parameters: name - the name of the attribute Parameters: value - the value of the attribute the Attribute |
createBandwidth | public BandwidthField createBandwidth(String modifier, int value)(Code) | | Returns Bandwidth object with the specified values.
Parameters: modifier - the bandwidth type Parameters: value - the bandwidth value measured in kilobits per second bandwidth |
createConnection | public ConnectionField 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 ConnectionField 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 ConnectionField 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 ConnectionField 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 EmailField createEMail(String value)(Code) | | Returns EMail object with the specified value.
Parameters: value - the string containing the description. EMail |
createInfo | public InformationField createInfo(String value)(Code) | | Returns Info object with the specified value.
Parameters: value - the string containing the description. Info |
createKey | public KeyField 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 MediaField 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 MediaDescriptionImpl 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 thereturned MediaDescription throws IllegalArgumentException if passedan invalid RTP/AVP payload type throws: IllegalArgumentException - throws: SdpException - MediaDescription |
createMediaDescription | public MediaDescriptionImpl 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 OriginField 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 OriginField 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 PhoneField createPhone(String value)(Code) | | Returns Phone object with the specified value.
Parameters: value - the string containing the description. Phone |
createRepeatTime | public RepeatField 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 SessionDescriptionImpl 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 - if there is a problemconstructing the SessionDescription. a new, empty SessionDescription. |
createSessionDescription | public SessionDescriptionImpl 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 - if there is aproblem parsing the String. a populated SessionDescription object. |
createSessionName | public SessionNameField createSessionName(String name)(Code) | | Returns SessionName object with the specified name.
Parameters: name - the string containing the name of the session. SessionName |
createTime | public TimeField 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. |
createTimeDescription | public TimeDescriptionImpl createTimeDescription(TimeField 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 TimeDescriptionImpl 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 ZoneField 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 ProtoVersionField createVersion(int value)(Code) | | Returns Version object with the specified values.
Parameters: value - the version number. Version |
findSessions | public static Vector findSessions(String source)(Code) | | Returns a collection of Strings containing session description.
Parameters: source - String containing session descriptions. a collection of Strings containing session descriptions. |
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 Parameters: ttl - time to live (TTL) for multicastaddresses Parameters: numAddrs - number of addresses used by theconnection computed form for a multi-connection address. |
getDateFromNtp | public static Date getDateFromNtp(long ntpTime)(Code) | | Converts a NTP to regular date value.
Parameters: ntpTime - long to set Returns a Date object for a given NTP date value. |
getInstance | public static SdpFactory getInstance() throws SdpException(Code) | | Obtains 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.
throws: SdpException - if a factory can not be accessed 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 |
|
|