NIST SIP Parser and Stack (v1.2) API

javax.sdp
Interface SessionDescription

All Superinterfaces:
Cloneable, Serializable
All Known Implementing Classes:
SessionDescriptionImpl

public interface SessionDescription
extends Serializable, Cloneable

A SessionDescription represents the data defined by the Session Description Protocol (see IETF RFC 2327) and holds information about the originitor of a session, the media types that a client can support and the host and port on which the client will listen for that media. The SessionDescription also holds timing information for the session (e.g. start, end, repeat, time zone) and bandwidth supported for the session. Please refer to IETF RFC 2327 for a description of SDP.

Version:
1.0
Author:
deruelle

Method Summary
 Object clone()
          Public clone declaration.
 String getAttribute(String name)
          Returns the value of the specified attribute.
 Vector getAttributes(boolean create)
          Returns the set of attributes for this Description as a Vector of Attribute objects in the order they were parsed.
 int getBandwidth(String name)
          Returns the integer value of the specified bandwidth name.
 Vector getBandwidths(boolean create)
          Returns the Bandwidth of the specified type.
 Connection getConnection()
          Returns the connection information associated with this object.
 Vector getEmails(boolean create)
          Returns an email address to contact for further information about the session.
 Info getInfo()
          Returns value of the info field (i=) of this object.
 Key getKey()
          Returns the key data.
 Vector getMediaDescriptions(boolean create)
          Adds a MediaDescription to the session description.
 Origin getOrigin()
          Returns information about the originator of the session.
 Vector getPhones(boolean create)
          Returns a phone number to contact for further information about the session.
 SessionName getSessionName()
          Returns the name of the session.
 Vector getTimeDescriptions(boolean create)
          Returns a TimeField indicating the start, stop, repetition and time zone information of the session.
 URI getURI()
          Returns a uri to the location of more details about the session.
 Version getVersion()
          Returns the version of SDP in use.
 Vector getZoneAdjustments(boolean create)
          Returns the time zone adjustments for the Session
 void removeAttribute(String name)
          Removes the attribute specified by the value parameter.
 void removeBandwidth(String name)
          Removes the specified bandwidth type.
 void setAttribute(String name, String value)
          Sets the value of the specified attribute.
 void setAttributes(Vector Attributes)
          Adds the specified Attribute to this Description object.
 void setBandwidth(String name, int value)
          Sets the value of the specified bandwidth type.
 void setBandwidths(Vector bandwidths)
          set the value of the Bandwidth with the specified type.
 void setConnection(Connection conn)
          Set the connection data for this entity.
 void setEmails(Vector emails)
          Sets a an email address to contact for further information about the session.
 void setInfo(Info i)
          Sets the i= field of this object.
 void setKey(Key key)
          Sets encryption key information.
 void setMediaDescriptions(Vector mediaDescriptions)
          Removes all MediaDescriptions from the session description.
 void setOrigin(Origin origin)
          Sets information about the originator of the session.
 void setPhones(Vector phones)
          Sets a phone number to contact for further information about the session.
 void setSessionName(SessionName sessionName)
          Sets the name of the session.
 void setTimeDescriptions(Vector times)
          Sets a TimeField indicating the start, stop, repetition and time zone information of the session.
 void setURI(URI uri)
          Sets the uri to the location of more details about the session.
 void setVersion(Version v)
          Sets the version of SDP in use.
 void setZoneAdjustments(Vector zoneAdjustments)
          Sets the time zone adjustment for the TimeField.
 

Method Detail

clone

public Object clone()
             throws CloneNotSupportedException
Public clone declaration.

Returns:
Object
Throws:
CloneNotSupportedException - if clone method is not supported

getVersion

public Version getVersion()
Returns the version of SDP in use. This corresponds to the v= field of the SDP data.

Returns:
the integer version (-1 if not set).

setVersion

public void setVersion(Version v)
                throws SdpException
Sets the version of SDP in use. This corresponds to the v= field of the SDP data.

Parameters:
v - version - the integer version.
Throws:
SdpException - if the version is null

getOrigin

public Origin getOrigin()
Returns information about the originator of the session. This corresponds to the o= field of the SDP data.

Returns:
the originator data.

setOrigin

public void setOrigin(Origin origin)
               throws SdpException
Sets information about the originator of the session. This corresponds to the o= field of the SDP data.

Parameters:
origin - origin - the originator data.
Throws:
SdpException - if the origin is null

getSessionName

public SessionName getSessionName()
Returns the name of the session. This corresponds to the s= field of the SDP data.

Returns:
the session name.

setSessionName

public void setSessionName(SessionName sessionName)
                    throws SdpException
Sets the name of the session. This corresponds to the s= field of the SDP data.

Parameters:
sessionName - name - the session name.
Throws:
SdpException - if the sessionName is null

getInfo

public Info getInfo()
Returns value of the info field (i=) of this object.

Returns:
info

setInfo

public void setInfo(Info i)
             throws SdpException
Sets the i= field of this object.

Parameters:
i - s - new i= value; if null removes the field
Throws:
SdpException - if the info is null

getURI

public URI getURI()
Returns a uri to the location of more details about the session. This corresponds to the u= field of the SDP data.

Returns:
the uri.

setURI

public void setURI(URI uri)
            throws SdpException
Sets the uri to the location of more details about the session. This corresponds to the u= field of the SDP data.

Parameters:
uri - uri - the uri.
Throws:
SdpException - if the uri is null

getEmails

public Vector getEmails(boolean create)
                 throws SdpParseException
Returns an email address to contact for further information about the session. This corresponds to the e= field of the SDP data.

