|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sourceforge.jsdp.SDPFactory
public class SDPFactory
The SDPFactory enables to encode and decode SDP messages.
Field Summary | |
---|---|
static String |
DEFAULT_CHARSET
The default charset used for session description encoding: UTF-8 |
Constructor Summary | |
---|---|
SDPFactory()
|
Method Summary | |
---|---|
static Attribute |
createAttribute(String name)
Returns a new Attribute |
static Attribute |
createAttribute(String name,
String value)
Returns a new Attribute |
static Bandwith |
createBandwith(String modifier,
int value)
Returns a new Bandwith. |
static Connection |
createConnection(String resource)
Returns a new Connection. |
static Email |
createEmail(String info)
Returns a new Email. |
static Information |
createInformation(String value)
Returns a new Information. |
static Key |
createKey(String method,
String key)
Returns a new Key. |
static Media |
createMedia(String media,
int port,
int portsCount,
String protocol,
String format)
Returns a new Media. |
static Media |
createMedia(String media,
int port,
String protocol,
String format)
Returns a new Media. |
static Origin |
createOrigin()
Returnss a new Origin. |
static Origin |
createOrigin(long sessionVersion,
String address)
Returns a new Origin. |
static Origin |
createOrigin(String address)
Returns a new Origin. |
static Origin |
createOrigin(String user,
long sessionID,
long sessionVersion,
String address)
Returns a new Origin. |
static Origin |
createOrigin(String user,
long sessionVersion,
String address)
Returns a new Origin. |
static Phone |
createPhone(String number)
Returns a new Phone. |
static RepeatTime |
createRepeatTime(long repeatInterval,
long activeDuration,
long offset)
Returns a new RepeatTime. |
static RepeatTime |
createRepeatTime(long repeatInterval,
long activeDuration,
long[] offsets)
Returns a new RepeatTime. |
static SessionDescription |
createSessionDescription()
Returns a new, empty, SessionDescrition. |
static SessionName |
createSessionName()
Returns a new SessionName. |
static SessionName |
createSessionName(String value)
Returns a new SessionName. |
static Time |
createTime()
Returns a new Time. |
static Time |
createTime(Date start,
Date stop)
Returns a new Time. |
static Time |
createTime(long start,
long stop)
Returns a new Time. |
static TimeZone |
createTimeZone(Date time,
long offset)
Returns a new TimeZone. |
static Uri |
createUri(String url)
Returns a new Uri. |
static Uri |
createUri(URL url)
Creates a new Uri. |
static Version |
createVersion()
Returns a Version. |
static void |
encode(SessionDescription sd,
OutputStream stream)
Write a SessionDescription to an output stream, using the default enconding. |
static void |
encode(SessionDescription sd,
String encoding,
OutputStream stream)
Write a SessionDescription to an output stream, using a specified encoding. |
static SessionDescription |
parseSessionDescription(File file)
Reads data from a file and constructs the equivalent SessionDescription. |
static SessionDescription |
parseSessionDescription(InputStream stream)
Reads data from a stream and constructs the equivalent SessionDescription. |
static SessionDescription |
parseSessionDescription(String input)
Parse an input string and constructs the equivalent SessionDescription. |
static SessionDescription |
parseSessionDescription(String[] fields)
Parse the strings contained in an array and constructs the equivalent SessionDescription. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String DEFAULT_CHARSET
Constructor Detail |
---|
public SDPFactory()
Method Detail |
---|
public static Attribute createAttribute(String name) throws SDPException
name
- the attribute name
SDPException
- if the name specified is not validpublic static Attribute createAttribute(String name, String value) throws SDPException
name
- the attribute namevalue
- the attribute value
SDPException
- if the name or the value specified are not validpublic static Bandwith createBandwith(String modifier, int value) throws SDPException
modifier
- the bandwith modifiervalue
- the bandwith value in kbits/second
SDPException
- if the modifier is unknown, or the value is negativepublic static Connection createConnection(String resource) throws SDPException
resource
- the network address on which media can be received. The
address type associated with this connection depends by address
value
SDPException
- if the network address is not validpublic static Email createEmail(String info) throws SDPException
info
- the contact information
SDPException
- if the contact information are not validpublic static Information createInformation(String value) throws SDPException
value
- the information about the session
SDPException
- if the characters of the information are not allowedpublic static Key createKey(String method, String key) throws SDPException
method
- the encryption methodkey
- the encryption key
SDPException
- if the encryption method is not allowed, or the
encryption key is not valid for the specified methodpublic static Media createMedia(String media, int port, int portsCount, String protocol, String format) throws SDPException
media
- the media typeport
- the transport port to which the media stream will be sentportsCount
- the number of transport ports where the media stream
will be sentprotocol
- the transport protocolformat
- the media default format
SDPException
- if the parameters are not validpublic static Media createMedia(String media, int port, String protocol, String format) throws SDPException
media
- the media typeport
- the transport port to which the media stream will be sentprotocol
- the transport protocolformat
- the media default format
SDPException
- if the parameters are not validpublic static Origin createOrigin() throws SDPException
o=<user> <current time as NTP> <current time as NTP> <localhost name>
SDPException
- if no IP address for the local host could be found,
or the current user name contains characters that are not allowedpublic static Origin createOrigin(long sessionVersion, String address) throws SDPException
sessionVersion
- the session versionaddress
- the session originator host address
SDPException
- if one or more parameter provided are not validpublic static Origin createOrigin(String address) throws SDPException
address
- the session originator host address
SDPException
- if the address is not validpublic static Origin createOrigin(String user, long sessionID, long sessionVersion, String address) throws SDPException
user
- the name of the session originatorsessionID
- the session identifiersessionVersion
- the session versionaddress
- the session originator host address
SDPException
- if one or more parameter provided are not validpublic static Origin createOrigin(String user, long sessionVersion, String address) throws SDPException
user
- the name of the session originatorsessionVersion
- the session versionaddress
- the session originator host address
SDPException
- if one or more parameter provided are not validpublic static Phone createPhone(String number) throws SDPException
number
- the phone number
SDPException
- if the phone number is not validpublic static RepeatTime createRepeatTime(long repeatInterval, long activeDuration, long offset) throws SDPException
repeatInterval
- the repeat intervalactiveDuration
- the active durationoffset
- the offset
SDPException
- if the parameters are not validpublic static RepeatTime createRepeatTime(long repeatInterval, long activeDuration, long[] offsets) throws SDPException
repeatInterval
- the repeat intervalactiveDuration
- the active durationoffsets
- the offsets
SDPException
- if the parameters are not validpublic static SessionDescription createSessionDescription() throws SDPException
v=0
o=<user> <current time as NTP> <current time as NTP> <localhost name>
s=-
t=0 0
SDPException
- if there is a problem while constructing the
SessionDescriptionpublic static SessionName createSessionName()
public static SessionName createSessionName(String value) throws SDPException
value
- the name of the session
SDPException
- if the characters of the session name are not
allowedpublic static Time createTime()
public static Time createTime(Date start, Date stop) throws SDPException
start
- the session start timestop
- the session stop time
SDPException
- if the NTP representation of the session start
and/or stop time are negativepublic static Time createTime(long start, long stop) throws SDPException
start
- the session start timestop
- the session stop time
SDPException
- if the session start or stop time are negativepublic static TimeZone createTimeZone(Date time, long offset) throws SDPException
time
- the adjustment timeoffset
- the offset
SDPException
- if the NTP representation of the adjustment time is
negativepublic static Uri createUri(String url) throws SDPException
url
- the uri value
SDPException
- if the value specified is a not valid uripublic static Uri createUri(URL url)
url
- the resource url
public static Version createVersion()
public static void encode(SessionDescription sd, OutputStream stream) throws IOException
sd
- the session description to writestream
- the stream where write to
IOException
- if an I/O error occurspublic static void encode(SessionDescription sd, String encoding, OutputStream stream) throws IOException
sd
- the session description to writeencoding
- the charset encoding to usestream
- the stream where write to
IOException
- if an I/O error occurspublic static SessionDescription parseSessionDescription(File file) throws SDPParseException, IOException
file
- the source file
SDPParseException
- if an error occurs while parsing
IOException
- if an I/O error occurspublic static SessionDescription parseSessionDescription(InputStream stream) throws SDPParseException, IOException
stream
- the input stream
SDPParseException
- if an error occurs while parsing
IOException
- if an I/O error occurspublic static SessionDescription parseSessionDescription(String input) throws SDPParseException
input
- the string to parse
SDPParseException
- if an error occurs while parsingpublic static SessionDescription parseSessionDescription(String[] fields) throws SDPParseException
fields
- the string array that stores the SDP fields
SDPParseException
- if an error occurs while parsing
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |