NIST SIP Parser and Stack (v1.2) API

gov.nist.javax.sip
Class SipStackImpl

java.lang.Object
  |
  +--gov.nist.javax.sip.stack.SIPStack
        |
        +--gov.nist.javax.sip.stack.SIPTransactionStack
              |
              +--gov.nist.javax.sip.SipStackImpl
All Implemented Interfaces:
EventListener, SipStack, SIPTransactionEventListener

public class SipStackImpl
extends SIPTransactionStack
implements SipStack

Implementation of SipStack. The JAIN-SIP stack is initialized by a set of properties (see the JAIN SIP documentation for an explanation of these properties). In addition to these, the following are meaningful properties for the NIST SIP stack (specify these in the property array when you create the JAIN-SIP statck).:

Version:
JAIN-SIP-1.1
Author:
M. Ranganathan
This code is in the public domain.

Field Summary
 
Fields inherited from class gov.nist.javax.sip.stack.SIPTransactionStack
BASE_TIMER_INTERVAL
 
Fields inherited from class gov.nist.javax.sip.stack.SIPStack
DEFAULT_PORT
 
Constructor Summary
SipStackImpl(Properties configurationProperties)
           
 
Method Summary
 ListeningPoint createListeningPoint(int port, String transport)
          Creates a new peer ListeningPoint on this SipStack on a specified host, port and transport and returns a reference to the newly created ListeningPoint object.
 SipProvider createSipProvider(ListeningPoint listeningPoint)
          Creates a new peer SipProvider on this SipStack on a specified ListeningPoint and returns a reference to the newly created SipProvider object.
 void deleteListeningPoint(ListeningPoint listeningPoint)
          Deletes the specified peer ListeningPoint attached to this SipStack.
 void deleteSipProvider(SipProvider sipProvider)
          Deletes the specified peer SipProvider attached to this SipStack.
 String getIPAddress()
          Gets the IP Address that identifies this SipStack instance.
 ListeningPointImpl getListeningPoint(int port, String transport)
          Get the listening point for a given transport and port.
 Iterator getListeningPoints()
          Returns an Iterator of existing ListeningPoints created by this SipStackImpl.
 String getOutboundProxy()
          get the outbound proxy specification.
 boolean getRetransmissionFilter()
          This method returns the value of the retransmission filter helper function for User Agent Client and User Agent Server applications.
 Router getRouter()
          Gets the Router object that identifies the default Routing policy of this SipStack.
 Iterator getSipProviders()
          Returns an Iterator of existing peer SipProviders that have been created by this SipStackImpl.
 String getStackName()
          Gets the user friendly name that identifies this SipStack instance.
 void transactionErrorEvent(SIPTransactionErrorEvent transactionErrorEvent)
          Invoked when an error has ocurred with a transaction.
 
Methods inherited from class gov.nist.javax.sip.stack.SIPTransactionStack
addExtensionMethod, addTransaction, createClientTransaction, createDialog, createMessageChannel, createMessageChannel, createMessageChannel, createRawMessageChannel, createServerTransaction, findCancelTransaction, findTransaction, getDialog, isDialogCreated, putDialog
 
Methods inherited from class gov.nist.javax.sip.stack.SIPStack
addMessageProcessor, createMessageProcessor, exportServerLog, getBadMessageLog, getDefaultRoute, getDefaultRouteHeader, getHostAddress, getMessageProcessor, getMessageProcessors, getNextHop, getNextHop, getPort, getRouteHeader, getStackFunction, isAlive, isTransportEnabled, isTransportEnabled, logBadMessage, removeMessageProcessor, setHostAddress, setMaxConnections, setRouter, setSingleThreaded, setStackMessageFactory, setStackName, setThreadPoolSize, stopStack
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SipStackImpl

public SipStackImpl(Properties configurationProperties)
             throws PeerUnavailableException
Method Detail

createListeningPoint

public ListeningPoint createListeningPoint(int port,
                                           String transport)
                                    throws TransportNotSupportedException,
                                           InvalidArgumentException
Creates a new peer ListeningPoint on this SipStack on a specified host, port and transport and returns a reference to the newly created ListeningPoint object. The newly created ListeningPoint is implicitly attached to this SipStack upon execution of this method, by adding the ListeningPoint to the SipStack.getListeningPoints() of this SipStack, once it has been successfully created.

Specified by:
createListeningPoint in interface SipStack
Parameters:
port - - the port of the new ListeningPoint.
transport - - the transport of the new ListeningPoint.
Returns:
The peer ListeningPoint attached to this SipStack.
Throws:
InvalidArgumentException - if the specified port is invalid.
TransportNotSupportedException

createSipProvider

public SipProvider createSipProvider(ListeningPoint listeningPoint)
                              throws ObjectInUseException
Creates a new peer SipProvider on this SipStack on a specified ListeningPoint and returns a reference to the newly created SipProvider object. The newly created SipProvider is implicitly attached to this SipStack upon execution of this method, by adding the SipProvider to the SipStack.getSipProviders() of this SipStack, once it has been successfully created.