Parameters:
create - boolean to set
Returns:
the email address.
Throws:
SdpException
SdpParseException

setEmails

public void setEmails(Vector emails)
               throws SdpException
Sets a an email address to contact for further information about the session. This corresponds to the e= field of the SDP data.

Parameters:
emails - email - the email address.
Throws:
SdpException - if the vector is null

getPhones

public Vector getPhones(boolean create)
                 throws SdpException
Returns a phone number to contact for further information about the session. This corresponds to the p= field of the SDP data.

Parameters:
create - boolean to set
Returns:
the phone number.
Throws:
SdpException

setPhones

public void setPhones(Vector phones)
               throws SdpException
Sets a phone number to contact for further information about the session. This corresponds to the p= field of the SDP data.

Parameters:
phones - phone - the phone number.
Throws:
SdpException - if the vector is null

getTimeDescriptions

public Vector getTimeDescriptions(boolean create)
                           throws SdpException
Returns a TimeField indicating the start, stop, repetition and time zone information of the session. This corresponds to the t= field of the SDP data.

Parameters:
create - boolean to set
Returns:
the Time Field.
Throws:
SdpException

setTimeDescriptions

public void setTimeDescriptions(Vector times)
                         throws SdpException
Sets a TimeField indicating the start, stop, repetition and time zone information of the session. This corresponds to the t= field of the SDP data.

Parameters:
times - time - the TimeField.
Throws:
SdpException - if the vector is null

getZoneAdjustments

public Vector getZoneAdjustments(boolean create)
                          throws SdpException
Returns the time zone adjustments for the Session

Parameters:
create - boolean to set
Returns:
a Hashtable containing the zone adjustments, where the key is the Adjusted Time Zone and the value is the offset.
Throws:
SdpException

setZoneAdjustments

public void setZoneAdjustments(Vector zoneAdjustments)
                        throws SdpException
Sets the time zone adjustment for the TimeField.

Parameters:
zoneAdjustments - zoneAdjustments - a Hashtable containing the zone adjustments, where the key is the Adjusted Time Zone and the value is the offset.
Throws:
SdpException - if the vector is null

getConnection

public Connection getConnection()
Returns the connection information associated with this object. This may be null for SessionDescriptions if all Media objects have a connection object and may be null for Media objects if the corresponding session connection is non-null.

Returns:
connection

setConnection

public void setConnection(Connection conn)
                   throws SdpException
Set the connection data for this entity.

Parameters:
conn - to set
Throws:
SdpException - if the parameter is null

getBandwidths

public Vector getBandwidths(boolean create)
Returns the Bandwidth of the specified type.

Parameters:
create - type - type of the Bandwidth to return
Returns:
the Bandwidth or null if undefined

setBandwidths

public void setBandwidths(Vector bandwidths)
                   throws SdpException
set the value of the Bandwidth with the specified type.

Parameters:
bandwidths - to set
Throws:
SdpException - if the vector is null

getBandwidth

public int getBandwidth(String name)
                 throws SdpParseException
Returns the integer value of the specified bandwidth name.

Parameters:
name - name - the name of the bandwidth type
Returns:
the value of the named bandwidth
Throws:
SdpParseException

setBandwidth

public void setBandwidth(String name,
                         int value)
                  throws SdpException
Sets the value of the specified bandwidth type.

Parameters:
name - name - the name of the bandwidth type.
value - value - the value of the named bandwidth type.
Throws:
SdpException - if the name is null

removeBandwidth

public void removeBandwidth(String name)
Removes the specified bandwidth type.

Parameters:
name - name - the name of the bandwidth type

getKey

public Key getKey()
Returns the key data.

Returns:
key

setKey

public void setKey(Key key)
            throws SdpException
Sets encryption key information. This consists of a method and an encryption key included inline.

Parameters:
key - key - the encryption key data; depending on method may be null
Throws:
SdpException - if the parameter is null

getAttribute

public String getAttribute(String name)
                    throws SdpParseException
Returns the value of the specified attribute.

Parameters:
name - name - the name of the attribute
Returns:
the value of the named attribute
Throws:
SdpParseException

getAttributes

public Vector getAttributes(boolean create)
Returns the set of attributes for this Description as a Vector of Attribute objects in the order they were parsed.

Parameters:
create - create - specifies whether to return null or a new empty Vector in case no attributes exists for this Description
Returns:
attributes for this Description

removeAttribute

public void removeAttribute(String name)
Removes the attribute specified by the value parameter.

Parameters:
name - name - the name of the attribute

setAttribute

public void setAttribute(String name,
                         String value)
                  throws SdpException
Sets the value of the specified attribute.

Parameters:
name - name - the name of the attribute.
value - value - the value of the named attribute.
Throws:
SdpException - if the name or the value is null

setAttributes

public void setAttributes(Vector Attributes)
                   throws SdpException
Adds the specified Attribute to this Description object.

Parameters:
Attributes - attribute - the attribute to add
Throws:
SdpException - if the vector is null

getMediaDescriptions

public Vector getMediaDescriptions(boolean create)
                            throws SdpException
Adds a MediaDescription to the session description. These correspond to the m= fields of the SDP data.

Parameters:
create - boolean to set
Returns:
media - the field to add.
Throws:
SdpException

setMediaDescriptions

public void setMediaDescriptions(Vector mediaDescriptions)
                          throws SdpException
Removes all MediaDescriptions from the session description.

Parameters:
mediaDescriptions - to set
Throws:
SdpException - if the parameter is null

NIST SIP Parser and Stack (v1.2) API

A product of the NIST/ITL Advanced Networking Technologies Division.
See conditions of use.
Get the latest distribution.
Submit a bug report or feature request.