FileDocCategorySizeDatePackage
ListeningPoint.javaAPI DocphoneME MR2 API (J2ME)4957Wed May 02 18:00:42 BST 2007gov.nist.siplite

ListeningPoint

public class ListeningPoint extends Object
Implementation of the ListeningPoint interface
version
JAIN-SIP-1.1 This code is in the public domain.

Fields Summary
protected String
host
Host being monitored.
protected String
transport
Current connection.
int
port
My port. (same thing as in the message processor)
protected MessageProcessor
messageProcessor
Pointer to the imbedded mesage processor.
protected SipProvider
sipProviderImpl
Provider back pointer.
protected SipStack
sipStack
Our stack.
Constructors Summary
protected ListeningPoint(SipStack sipStack, String host, int port, String transport)
Constructor.

param
sipStack context for the current transaction
param
host Host name
param
port the channel to moonitor
param
transport the connection being used

        this.sipStack = (SipStack) sipStack;
        // this.host = sipStack.getIPAddress();
        this.host = host;
        this.port = port;
        this.transport = transport;
    
Methods Summary
public java.lang.StringgetHost()
Gets host name of this ListeningPoint.

return
host of ListeningPoint

        return this.sipStack.getHostAddress();
    
protected java.lang.StringgetKey()
Gets the key for this struct.

return
get the host

        return makeKey(host, port, transport);
        // return makeKey(host, port, transport);
    
public intgetPort()
Gets the port of the ListeningPoint. The default port of a ListeningPoint is dependent on the scheme and transport. For example:
  • The default port is 5060 if the transport UDP the scheme is sip:.
  • The default port is 5060 if the transport is TCP the scheme is sip:.
  • The default port is 5060 if the transport is SCTP the scheme is sip:.
  • The default port is 5061 if the transport is TLS over TCP the scheme is sip:.
  • The default port is 5061 if the transport is TCP the scheme is sips:.

return
port of ListeningPoint

        return messageProcessor.getPort();
    
public SipProvidergetProvider()
Getsthe provider.

return
the provider.

        return this.sipProviderImpl;
    
public java.lang.StringgetTransport()
Gets transport of the ListeningPoint.

return
transport of ListeningPoint

        return messageProcessor.getTransport();
    
public static java.lang.StringmakeKey(java.lang.String host, int port, java.lang.String transport)
Constructs a key to refer to this structure from the SIP stack.

param
host host string
param
port port
param
transport transport
return
a string that is used as a key

        return new StringBuffer(host).
                append(":").
                append(port).
                append("/").
                append(transport).
                toString().
                toLowerCase();
    
protected voidremoveSipProvider()
Removes the sip provider from this listening point.

        this.sipProviderImpl = null;
    
protected voidsetSipProvider(SipProvider sipProviderImpl)
Sets the sip provider for this structure.

param
sipProviderImpl provider to set

        this.sipProviderImpl = sipProviderImpl;