Specified by:
createSipProvider in interface SipStack
Parameters:
listeningPoint - - the ListeningPoint the SipProvider is to be attached to in order to send and receive messages.
Returns:
The peer SipProvider attached to this SipStack on the specified ListeningPoint.
Throws:
ListeningPointUnavailableException - thrown if another SipProvider is already using the ListeningPoint.
ObjectInUseException - if another SipProvider is already using the ListeningPoint.

deleteListeningPoint

public void deleteListeningPoint(ListeningPoint listeningPoint)
                          throws ObjectInUseException
Deletes the specified peer ListeningPoint attached to this SipStack. The specified ListeningPoint is implicitly detached from this SipStack upon execution of this method, by removing the ListeningPoint from the SipStack.getListeningPoints() of this SipStack.

Specified by:
deleteListeningPoint in interface SipStack
Parameters:
listeningPoint - - the SipProvider to be deleted from this SipStack.
Throws:
ObjectInUseException - thrown if the specified peer ListeningPoint cannot be deleted because the peer ListeningPoint is currently in use.
ObjectInUseException - if the specified ListeningPoint cannot be deleted because the ListeningPoint is currently in use.
Since:
v1.1

deleteSipProvider

public void deleteSipProvider(SipProvider sipProvider)
                       throws ObjectInUseException
Deletes the specified peer SipProvider attached to this SipStack. The specified SipProvider is implicitly detached from this SipStack upon execution of this method, by removing the SipProvider from the SipStack.getSipProviders() of this SipStack. Deletion of a SipProvider does not automatically delete the ListeningPoint from the SipStack.

Specified by:
deleteSipProvider in interface SipStack
Parameters:
sipProvider - - the peer SipProvider to be deleted from this SipStack.
Throws:
ObjectInUseException - thrown if the specified peer SipProvider cannot be deleted because the peer SipProvider is currently in use.
ObjectInUseException - if the specified SipProvider cannot be deleted because the SipProvider is currently in use.

getIPAddress

public String getIPAddress()
Gets the IP Address that identifies this SipStack instance. Every Sip Stack object must have an IP Address and only a single SipStack object can service a single IP Address. This value is set using the Properties object passed to the SipFactory.createSipStack(Properties) method upon creation of the SIP Stack object.

Specified by:
getIPAddress in interface SipStack
Returns:
a string identifing the IP Address
Since:
v1.1

getListeningPoints

public Iterator getListeningPoints()
Returns an Iterator of existing ListeningPoints created by this SipStackImpl. All of the peer SipProviders of this SipStack will be proprietary objects belonging to the same stack vendor.

Specified by:
getListeningPoints in interface SipStack
Returns:
an Iterator containing all existing peer ListeningPoints created by this SipStack. Returns an empty Iterator if no ListeningPoints exist.

getListeningPoint

public ListeningPointImpl getListeningPoint(int port,
                                            String transport)
Get the listening point for a given transport and port.


getOutboundProxy

public String getOutboundProxy()
get the outbound proxy specification. Return null if no outbound proxy is specified.


getRetransmissionFilter

public boolean getRetransmissionFilter()
This method returns the value of the retransmission filter helper function for User Agent Client and User Agent Server applications. This value is set using the Properties object passed to the SipFactory.createSipStack(Properties) method upon creation of the SIP Stack object.

The default value of the retransmission filter boolean is false. When retransmissions are handled by the SipProvider the application will not receive Timeout.RETRANSMIT notifications encapsulated in TimeoutEvent's. However an application will get notified when a the underlying transaction expired with Timeout.TRANSACTION notifications encapsulated in a TimeoutEvent.

Specified by:
getRetransmissionFilter in interface SipStack
Returns:
the value of the retransmission filter, true if the filter is set false otherwise.
Since:
v1.1

getRouter

public Router getRouter()
Gets the Router object that identifies the default Routing policy of this SipStack. It also provides means to set an outbound proxy. This value is set using the Properties object passed to the SipFactory.createSipStack(Properties) method upon creation of the SIP Stack object.

Specified by:
getRouter in interface SipStack
Overrides:
getRouter in class SIPStack
Returns:
a the Router object identifying the Router policy.
Since:
v1.1

getSipProviders

public Iterator getSipProviders()
Returns an Iterator of existing peer SipProviders that have been created by this SipStackImpl. All of the peer SipProviders of this SipStack will be proprietary objects belonging to the same stack vendor.

Specified by:
getSipProviders in interface SipStack
Returns:
an Iterator containing all existing peer SipProviders created by this SipStack. Returns an empty Iterator if no SipProviders exist.

getStackName

public String getStackName()
Gets the user friendly name that identifies this SipStack instance. This value is set using the Properties object passed to the SipFactory.createSipStack(Properties) method upon creation of the SIP Stack object.

Specified by:
getStackName in interface SipStack
Overrides:
getStackName in class SIPStack
Returns:
a string identifing the stack instance

transactionErrorEvent

public void transactionErrorEvent(SIPTransactionErrorEvent transactionErrorEvent)
Invoked when an error has ocurred with a transaction.

Specified by:
transactionErrorEvent in interface SIPTransactionEventListener
Parameters:
transactionErrorEvent - Error event.

NIST SIP Parser and Stack (v1.2) API

A product of the NIST/ITL Advanced Networking Technologies Division.
See conditions of use.
Get the latest distribution.
Submit a bug report or feature request.