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

gov.nist.javax.sip
Class ListeningPointImpl

java.lang.Object
  extended by gov.nist.javax.sip.ListeningPointImpl
All Implemented Interfaces:
ListeningPointExt, Serializable, Cloneable, ListeningPoint

public class ListeningPointImpl
extends Object
implements ListeningPoint, ListeningPointExt

Implementation of the ListeningPoint interface

Version:
1.2 $Revision: 1.14 $ $Date: 2009/07/29 20:38:17 $
Author:
M. Ranganathan
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface javax.sip.ListeningPoint
PORT_5060, PORT_5061, SCTP, TCP, TLS, UDP
 
Method Summary
 Object clone()
          Clone this listening point.
 ContactHeader createContactHeader()
          Create a contact for this listening point.
 String getIPAddress()
          Gets the IP of the ListeningPoint.
 MessageProcessor getMessageProcessor()
           
 int getPort()
          Gets the port of the ListeningPoint.
 SipProviderImpl getProvider()
          Get the provider.
 String getSentBy()
          Gets the sentBy attribute of the ListeningPoint.
 String getTransport()
          Gets transport of the ListeningPoint.
 Via getViaHeader()
           
 boolean isSentBySet()
           
static String makeKey(String host, int port, String transport)
          Construct a key to refer to this structure from the SIP stack
 void sendHeartbeat(String ipAddress, int port)
          Send a heartbeat to the specified Ip address and port via this listening point.
 void setSentBy(String sentBy)
          Sets the sentBy string for this ListeningPoint.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.sip.ListeningPoint
equals
 

Method Detail

makeKey

public static String makeKey(String host,
                             int port,
                             String transport)
Construct a key to refer to this structure from the SIP stack

Parameters:
host - host string
port - port
transport - transport
Returns:
a string that is used as a key

clone

public Object clone()
Clone this listening point. Note that a message Processor is not started. The transport is set to null.

Overrides:
clone in class Object
Returns:
cloned listening point.

getPort

public int getPort()
Gets the port of the ListeningPoint. The default port of a ListeningPoint is dependent on the scheme and transport. For example:

Specified by:
getPort in interface ListeningPoint
Returns:
port of ListeningPoint

getTransport

public String getTransport()
Gets transport of the ListeningPoint.

Specified by:
getTransport in interface ListeningPoint
Returns:
transport of ListeningPoint

getProvider

public SipProviderImpl getProvider()
Get the provider.

Returns:
the provider.

getIPAddress

public String getIPAddress()
Description copied from interface: ListeningPoint
Gets the IP of the ListeningPoint.

Specified by:
getIPAddress in interface ListeningPoint
Returns:
the string value of the IP address.

setSentBy

public void setSentBy(String sentBy)
               throws ParseException
Description copied from interface: ListeningPoint
Sets the sentBy string for this ListeningPoint. The sentBy String is placed in the top most Via header of outgoing requests. This parameter is optional and if it is not set, the top most Via header will use the IP address and port assigned to the listening point for the sentBy field.

Specified by:
setSentBy in interface ListeningPoint
Parameters:
sentBy - the sentBy string to be set in requests top most Via headers.
Throws:
ParseException - which signals that an error has been reached unexpectedly while parsing the sentBy value.

getSentBy

public String getSentBy()
Description copied from interface: ListeningPoint
Gets the sentBy attribute of the ListeningPoint.

Specified by:
getSentBy in interface ListeningPoint
Returns:
the string value of the sentBy attribute.

isSentBySet

public boolean isSentBySet()

getViaHeader

public Via getViaHeader()

getMessageProcessor

public MessageProcessor getMessageProcessor()

createContactHeader

public ContactHeader createContactHeader()
Description copied from interface: ListeningPointExt
Create a contact for this listening point.

Specified by:
createContactHeader in interface ListeningPointExt
Returns:
a contact header corresponding to this listening point.

sendHeartbeat

public void sendHeartbeat(String ipAddress,
                          int port)
                   throws IOException
Description copied from interface: ListeningPointExt
Send a heartbeat to the specified Ip address and port via this listening point. This method can be used to send out a period CR-LF for NAT keepalive.

Specified by:
sendHeartbeat in interface ListeningPointExt
Throws:
IOException

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.