    All Packages  Class Hierarchy  This Package  Previous  Next  Index

# Class w3c.www.sap.SapSession

    java.lang.Object
       |
       +----w3c.www.sap.SapSession

public class SapSession
extends Object

##

asbw
  SAP Application Specific bandwidth in kb per sec.
attrs
  SAP attributes.
caddr
  SAP connection address.
caddrtype
  SAP connection address type.
cnaddr
  SAP number of multicast groups.
ctbw
  SAP Conference Total bandwidth in kb per sec.
cttl
  SAP connection time to live.
deleted
  Has this session been deleted ?
emails
  SAP owner email address.
hasConnection
  Does this SAP session has asssociated connection data ?
infos
  SAP session informations.
medias
  SAP medias.
name
  SAP session name.
phones
  SAP owner email address.
saddr
  SAP session address.
saddrtype
  SAP session address type.
SDP_VERSION
  The SDP version understood by this class.
sid
  SAP session identifier.
snettype
  SAP session network type.
startTime
  SAP session start time (NTP).
stopTime
  SAP session stop time.
sversion
  SAP session version.
urls
  SAP associated URL.
version
  SDP version currently used.

##

addAttribute(String, String)
  Add an attribute to that media description.
addInfo(String)
  Add more info.
addMail(String)
  Add an email location.
addMedia(SapMedia)
  Add a media to that session.
addPhone(String)
  Add a phone location.
addURL(String)
  Add an URL for the session.
createMedia(String, int, int, String, String[])
  Add a media description to that session.
enumerateMedias()
  Enumerate all medias available on that session.
getAttributeValue(String)
  Get the first value of an attribute.
getAttributeValues(String)
  Get all mappings of an attribute.
getIdentifier()
  Get that session uniq identifier.
getOwner()
  Get the ownership field, formatted for SDP.
getTimeToLive()
  Get the max TTL for that session.
isDeleted()
  Has this session been deleted ?
parse(byte[], int, int)
  Parse the given packet as a single session announcement.
parse(InputStream)
  Read next line of SAP stream.
removeAttribute(String)
  Remove an attribute definition.
removeMedia(SapMedia)
  Remove that media from the session.
setConnectionData(String, String, InetAddress, int, int)
  Set this session's connection data.
setDeleted(boolean)
  Set this session deletion status.
setTimes(long, long)
  Set start and stop time for the session.
toByteArray()
  Generate a buffer to announce that session.
toString()
  Convert that session description to a String.

##

SDP_VERSION

     public static final int SDP_VERSION

  The SDP version understood by this class.

version

     protected int version

  SDP version currently used.

sid

     protected long sid

  SAP session identifier.

sversion

     protected long sversion

  SAP session version.

snettype

     protected String snettype

  SAP session network type.

saddrtype

     protected String saddrtype

  SAP session address type.

saddr

     protected InetAddress saddr

  SAP session address.

name

     protected String name

  SAP session name.

infos

     protected String infos[]

  SAP session informations.

urls

     protected String urls[]

  SAP associated URL.

emails

     protected String emails[]

  SAP owner email address.

phones

     protected String phones[]

  SAP owner email address.

hasConnection

     protected boolean hasConnection

  Does this SAP session has asssociated connection data ?

caddrtype

     protected String caddrtype

  SAP connection address type.

caddr

     protected InetAddress caddr

  SAP connection address.

cttl

     protected int cttl

  SAP connection time to live.

cnaddr

     protected int cnaddr

  SAP number of multicast groups.

ctbw

     protected int ctbw

  SAP Conference Total bandwidth in kb per sec.

asbw

     protected int asbw

  SAP Application Specific bandwidth in kb per sec.

startTime

     protected long startTime

  SAP session start time (NTP).

stopTime

     protected long stopTime

  SAP session stop time.

attrs

     protected SapAttributes attrs

  SAP attributes.

medias

     protected Vector medias

  SAP medias.

deleted

     protected boolean deleted

  Has this session been deleted ?

##

