jain.protocol.ip.sip
Class ListeningPoint

java.lang.Object
  |
  +--jain.protocol.ip.sip.ListeningPoint

public final class ListeningPoint
extends java.lang.Object
implements java.lang.Cloneable

This class represents a unique IP network listening point, and consists of host, port and transport

Version:
0.6

Field Summary
static int TRANSPORT_TCP
          TCP Transport constant
static int TRANSPORT_UDP
          UDP Transport constant
 
Constructor Summary
ListeningPoint()
          Creates a ListeningPoint (uses localhost, well-known sip port(5060) and TRANSPORT_UDP)
ListeningPoint(java.net.InetAddress host)
          Creates a ListeningPoint based on given host (uses well-known sip port(5060) and TRANSPORT_UDP)
ListeningPoint(java.net.InetAddress host, int port)
          Creates a ListeningPoint based on given host and port (uses TRANSPORT_UDP)
ListeningPoint(java.net.InetAddress host, int port, int transport)
          Creates a ListeningPoint based on given host, port and transport
 
Method Summary
 java.net.InetAddress getHost()
          Gets host of ListeningPoint
 int getPort()
          Gets port of ListeningPoint
 int getTransport()
          Gets transport of ListeningPoint
 void setHost(java.net.InetAddress host)
          Sets host of Header
 void setPort(int port)
          Set port of Header
 void setTransport(int transport)
          Sets transport of Header
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TRANSPORT_UDP

public static final int TRANSPORT_UDP
UDP Transport constant

TRANSPORT_TCP

public static final int TRANSPORT_TCP
TCP Transport constant
Constructor Detail

ListeningPoint

public ListeningPoint(java.net.InetAddress host,
                      int port,
                      int transport)
               throws java.lang.IllegalArgumentException
Creates a ListeningPoint based on given host, port and transport
Parameters:
host - host
port - port
transport - transport
Throws:
java.lang.IllegalArgumentException - if host is null, port is negtive, or if transport is neither TRANSPORT_UDP nor TRANSPORT_TCP

ListeningPoint

public ListeningPoint(java.net.InetAddress host,
                      int port)
               throws java.lang.IllegalArgumentException
Creates a ListeningPoint based on given host and port (uses TRANSPORT_UDP)
Parameters:
host - host
port - port
Throws:
java.lang.IllegalArgumentException - if host is null or port is negtive

ListeningPoint

public ListeningPoint(java.net.InetAddress host)
               throws java.lang.IllegalArgumentException
Creates a ListeningPoint based on given host (uses well-known sip port(5060) and TRANSPORT_UDP)
Parameters:
host - host
Throws:
java.lang.IllegalArgumentException - if host is null

ListeningPoint

public ListeningPoint()
               throws java.net.UnknownHostException
Creates a ListeningPoint (uses localhost, well-known sip port(5060) and TRANSPORT_UDP)
Throws:
UnknownHostExceptionException - if cannot find localhost
Method Detail

getHost

public java.net.InetAddress getHost()
Gets host of ListeningPoint
Returns:
host of ListeningPoint

setHost

public void setHost(java.net.InetAddress host)
             throws java.lang.IllegalArgumentException
Sets host of Header
Parameters:
host - host
Throws:
java.lang.IllegalArgumentException - if host is null

getPort

public int getPort()
Gets port of ListeningPoint
Returns:
port of ListeningPoint

setPort

public void setPort(int port)
             throws java.lang.IllegalArgumentException
Set port of Header
Parameters:
port - port
Throws:
java.lang.IllegalArgumentException - if port is negative

getTransport

public int getTransport()
Gets transport of ListeningPoint
Returns:
transport of ListeningPoint

setTransport

public void setTransport(int transport)
                  throws java.lang.IllegalArgumentException
Sets transport of Header
Parameters:
transport - transport
Throws:
java.lang.IllegalArgumentException - if transport is neither TRANSPORT_UDP nor TRANSPORT_TCP


If you have any comments or queries, please mail them to JAIN-SIP-interest@sun.com


Copyright - 2000 Sun Microsystems