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

gov.nist.javax.sip
Class SipStackImpl

java.lang.Object
  extended bygov.nist.javax.sip.stack.SIPTransactionStack
      extended bygov.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 SipStack ). 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:
1.2 $Revision: 1.55 $ $Date: 2006/11/16 16:17:11 $
Author:
M. Ranganathan

Field Summary
 
Fields inherited from class gov.nist.javax.sip.stack.SIPTransactionStack
BASE_TIMER_INTERVAL, CONNECTION_LINGER_TIME
 
Constructor Summary
SipStackImpl(Properties configurationProperties)
          Constructor for the stack.
 
Method Summary
 ListeningPoint createListeningPoint(int port, String transport)
          Deprecated.  
 ListeningPoint createListeningPoint(String address, int port, String transport)
          Creates a ListeningPoint a given IP address, port and transport.
 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 ListeningPoint attached to this SipStack.
 void deleteSipProvider(SipProvider sipProvider)
          Deletes the specified peer SipProvider attached to this SipStack.
 void finalize()
          Finalization -- stop the stack on finalization.
 String getIPAddress()
          Deprecated.  
 Iterator getListeningPoints()
          Returns an Iterator of existing ListeningPoints created by this SipStack.
 Iterator getSipProviders()
          Returns an Iterator of existing SipProviders that have been created by this SipStack.
 String getStackName()
          Gets the user friendly name that identifies this SipStack instance.
 boolean isRetransmissionFilterActive()
          Deprecated.  
 void start()
          This method initiates the active processing of the stack.
 void stop()
          This methods initiates the shutdown of the stack.
 
Methods inherited from class gov.nist.javax.sip.stack.SIPTransactionStack
addExtensionMethod, addTransaction, addTransaction, createClientTransaction, createDialog, createMessageChannel, createRawMessageChannel, createServerHeaderForStack, createServerTransaction, disableLogging, enableLogging, findCancelTransaction, findMergedTransaction, findPendingTransaction, findSubscribeTransaction, findTransaction, getAddressResolver, getDialog, getDialogs, getHostAddress, getLogWriter, getMaxMessageSize, getNetworkLayer, getNextHop, getRetransmissionAlertTransaction, getRouter, getRouter, getServerLog, getThreadAuditor, isAlive, isDialogCreated, isEventForked, isLoggingEnabled, mapTransaction, newSIPServerRequest, printDialogTable, putDialog, putPendingTransaction, removeDialog, removeFromMergeTable, removePendingTransaction, removeTransaction, setAddressResolver, setMaxConnections, setSingleThreaded, setStackName, setThreadPoolSize, stopStack, transactionErrorEvent
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.sip.SipStack
getRouter
 

Constructor Detail

SipStackImpl

public SipStackImpl(Properties configurationProperties)
             throws PeerUnavailableException
Constructor for the stack.

Parameters:
configurationProperties - -- stack configuration properties including NIST-specific extensions.
Throws:
PeerUnavailableException
Method Detail

createListeningPoint

public ListeningPoint createListeningPoint(String address,
                                           int port,
                                           String transport)
                                    throws TransportNotSupportedException,
                                           InvalidArgumentException
Description copied from interface: SipStack
Creates a ListeningPoint a given IP address, port and transport. If this method is used, the IP address of the stack is ignored and a listening point is created with the given parameters. This support is useful for multi-homed hosts which may have to listen at multiple IP addresses and have different dialogs for each IP address.

Specified by:
createListeningPoint in interface SipStack
Returns:
ListeningPoint that uses the IP address port and transport.
Throws:
InvalidArgumentException
TransportNotSupportedException

createSipProvider

public SipProvider createSipProvider(ListeningPoint listeningPoint)
                              throws ObjectInUseException
Description copied from interface: SipStack
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 SipListener upon execution of this method, by adding the SipProvider to the list of SipProviders of this SipStack once it has been successfully created.

Specified by:
createSipProvider in interface SipStack
Parameters:
listeningPoint - listening point for this SipProvider.
Returns:
the newly created SipProvider been started.
Throws:
ObjectInUseException - if another SipProvider is already associated with this ListeningPoint.

deleteListeningPoint

public void deleteListeningPoint(ListeningPoint listeningPoint)
                          throws ObjectInUseException
Description copied from interface: SipStack
Deletes the specified 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 ListeningPoints list of this SipStack.

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

deleteSipProvider

public void deleteSipProvider(SipProvider sipProvider)
                       throws ObjectInUseException
Description copied from interface: SipStack
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 SipProviders list of this SipStack. Deletion of a SipProvider does not automatically delete the SipProvider's ListeningPoint from the SipStack.

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

getIPAddress

public String getIPAddress()
Deprecated.  

Get the IP Address of the stack.

Specified by:
getIPAddress in interface SipStack
Returns:
a string identifing the IP Address. Null if there is no default IP address associated with the stack instance.
See Also:
SipStack.getIPAddress()

getListeningPoints

public Iterator getListeningPoints()
Description copied from interface: SipStack
Returns an Iterator of existing ListeningPoints created by this SipStack. All of the ListeningPoints of this SipStack belong to the same stack vendor.

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

isRetransmissionFilterActive

public boolean isRetransmissionFilterActive()
Deprecated.  

Return true if retransmission filter is active.

Specified by:
isRetransmissionFilterActive in interface SipStack
Returns:
the value of the retransmission filter, true if the filter is set, false otherwise.
See Also:
SipStack.isRetransmissionFilterActive()

getSipProviders

public Iterator getSipProviders()
Description copied from interface: SipStack
Returns an Iterator of existing SipProviders that have been created by this SipStack. All of the SipProviders of this SipStack will belong to the same stack vendor.

Specified by:
getSipProviders in interface SipStack
Returns:
the list of Providers attached to this Sipstack.

getStackName

public String getStackName()
Description copied from interface: SipStack
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 SipStack object.

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

finalize

public void finalize()
Finalization -- stop the stack on finalization. Exit the transaction scanner and release all resources.

See Also:
java.lang.Object#finalize()

createListeningPoint

public ListeningPoint createListeningPoint(int port,
                                           String transport)
                                    throws TransportNotSupportedException,
                                           InvalidArgumentException
Deprecated.  

This uses the default stack address to create a listening point.

Specified by:
createListeningPoint in interface SipStack
Parameters:
port - the port of the new ListeningPoint.
transport - the transport of the new ListeningPoint.
Returns:
the ListeningPoint attached to this SipStack.
Throws:
InvalidArgumentException - if the specified port is invalid.
TransportNotSupportedException
See Also:
SipStack.createListeningPoint(java.lang.String, int, java.lang.String)

stop

public void stop()
Description copied from interface: SipStack
This methods initiates the shutdown of the stack. The stack will terminate all ongoing transactions, without providing notificatin to the listener, close all listening points and release all resources associated with this stack. Note that this is a hard stop and should be used with care. The application may build graceful stop measures if needed, however the implementation is expected to immediately release any resources such as threads sockets and buffers that are allocated to this stack.

Specified by:
stop in interface SipStack

start

public void start()
           throws ProviderDoesNotExistException,
                  SipException
Description copied from interface: SipStack
This method initiates the active processing of the stack. This method is used to start the stack after the necessary SipProviders have been created. After calling this method, the stack can handle incoming requests and responses on the ListeningPoints associated to the SipProviders.

Specified by:
start in interface SipStack
Throws:
SipException - if the stack cannot be started due to some system level failure.
ProviderDoesNotExistException

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.