toString

     public String toString()

  Convert that session description to a String.

  Returns:
    A String instance
  Overrides:
    toString in class Object

addMedia

     protected void addMedia(SapMedia media)

  Add a media to that session.

  Parameters:
    media - The media to add to this session.

toByteArray

     public byte[] toByteArray()

  Generate a buffer to announce that session.

  Returns:
    A byte array containing the formatted data to be emited on the wire.

parse

     public void parse(InputStream input) throws IOException, SapProtocolException

  Read next line of SAP stream.

  Returns:
    A String containing the next line of input.
  Throws: IOException
    If IO error when reading from stream.

parse

     protected void parse(byte buf[],
                          int off,
                          int len) throws SapProtocolException

  Parse the given packet as a single session announcement.

  Parameters:
    p - The DatagramPacket to parse.
  Throws: SapProtocolException
    If given data doesn't conform to SDP.
  See Also:
    SDP

setDeleted

     protected void setDeleted(boolean onoff)

  Set this session deletion status.

  Parameters:
    onoff - The toggle value.

getIdentifier

     public long getIdentifier()

  Get that session uniq identifier.

  Returns:
    A long uniq session identifier.

enumerateMedias

     public Enumeration enumerateMedias()

  Enumerate all medias available on that session.

  Returns:
    An Enumeration instance.

createMedia

     public SapMedia createMedia(String media,
                                 int port,
                                 int nport,
                                 String transport,
                                 String formats[])

  Add a media description to that session.

  Parameters:
    media - The media name.
    port - The port number.
    nport - The number of ports used.
    transport - The name of the transport used.
    formats - List of formats used.
  Returns:
    A SapMedia instance.

removeMedia

     public void removeMedia(SapMedia m)

  Remove that media from the session.

  Parameters:
    m - The SapMedia to remove from the session description.

addAttribute

     public void addAttribute(String key,
                              String val)

  Add an attribute to that media description.

  Parameters:
    key - The name of the attribute.
    val - The value for that attribute.

removeAttribute

     public void removeAttribute(String key)

  Remove an attribute definition. Removes all values for that attribute.

  Parameters:
    key - The attribute name.

getAttributeValue

     public String getAttributeValue(String key)

  Get the first value of an attribute.

  Parameters:
    key - The attribute name.
  Returns:
    A String instance, or null.

getAttributeValues

     public String[] getAttributeValues(String key)

  Get all mappings of an attribute.

  Parameters:
    key - The name of the attribute.
  Returns:
    A String array, which might have a zero length (to indicate a flag), or null.

addPhone

     public void addPhone(String phone)

  Add a phone location.

  Parameters:
    phone - The new phone location.

addMail

     public void addMail(String email)

  Add an email location.

  Parameters:
    email - The new email location.

addInfo

     public void addInfo(String info)

  Add more info.

  Parameters:
    info - The info to be added.

addURL

     public void addURL(String url)

  Add an URL for the session.

  Parameters:
    url - The URL.

setConnectionData

     public void setConnectionData(String ctype,
                                   String atype,
                                   InetAddress addr,
                                   int ttl,
                                   int naddr)

  Set this session's connection data.

  Parameters:
    ctype - The connection network type.
    atype - The address type.
    addr - The address for the session itself.
    ttl - The TTL for the session.
    naddr - Number of following reserved address.

getTimeToLive

     public int getTimeToLive()

  Get the max TTL for that session.

  Returns:
    A integer ttl value.

getOwner

     public byte[] getOwner()

  Get the ownership field, formatted for SDP.

  Returns:
    A byte array containing only the owner info (used for session deletion announcements).

isDeleted

     public boolean isDeleted()

  Has this session been deleted ?

  Returns:
    A boolean, true if a deletion message has been received or emitted concerning that session.

setTimes

     public void setTimes(long start,
                          long stop)

  Set start and stop time for the session.

  Parameters:
    start - The start time, in milliseconds (Java format).
    stop - The stop time, in milliseconds (Java format).

    All Packages  Class Hierarchy  This Package  Previous  Next  Index