org.mobicents.servlet.sip.core
Class ExtendedListeningPoint

java.lang.Object
  extended by org.mobicents.servlet.sip.core.ExtendedListeningPoint

public class ExtendedListeningPoint
extends java.lang.Object

Author:
Jean Deruelle

Constructor Summary
ExtendedListeningPoint(javax.sip.SipProvider sipProvider, javax.sip.ListeningPoint listeningPoint)
           
 
Method Summary
 javax.sip.header.ContactHeader createContactHeader(java.lang.String displayName, boolean usePublicAddress)
          Create a Contact Header based on the host, port and transport of this listening point
 javax.sip.address.SipURI createRecordRouteURI(boolean usePublicAddress)
          Create a Record Route URI based on the host, port and transport of this listening point
 javax.sip.header.ViaHeader createViaHeader(java.lang.String branch, boolean usePublicAddress)
          Create a Via Header based on the host, port and transport of this listening point
 java.lang.String getGlobalIpAddress()
          Retrieve the global ip address of this listening point (found through STUN), null if no global ip address is asccoiated to it
 int getGlobalPort()
          Retrieve the global port of this listening point (found through STUN), -1 if no global port is asccoiated to it
 java.lang.String getHost(boolean usePublicAddress)
          Retrieve either the global ip address found by STUN or the local network interface one depending on the boolean value in parameter
protected  java.lang.String getIpAddress(boolean usePublicAddress)
           
 java.util.List<java.lang.String> getIpAddresses()
          Return the list of real ip address represented by this listening point.
 javax.sip.ListeningPoint getListeningPoint()
          Retrieve the jain sip listening point being extended by this class
 int getPort()
          Retrieve the port associated with this listening point
 javax.sip.SipProvider getSipProvider()
          Retrieve the sip provider associated to the jain sip listening point being extended by this class
 java.lang.String getTransport()
          Retrieve the transport associated with this listening point
 boolean isAnyLocalAddress()
          return true if the ip address maps to 0.0.0.0.
 boolean isUseStaticAddress()
          If we are using a statically assigned IP address instead of our local address (for example when IP LB is used)
 void setGlobalIpAddress(java.lang.String globalIpAddress)
          Set the global ip address (found through STUN) of this extended listening point
 void setGlobalPort(int globalPort)
          Set the global port (found through STUN) of this extended listening point
 void setPort(int port)
           
 void setUseStaticAddress(boolean useStaticAddress)
          If we are using a statically assigned IP address instead of our local address (for example when IP LB is used)
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ExtendedListeningPoint

public ExtendedListeningPoint(javax.sip.SipProvider sipProvider,
                              javax.sip.ListeningPoint listeningPoint)
Method Detail

getIpAddress

protected java.lang.String getIpAddress(boolean usePublicAddress)

createContactHeader

public javax.sip.header.ContactHeader createContactHeader(java.lang.String displayName,
                                                          boolean usePublicAddress)
Create a Contact Header based on the host, port and transport of this listening point

Parameters:
usePublicAddress - if true, the host will be the global ip address found by STUN otherwise it will be the local network interface ipaddress
displayName - the display name to use
Returns:
the Contact header

createViaHeader

public javax.sip.header.ViaHeader createViaHeader(java.lang.String branch,
                                                  boolean usePublicAddress)
Create a Via Header based on the host, port and transport of this listening point

Parameters:
usePublicAddress - if true, the host will be the global ip address found by STUN otherwise it will be the local network interface ipaddress
branch - the branch id to use
Returns:
the via header

createRecordRouteURI

public javax.sip.address.SipURI createRecordRouteURI(boolean usePublicAddress)
Create a Record Route URI based on the host, port and transport of this listening point

Parameters:
usePublicAddress - if true, the host will be the global ip address found by STUN otherwise it will be the local network interface ipaddress
Returns:
the record route uri

getListeningPoint

public javax.sip.ListeningPoint getListeningPoint()
Retrieve the jain sip listening point being extended by this class

Returns:
the jain sip listening point being extended by this class

getSipProvider

public javax.sip.SipProvider getSipProvider()
Retrieve the sip provider associated to the jain sip listening point being extended by this class

Returns:
the sip provider associated to the jain sip listening point being extended by this class

getGlobalIpAddress

public java.lang.String getGlobalIpAddress()
Retrieve the global ip address of this listening point (found through STUN), null if no global ip address is asccoiated to it

Returns:
the global ip address of this listening point, null if no global ip address is asccoiated to it

getGlobalPort

public int getGlobalPort()
Retrieve the global port of this listening point (found through STUN), -1 if no global port is asccoiated to it

Returns:
the global port of this listening point, -1 if no global port is asccoiated to it

setGlobalIpAddress

public void setGlobalIpAddress(java.lang.String globalIpAddress)
Set the global ip address (found through STUN) of this extended listening point

Parameters:
globalIpAddress - the global ip address of this listening point

setGlobalPort

public void setGlobalPort(int globalPort)
Set the global port (found through STUN) of this extended listening point

Parameters:
globalPort - the global port of this listening point

isUseStaticAddress

public boolean isUseStaticAddress()
If we are using a statically assigned IP address instead of our local address (for example when IP LB is used)

Returns:

setUseStaticAddress

public void setUseStaticAddress(boolean useStaticAddress)
If we are using a statically assigned IP address instead of our local address (for example when IP LB is used)

Parameters:
useStaticAddress -

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getIpAddresses

public java.util.List<java.lang.String> getIpAddresses()
Return the list of real ip address represented by this listening point. This can be many ip address because the listening point IP address could be 0.0.0.0

Returns:
the list of real ip address represented by this listening point.

getHost

public java.lang.String getHost(boolean usePublicAddress)
Retrieve either the global ip address found by STUN or the local network interface one depending on the boolean value in parameter

Parameters:
true - means we want to retrieve the global ip address found by STUN
Returns:
Retrieve either the global ip address found by STUN or the local network interface one depending on the boolean value in parameter

getPort

public int getPort()
Retrieve the port associated with this listening point

Returns:
port associated with this listening point

setPort

public void setPort(int port)

getTransport

public java.lang.String getTransport()
Retrieve the transport associated with this listening point

Returns:
the transport associated with this listening point

isAnyLocalAddress

public boolean isAnyLocalAddress()
return true if the ip address maps to 0.0.0.0. If it's true call getIpAddresses ti get the real list of ip addresses it maps too

Returns:
true if the ip adress is a any local address


Copyright © 2009. All Rights Reserved.