NIST-SIP: The Reference Implementation for JAIN-SIP 1.2

gov.nist.javax.sdp.fields
Class MediaField

java.lang.Object
  extended by gov.nist.core.GenericObject
      extended by gov.nist.javax.sdp.fields.SDPObject
          extended by gov.nist.javax.sdp.fields.SDPField
              extended by gov.nist.javax.sdp.fields.MediaField
All Implemented Interfaces:
SDPFieldNames, Serializable, Cloneable, Field, Media

public class MediaField
extends SDPField
implements Media

Media field SDP header.

Version:
JSR141-PUBLIC-REVIEW (subject to change).
Author:
Olivier Deruelle , M. Ranganathan
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface gov.nist.javax.sdp.fields.SDPFieldNames
ATTRIBUTE_FIELD, BANDWIDTH_FIELD, CONNECTION_FIELD, EMAIL_FIELD, INFORMATION_FIELD, KEY_FIELD, MEDIA_FIELD, ORIGIN_FIELD, PHONE_FIELD, PROTO_VERSION_FIELD, REPEAT_FIELD, SESSION_NAME_FIELD, TIME_FIELD, URI_FIELD, ZONE_FIELD
 
Constructor Summary
MediaField()
           
 
Method Summary
 Object clone()
          Clones this object.
 String encode()
          Get the string encoded version of this object
 Vector getFormats()
           
 String getMedia()
           
 Vector getMediaFormats(boolean create)
          Returns an Vector of the media formats supported by this description.
 int getMediaPort()
          Returns the port of the media defined by this description
 String getMediaType()
          Returns the type (audio,video etc) of the media defined by this description.
 int getNports()
           
 int getPort()
           
 int getPortCount()
          Returns the number of ports associated with this media description
 String getProto()
           
 String getProtocol()
          Returns the protocol over which this media should be transmitted.
 void setFormats(Vector formats)
          Set the fmt member
 void setMedia(String m)
          Set the media member
 void setMediaFormats(Vector mediaFormats)
          Adds a media format to the media description.
 void setMediaPort(int port)
          Sets the port of the media defined by this description
 void setMediaType(String mediaType)
          Sets the type (audio,video etc) of the media defined by this description.
 void setNports(int n)
          Set the nports member
 void setPort(int p)
          Set the port member
 void setPortCount(int portCount)
          Sets the number of ports associated with this media description.
 void setProto(String p)
          Set the proto member
 void setProtocol(String protocol)
          Sets the protocol over which this media should be transmitted.
 
Methods inherited from class gov.nist.javax.sdp.fields.SDPField
getFieldName, getTypeChar, toString
 
Methods inherited from class gov.nist.javax.sdp.fields.SDPObject
dbgPrint, debugDump, equals, match
 
Methods inherited from class gov.nist.core.GenericObject
debugDump, encode, getClassFromName, getMatcher, isMySubclass, makeClone, merge, setMatcher
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.sdp.Media
toString
 
Methods inherited from interface javax.sdp.Field
getTypeChar
 

Constructor Detail

MediaField

public MediaField()
Method Detail

getMedia

public String getMedia()

getPort

public int getPort()

getNports

public int getNports()

getProto

public String getProto()

getFormats

public Vector getFormats()

setMedia

public void setMedia(String m)
Set the media member


setPort

public void setPort(int p)
Set the port member


setNports

public void setNports(int n)
Set the nports member


setProto

public void setProto(String p)
Set the proto member


setFormats

public void setFormats(Vector formats)
Set the fmt member


getMediaType

public String getMediaType()
                    throws SdpParseException
Returns the type (audio,video etc) of the media defined by this description.

Specified by:
getMediaType in interface Media
Returns:
the string media type.
Throws:
SdpParseException

setMediaType

public void setMediaType(String mediaType)
                  throws SdpException
Sets the type (audio,video etc) of the media defined by this description.

Specified by:
setMediaType in interface Media
Parameters:
mediaType - to set
Throws:
SdpException - if mediaType is null

getMediaPort

public int getMediaPort()
                 throws SdpParseException
Returns the port of the media defined by this description

Specified by:
getMediaPort in interface Media
Returns:
the integer media port.
Throws:
SdpParseException

setMediaPort

public void setMediaPort(int port)
                  throws SdpException
Sets the port of the media defined by this description

Specified by:
setMediaPort in interface Media
Parameters:
port - to set
Throws:
SdpException

getPortCount

public int getPortCount()
                 throws SdpParseException
Returns the number of ports associated with this media description

Specified by:
getPortCount in interface Media
Returns:
the integer port count.
Throws:
SdpParseException

setPortCount

public void setPortCount(int portCount)
                  throws SdpException
Sets the number of ports associated with this media description.

Specified by:
setPortCount in interface Media
Parameters:
portCount - portCount - the integer port count.
Throws:
SdpException

getProtocol

public String getProtocol()
                   throws SdpParseException
Returns the protocol over which this media should be transmitted.

Specified by:
getProtocol in interface Media
Returns:
the String protocol, e.g. RTP/AVP.
Throws:
SdpParseException

setProtocol

public void setProtocol(String protocol)
                 throws SdpException
Sets the protocol over which this media should be transmitted.

Specified by:
setProtocol in interface Media
Parameters:
protocol - - the String protocol, e.g. RTP/AVP.
Throws:
SdpException - if the protocol is null

getMediaFormats

public Vector getMediaFormats(boolean create)
                       throws SdpParseException
Returns an Vector of the media formats supported by this description. Each element in this Vector will be an String value which matches one of the a=rtpmap: attribute fields of the media description.

Specified by:
getMediaFormats in interface Media
Parameters:
create - to set
Returns:
the Vector.
Throws:
SdpException
SdpParseException

setMediaFormats

public void setMediaFormats(Vector mediaFormats)
                     throws SdpException
Adds a media format to the media description. Each element in this Vector should be an String value which matches one of the a=rtpmap: attribute fields of the media description.

Specified by:
setMediaFormats in interface Media
Parameters:
mediaFormats - the format to add.
Throws:
SdpException - if the vector is null

encode

public String encode()
Get the string encoded version of this object

Specified by:
encode in class SDPField
Since:
v1.0

clone

public Object clone()
Description copied from class: gov.nist.core.GenericObject
Clones this object.

Specified by:
clone in interface Field
Overrides:
clone in class gov.nist.core.GenericObject
Returns:
a clone of this field.

NIST-SIP: The Reference Implementation for JAIN-SIP 1.2

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