Methods Summary |
---|
public AttributeField | createAttribute(java.lang.String name, java.lang.String value)Returns Attribute object with the specified values.
AttributeField attributeImpl = new AttributeField();
try {
attributeImpl.setName(name);
attributeImpl.setValue(value);
}
catch (SdpException s) {
s.printStackTrace();
}
return attributeImpl;
|
public BandwidthField | createBandwidth(java.lang.String modifier, int value)Returns Bandwidth object with the specified values.
BandwidthField bandWidthImpl = new BandwidthField();
try {
bandWidthImpl.setType(modifier);
bandWidthImpl.setValue(value);
}
catch (SdpException s) {
s.printStackTrace();
}
return bandWidthImpl;
|
public ConnectionField | createConnection(java.lang.String netType, java.lang.String addrType, java.lang.String addr, int ttl, int numAddrs)Returns a Connection object with the specified properties a
ConnectionField connectionImpl = new ConnectionField();
connectionImpl.setNetworkType(netType);
connectionImpl.setAddressType(addrType);
connectionImpl.setAddress(addr);
return connectionImpl;
|
public ConnectionField | createConnection(java.lang.String netType, java.lang.String addrType, java.lang.String addr)Returns a Connection object with the specified properties and no
TTL and a default number of addresses (1).
ConnectionField connectionImpl = new ConnectionField();
connectionImpl.setNetworkType(netType);
connectionImpl.setAddressType(addrType);
connectionImpl.setAddress(addr);
return connectionImpl;
|
public ConnectionField | createConnection(java.lang.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.
ConnectionField connectionImpl = new ConnectionField();
connectionImpl.setAddress(addr);
return connectionImpl;
|
public ConnectionField | createConnection(java.lang.String addr)Returns a Connection object with the specified address. This is
equivalent to
createConnection("IN", "IP4", addr);
return createConnection("IN", " IPV4", addr);
|
public EmailField | createEMail(java.lang.String value)Returns EMail object with the specified value.
EmailField emailImpl = new EmailField();
try {
emailImpl.setValue(value);
}
catch (SdpException s) {
s.printStackTrace();
}
return emailImpl;
|
public InformationField | createInfo(java.lang.String value)Returns Info object with the specified value.
InformationField infoImpl = new InformationField();
try {
infoImpl.setValue(value);
}
catch (SdpException s) {
s.printStackTrace();
}
return infoImpl;
|
public KeyField | createKey(java.lang.String method, java.lang.String key)Returns Key object with the specified value.
KeyField keyImpl = new KeyField();
try {
keyImpl.setMethod(method);
keyImpl.setKey(key);
}
catch (SdpException s) {
s.printStackTrace();
return null;
}
return keyImpl;
|
public MediaField | createMedia(java.lang.String media, int port, int numPorts, java.lang.String transport, java.util.Vector staticRtpAvpTypes)Returns Media object with the specified properties.
MediaField mediaImpl = new MediaField();
mediaImpl.setMediaType(media);
mediaImpl.setMediaPort(port);
mediaImpl.setPortCount(numPorts);
mediaImpl.setProtocol(transport);
mediaImpl.setMediaFormats(staticRtpAvpTypes);
return mediaImpl;
|
public MediaDescriptionImpl | createMediaDescription(java.lang.String media, int port, int numPorts, java.lang.String transport, int[] staticRtpAvpTypes)Returns MediaDescription object with the specified properties.
The returned object will respond to
Media.getMediaFormats(boolean) with a Vector of media formats.
MediaDescriptionImpl
mediaDescriptionImpl = new MediaDescriptionImpl();
MediaField mediaImpl = new MediaField();
mediaImpl.setMediaType(media);
mediaImpl.setMediaPort(port);
mediaImpl.setPortCount(numPorts);
mediaImpl.setProtocol(transport);
mediaDescriptionImpl.setMedia(mediaImpl);
return mediaDescriptionImpl;
|
public MediaDescriptionImpl | createMediaDescription(java.lang.String media, int port, int numPorts, java.lang.String transport, java.lang.String[] formats)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.
MediaDescriptionImpl mediaDescriptionImpl = new MediaDescriptionImpl();
try {
MediaField mediaImpl = new MediaField();
mediaImpl.setMediaType(media);
mediaImpl.setMediaPort(port);
mediaImpl.setPortCount(numPorts);
mediaImpl.setProtocol(transport);
Vector formatsV = new Vector(formats.length);
for (int i = 0; i < formats.length; i++)
formatsV.addElement(formats[i]);
mediaImpl.setMediaFormats(formatsV);
mediaDescriptionImpl.setMedia(mediaImpl);
} catch (SdpException s) {
s.printStackTrace();
}
return mediaDescriptionImpl;
|
public OriginField | createOrigin(java.lang.String userName, java.lang.String address)Returns Origin object with the specified properties.
OriginField originImpl = new OriginField();
originImpl.setUsername(userName);
originImpl.setAddress(address);
// need revisit - originImpl.setNetworkType(SDPKeywords.IN);
originImpl.setAddressType(SDPKeywords.IPV4);
return originImpl;
|
public OriginField | createOrigin(java.lang.String userName, long sessionId, long sessionVersion, java.lang.String networkType, java.lang.String addrType, java.lang.String address)Returns Origin object with the specified properties.
OriginField originImpl = new OriginField();
originImpl.setUsername(userName);
originImpl.setAddress(address);
originImpl.setSessionId(sessionId);
originImpl.setSessionVersion(sessionVersion);
originImpl.setAddressType(addrType);
originImpl.setNetworkType(networkType);
return originImpl;
|
public PhoneField | createPhone(java.lang.String value)Returns Phone object with the specified value.
PhoneField phoneImpl = new PhoneField();
try {
phoneImpl.setValue(value);
}
catch (SdpException s) {
s.printStackTrace();
}
return phoneImpl;
|
public RepeatField | createRepeatTime(int repeatInterval, int activeDuration, int[] offsets)Returns a RepeatTime object with the specified interval,
duration, and time offsets.
RepeatField repeatTimeField = new RepeatField();
try {
repeatTimeField.setRepeatInterval(repeatInterval);
repeatTimeField.setActiveDuration(activeDuration);
repeatTimeField.setOffsetArray(offsets);
}
catch (SdpException s) {
s.printStackTrace();
}
return repeatTimeField;
|
public SessionDescriptionImpl | createSessionDescription()Creates a new, empty SessionDescription. The session is set as follows:
v=0
o=this.createOrigin ("user",
InetAddress.getLocalHost().toString());
s=-
t=0 0
SessionDescriptionImpl
sessionDescriptionImpl = new SessionDescriptionImpl();
ProtoVersionField ProtoVersionField = new ProtoVersionField();
ProtoVersionField.setVersion(0);
sessionDescriptionImpl.setVersion(ProtoVersionField);
OriginField originImpl = null;
originImpl = (OriginField)this.createOrigin("user",
"127.0.0.1");
sessionDescriptionImpl.setOrigin(originImpl);
SessionNameField sessionNameImpl = new SessionNameField();
sessionNameImpl.setValue("-");
sessionDescriptionImpl.setSessionName(sessionNameImpl);
TimeDescriptionImpl timeDescriptionImpl = new TimeDescriptionImpl();
TimeField timeImpl = new TimeField();
timeImpl.setZero();
timeDescriptionImpl.setTime(timeImpl);
Vector times = new Vector();
times.addElement(timeDescriptionImpl);
sessionDescriptionImpl.setTimeDescriptions(times);
sessionDescriptionsList.addElement(sessionDescriptionImpl);
return sessionDescriptionImpl;
|
public SessionDescriptionImpl | createSessionDescription(java.lang.String s)Creates a SessionDescription populated with the information
contained within the string parameter.
Note: unknown field types should not cause exceptions.
try {
SDPAnnounceParser sdpParser = new SDPAnnounceParser(s);
return sdpParser.parse();
} catch (ParseException e) {
e.printStackTrace();
throw new SdpParseException(0, 0, "Could not parse message");
}
|
public SessionNameField | createSessionName(java.lang.String name)Returns SessionName object with the specified name.
SessionNameField sessionNameImpl = new SessionNameField();
try {
sessionNameImpl.setValue(name);
}
catch (SdpException s) {
s.printStackTrace();
}
return sessionNameImpl;
|
public TimeField | createTime(java.util.Date start, java.util.Date stop)Returns a Time specification with the specified start and stop
times.
TimeField timeImpl = new TimeField();
timeImpl.setStart(start);
timeImpl.setStop(stop);
return timeImpl;
|
public TimeField | createTime()Returns an unbounded Time specification (i.e., "t=0 0").
TimeField timeImpl = new TimeField();
timeImpl.setZero();
return timeImpl;
|
public TimeDescriptionImpl | createTimeDescription(TimeField t)Returns TimeDescription object with the specified properties.
TimeDescriptionImpl timeDescriptionImpl = new TimeDescriptionImpl();
timeDescriptionImpl.setTime(t);
return timeDescriptionImpl;
|
public TimeDescriptionImpl | createTimeDescription()Returns TimeDescription unbounded (i.e. "t=0 0");
TimeDescriptionImpl timeDescriptionImpl = new TimeDescriptionImpl();
TimeField timeImpl = new TimeField();
timeImpl.setZero();
timeDescriptionImpl.setTime(timeImpl);
return timeDescriptionImpl;
|
public TimeDescriptionImpl | createTimeDescription(java.util.Date start, java.util.Date stop)Returns TimeDescription object with the specified properties.
TimeDescriptionImpl timeDescriptionImpl = new TimeDescriptionImpl();
TimeField timeImpl = new TimeField();
timeImpl.setStart(start);
timeImpl.setStop(stop);
timeDescriptionImpl.setTime(timeImpl);
return timeDescriptionImpl;
|
public ZoneField | createTimeZoneAdjustment(java.util.Date d, int offset)Constructs a timezone adjustment record.
ZoneField timeZoneAdjustmentImpl = new ZoneField();
try {
Hashtable map = new Hashtable();
map.put(d, new Integer(offset));
timeZoneAdjustmentImpl.setZoneAdjustments(map);
}
catch (SdpException s) {
s.printStackTrace();
}
return timeZoneAdjustmentImpl;
|
public URIField | createURI(java.lang.String value)Returns URI object with the specified value.
URIField uriImpl = new URIField();
uriImpl.setURI(value);
return uriImpl;
|
public ProtoVersionField | createVersion(int value)Returns Version object with the specified values.
ProtoVersionField protoVersionField = new ProtoVersionField();
try {
protoVersionField.setVersion(value);
}
catch (SdpException s) {
s.printStackTrace();
return null;
}
return protoVersionField;
|
public static java.util.Vector | findSessions(java.lang.String source)Returns a collection of Strings containing session description.
return sessionDescriptionsList;
|
public java.lang.String | formatMulticastAddress(java.lang.String addr, int ttl, int numAddrs)Returns a String containing the computed form for a
multi-connection address.
String res = addr + "/" + ttl + "/"+numAddrs;
return res;
|
public static java.util.Date | getDateFromNtp(long ntpTime)Converts a NTP to regular date value.
return new Date((ntpTime - SdpConstants.NTP_CONST) * 1000);
|
public static gov.nist.javax.sdp.SdpFactory | getInstance()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.
return new SdpFactory();
|
public static long | getNtpTime(java.util.Date d)Returns a long containing the NTP value for a given Java Date.
if (d == null)
return -1;
return ((d.getTime()/1000) + SdpConstants.NTP_CONST);
|