org.mobicents.servlet.sip.core
Class SipNetworkInterfaceManager

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

public class SipNetworkInterfaceManager
extends java.lang.Object

This class will be a placeholder for all sip network interfaces mapped to a sip standard service. It should allow one to query for local and external address (discovered by STUN) of a specific interface.
It will also allow various queries against its network interfaces to discover the right one to use. Those queries could be cached in order to improve performance

Author:
Jean Deruelle

Field Summary
static int MAX_PORT_NUMBER
          The maximum int value that could correspond to a port nubmer.
static int MIN_PORT_NUMBER
          The minimum int value that could correspond to a port nubmer bindable by the SIP Communicator.
 
Constructor Summary
SipNetworkInterfaceManager()
          Default Constructor
 
Method Summary
 void addExtendedListeningPoint(ExtendedListeningPoint extendedListeningPoint)
           
static int checkPortRange(int port, java.lang.String transport)
          Checks if the port is in the UDP-TCP port numbers (0-65355) range otherwise defaulting to 5060 if UDP, TCP or SCTP or to 5061 if TLS
protected  void computeOutboundInterfaces()
          Compute all the outbound interfaces for this manager
 ExtendedListeningPoint findMatchingListeningPoint(java.lang.String transport, boolean strict)
          Retrieve the first matching listening point corresponding to the transport.
 ExtendedListeningPoint findMatchingListeningPoint(java.lang.String ipAddress, int port, java.lang.String transport)
          Retrieve the first matching listening Point corresponding to the ipAddress port and transport given in parameter.
 java.util.Iterator<ExtendedListeningPoint> getExtendedListeningPoints()
          Retrieve the listening points for this manager
 java.util.List<SipURI> getOutboundInterfaces()
          Returns An immutable instance of the java.util.List interface containing the SipURI representation of IP addresses which are used by the container to send out the messages.
 void removeExtendedListeningPoint(ExtendedListeningPoint extendedListeningPoint)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_PORT_NUMBER

public static final int MAX_PORT_NUMBER
The maximum int value that could correspond to a port nubmer.

See Also:
Constant Field Values

MIN_PORT_NUMBER

public static final int MIN_PORT_NUMBER
The minimum int value that could correspond to a port nubmer bindable by the SIP Communicator.

See Also:
Constant Field Values
Constructor Detail

SipNetworkInterfaceManager

public SipNetworkInterfaceManager()
Default Constructor

Method Detail

getExtendedListeningPoints

public java.util.Iterator<ExtendedListeningPoint> getExtendedListeningPoints()
Retrieve the listening points for this manager

Returns:
the listening points for this manager

addExtendedListeningPoint

public void addExtendedListeningPoint(ExtendedListeningPoint extendedListeningPoint)
Parameters:
extendedListeningPoint -

removeExtendedListeningPoint

public void removeExtendedListeningPoint(ExtendedListeningPoint extendedListeningPoint)
Parameters:
extendedListeningPoint -

findMatchingListeningPoint

public ExtendedListeningPoint findMatchingListeningPoint(java.lang.String transport,
                                                         boolean strict)
Retrieve the first matching listening point corresponding to the transport.

Parameters:
transport - the transport
strict - if true, it will search only for this transport otherwise it will look for any transport if no valid listening point could be found for the transport in parameter
Returns:
Retrieve the first matching listening point corresponding to the transport. If none has been found, null is returned if strict is true. If none has been found, an exception is thrown is strict is false and no listening point could be found.

findMatchingListeningPoint

public ExtendedListeningPoint findMatchingListeningPoint(java.lang.String ipAddress,
                                                         int port,
                                                         java.lang.String transport)
Retrieve the first matching listening Point corresponding to the ipAddress port and transport given in parameter.

Parameters:
ipAddress - the ip address
port - the port
transport - the transport
Returns:
Retrieve the first matching listening point corresponding to the ipAddress port and transport. If none has been found, null is returned.

checkPortRange

public static int checkPortRange(int port,
                                 java.lang.String transport)
Checks if the port is in the UDP-TCP port numbers (0-65355) range otherwise defaulting to 5060 if UDP, TCP or SCTP or to 5061 if TLS

Parameters:
port - port to check
Returns:
the smae port number if in range, otherwise 5060 if UDP, TCP or SCTP or to 5061 if TLS

getOutboundInterfaces

public java.util.List<SipURI> getOutboundInterfaces()
Returns An immutable instance of the java.util.List interface containing the SipURI representation of IP addresses which are used by the container to send out the messages.

Returns:
immutable List containing the SipURI representation of IP addresses

computeOutboundInterfaces

protected void computeOutboundInterfaces()
Compute all the outbound interfaces for this manager



Copyright © 2009. All Rights Reserved.