|
NIST-SIP: The Reference Implementation for JAIN-SIP 1.2 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgov.nist.javax.sip.stack.SIPTransactionStack
public abstract class SIPTransactionStack
This is the sip stack. It is essentially a management interface. It manages the resources for the JAIN-SIP implementation. This is the structure that is wrapped by the SipStackImpl.
SipStackImpl
Field Summary | |
---|---|
static int |
BASE_TIMER_INTERVAL
|
static int |
CONNECTION_LINGER_TIME
|
boolean |
logStackTraceOnMessageSend
|
Method Summary | |
---|---|
void |
addExtensionMethod(String extensionMethod)
Add an extension method. |
void |
addTransaction(SIPClientTransaction clientTransaction)
Add a new client transaction to the set of existing transactions. |
void |
addTransaction(SIPServerTransaction serverTransaction)
Add a new server transaction to the set of existing transactions. |
String |
auditStack(Set activeCallIDs,
long leakedDialogTimer,
long leakedTransactionTimer)
Audits the SIP Stack for leaks |
boolean |
checkBranchId()
Flag that reqests checking of branch IDs on responses. |
SIPClientTransaction |
createClientTransaction(SIPRequest sipRequest,
MessageChannel encapsulatedMessageChannel)
Creates a client transaction that encapsulates a MessageChannel. |
SIPDialog |
createDialog(SIPClientTransaction transaction,
SIPResponse sipResponse)
Create a Dialog given a client tx and response. |
SIPDialog |
createDialog(SIPTransaction transaction)
Create a dialog and add this transaction to it. |
MessageChannel |
createMessageChannel(SIPRequest request,
MessageProcessor mp,
Hop nextHop)
Creates a client transaction to handle a new request. |
MessageChannel |
createRawMessageChannel(String sourceIpAddress,
int sourcePort,
Hop nextHop)
Creates a new MessageChannel for a given Hop. |
SIPServerTransaction |
createServerTransaction(MessageChannel encapsulatedMessageChannel)
Creates a server transaction that encapsulates a MessageChannel. |
void |
disableLogging()
For debugging -- allows you to disable logging or enable logging selectively. |
void |
enableLogging()
Globally enable message logging ( for debugging) |
SIPTransaction |
findCancelTransaction(SIPRequest cancelRequest,
boolean isServer)
Get the transaction to cancel. |
SIPServerTransaction |
findMergedTransaction(SIPRequest sipRequest)
See if there is a pending transaction with the same Merge ID as the Merge ID obtained from the SIP Request. |
SIPServerTransaction |
findPendingTransaction(SIPRequest requestReceived)
Finds a pending server transaction. |
SIPClientTransaction |
findSubscribeTransaction(SIPRequest notifyMessage,
ListeningPointImpl listeningPoint)
Find a matching client SUBSCRIBE to the incoming notify. |
SIPTransaction |
findTransaction(SIPMessage sipMessage,
boolean isServer)
Find the transaction corresponding to a given request. |
int |
getActiveClientTransactionCount()
Get the count of client transactions that is not in the completed or terminated state. |
AddressResolver |
getAddressResolver()
get the address resolver interface. |
int |
getClientTransactionTableSize()
Get the size of the client transaction table. |
SIPDialog |
getDialog(String dialogId)
Return the dialog for a given dialog ID. |
Collection<Dialog> |
getDialogs()
This method is slated for addition to the next spec revision. |
Collection<Dialog> |
getDialogs(DialogState state)
|
String |
getHostAddress()
Deprecated. |
Dialog |
getJoinDialog(JoinHeader joinHeader)
Get the Join Dialog from the stack. |
int |
getMaxMessageSize()
Maximum size of a single TCP message. |
NetworkLayer |
getNetworkLayer()
Return the network layer (i.e. the interface for socket creation or the socket factory for the stack). |
Hop |
getNextHop(SIPRequest sipRequest)
Get the default route string. |
int |
getReceiveUdpBufferSize()
Size of the receive UDP buffer. |
Dialog |
getReplacesDialog(ReplacesHeader replacesHeader)
Get the Replaced Dialog from the stack. |
SIPServerTransaction |
getRetransmissionAlertTransaction(String dialogId)
Retrieve a transaction from our table of transactions with pending retransmission alerts. |
Router |
getRouter()
|
Router |
getRouter(SIPRequest request)
Get the router algorithm. |
int |
getSendUdpBufferSize()
Size of the send UDP buffer. |
gov.nist.core.ServerLogger |
getServerLogger()
Server log is the place where we log messages for the signaling trace viewer. |
gov.nist.core.StackLogger |
getStackLogger()
Get the logger. |
gov.nist.core.ThreadAuditor |
getThreadAuditor()
get the thread auditor object |
Timer |
getTimer()
|
boolean |
isAlive()
return the status of the toExit flag. |
boolean |
isCancelClientTransactionChecked()
|
boolean |
isDialogCreated(String method)
Return true if extension is supported. |
boolean |
isEventForked(String ename)
Return true if a given event can result in a forked subscription. |
boolean |
isLoggingEnabled()
Return true if logging is enabled for this stack. |
boolean |
isLooseDialogValidation()
Delegate some dialog validation to the application. |
boolean |
isNon2XXAckPassedToListener()
|
boolean |
isRemoteTagReassignmentAllowed()
|
boolean |
isRfc2543Supported()
|
void |
mapTransaction(SIPServerTransaction transaction)
Map a Server transaction (possibly sending out a 100 if the server tx is an INVITE). |
ServerRequestInterface |
newSIPServerRequest(SIPRequest requestReceived,
MessageChannel requestMessageChannel)
Handles a new SIP request. |
SocketAddress |
obtainLocalAddress(InetAddress dst,
int dstPort,
InetAddress localAddress,
int localPort)
Creates and binds, if necessary, a socket connected to the specified destination address and port and then returns its local address. |
void |
printDialogTable()
Print the dialog table. |
void |
putDialog(SIPDialog dialog)
Put a dialog into the dialog table. |
void |
putInMergeTable(SIPServerTransaction sipTransaction,
SIPRequest sipRequest)
Put this into the merge request table. |
void |
putPendingTransaction(SIPServerTransaction tr)
Put a transaction in the pending transaction list. |
void |
removeDialog(SIPDialog dialog)
Remove the dialog from the dialog table. |
void |
removeDialog(String dialogId)
Remove the dialog given its dialog id. |
void |
removeFromMergeTable(SIPServerTransaction tr)
Remove a transaction from the merge table. |
void |
removePendingTransaction(SIPServerTransaction tr)
Remove a pending Server transaction from the stack. |
void |
removeTransaction(SIPTransaction sipTransaction)
Remove transaction. |
void |
setAddressResolver(AddressResolver addressResolver)
Set the address resolution interface |
void |
setLogRecordFactory(LogRecordFactory logRecordFactory)
Set the logger factory. |
void |
setLooseDialogValidation(boolean looseDialogValidation)
Set to true if you want to delegate some dialog validation to the application. |
void |
setMaxConnections(int nconnections)
Set the max # of simultaneously handled TCP connections. |
void |
setNon2XXAckPassedToListener(boolean passToListener)
|
void |
setReceiveUdpBufferSize(int receiveUdpBufferSize)
Size of the receive UDP buffer. |
void |
setSendUdpBufferSize(int sendUdpBufferSize)
Size of the send UDP buffer. |
void |
setSingleThreaded()
Set the flag that instructs the stack to only start a single thread for sequentially processing incoming udp messages (thus serializing the processing). |
void |
setStackLogger(gov.nist.core.StackLogger stackLogger)
|
void |
setStackName(String stackName)
Set the descriptive name of the stack. |
void |
setThreadPoolSize(int size)
Set the thread pool size for processing incoming UDP messages. |
void |
setTimer(Timer timer)
|
void |
stopStack()
Stop stack. |
void |
transactionErrorEvent(SIPTransactionErrorEvent transactionErrorEvent)
Invoked when an error has ocurred with a transaction. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int BASE_TIMER_INTERVAL
public static final int CONNECTION_LINGER_TIME
public boolean logStackTraceOnMessageSend
Method Detail |
---|
public SocketAddress obtainLocalAddress(InetAddress dst, int dstPort, InetAddress localAddress, int localPort) throws IOException
dst
- the destination address that the socket would need to connect
to.dstPort
- the port number that the connection would be established
with.localAddress
- the address that we would like to bind on
(null for the "any" address).localPort
- the port that we'd like our socket to bind to (0 for a
random port).
IOException
public void disableLogging()
public void enableLogging()
public void printDialogTable()
public SIPServerTransaction getRetransmissionAlertTransaction(String dialogId)
dialogId
-
public boolean isDialogCreated(String method)
public void addExtensionMethod(String extensionMethod)
extensionMethod
- -- extension method to support for dialog creationpublic void putDialog(SIPDialog dialog)
dialog
- -- dialog to put into the dialog table.public SIPDialog createDialog(SIPTransaction transaction)
transaction
- -- tx to add to the dialog.
public SIPDialog createDialog(SIPClientTransaction transaction, SIPResponse sipResponse)
transaction
- sipResponse
-
public void removeDialog(SIPDialog dialog)
dialog
- -- dialog to remove.public SIPDialog getDialog(String dialogId)
dialogId
- is the dialog id to check.public void removeDialog(String dialogId)
dialogId
- is the dialog Id to remove.public SIPClientTransaction findSubscribeTransaction(SIPRequest notifyMessage, ListeningPointImpl listeningPoint)
notifyMessage
-
public SIPTransaction findTransaction(SIPMessage sipMessage, boolean isServer)
sipMessage
- request for which to retrieve the transaction.isServer
- search the server transaction table if true.
public SIPTransaction findCancelTransaction(SIPRequest cancelRequest, boolean isServer)
public SIPServerTransaction findPendingTransaction(SIPRequest requestReceived)
requestReceived
-
public SIPServerTransaction findMergedTransaction(SIPRequest sipRequest)
public void removePendingTransaction(SIPServerTransaction tr)
tr
- -- pending transaction to remove.public void removeFromMergeTable(SIPServerTransaction tr)
tr
- -- the server transaction to remove from the merge table.public void putInMergeTable(SIPServerTransaction sipTransaction, SIPRequest sipRequest)
sipTransaction
- -- transaction to put into the merge table.public void mapTransaction(SIPServerTransaction transaction)
transaction
- -- the server transaction to map.public ServerRequestInterface newSIPServerRequest(SIPRequest requestReceived, MessageChannel requestMessageChannel)
requestReceived
- Request to handle.requestMessageChannel
- Channel that received message.
public MessageChannel createMessageChannel(SIPRequest request, MessageProcessor mp, Hop nextHop) throws IOException
nextHop
- Hop to create a channel to contact.
IOException
public SIPClientTransaction createClientTransaction(SIPRequest sipRequest, MessageChannel encapsulatedMessageChannel)
encapsulatedMessageChannel
- Message channel of the transport layer.public SIPServerTransaction createServerTransaction(MessageChannel encapsulatedMessageChannel)
encapsulatedMessageChannel
- Message channel of the transport layer.public int getClientTransactionTableSize()
public void addTransaction(SIPClientTransaction clientTransaction)
clientTransaction
- -- client transaction to add to the set.public void removeTransaction(SIPTransaction sipTransaction)
public void addTransaction(SIPServerTransaction serverTransaction) throws IOException
serverTransaction
- -- server transaction to add to the set.
IOException
public void transactionErrorEvent(SIPTransactionErrorEvent transactionErrorEvent)
transactionErrorEvent
in interface SIPTransactionEventListener
transactionErrorEvent
- Error event.public void stopStack()
public void putPendingTransaction(SIPServerTransaction tr)
public NetworkLayer getNetworkLayer()
public boolean isLoggingEnabled()
public gov.nist.core.StackLogger getStackLogger()
public gov.nist.core.ServerLogger getServerLogger()
public int getMaxMessageSize()
public void setSingleThreaded()
public void setThreadPoolSize(int size)
size
- -- the thread pool size.public void setMaxConnections(int nconnections)
nconnections
- -- the number of connections to handle.public Hop getNextHop(SIPRequest sipRequest) throws SipException
sipRequest
- is the request for which we want to compute the next hop.
SipException
public void setStackName(String stackName)
stackName
- -- descriptive name of the stack.public String getHostAddress()
public Router getRouter(SIPRequest request)
public Router getRouter()
public boolean isAlive()
public MessageChannel createRawMessageChannel(String sourceIpAddress, int sourcePort, Hop nextHop) throws UnknownHostException
sourceIpAddress
- - Ip address of the source of this message.sourcePort
- - source port of the message channel to be created.nextHop
- Hop to create a MessageChannel to.
UnknownHostException
- If the host in the Hop doesn't exist.public boolean isEventForked(String ename)
ename
- -- event name to check.public AddressResolver getAddressResolver()
public void setAddressResolver(AddressResolver addressResolver)
addressResolver
- -- the address resolver to set.public void setLogRecordFactory(LogRecordFactory logRecordFactory)
logRecordFactory
- -- the log record factory to set.public gov.nist.core.ThreadAuditor getThreadAuditor()
public String auditStack(Set activeCallIDs, long leakedDialogTimer, long leakedTransactionTimer)
public void setNon2XXAckPassedToListener(boolean passToListener)
public boolean isNon2XXAckPassedToListener()
public int getActiveClientTransactionCount()
public boolean isRfc2543Supported()
public boolean isCancelClientTransactionChecked()
public boolean isRemoteTagReassignmentAllowed()
public Collection<Dialog> getDialogs()
public Collection<Dialog> getDialogs(DialogState state)
public Dialog getReplacesDialog(ReplacesHeader replacesHeader)
replacesHeader
- -- the header that references the dialog being replaced.public Dialog getJoinDialog(JoinHeader joinHeader)
joinHeader
- -- the header that references the dialog being joined.public void setTimer(Timer timer)
timer
- the timer to setpublic Timer getTimer()
public boolean isLooseDialogValidation()
public void setLooseDialogValidation(boolean looseDialogValidation)
looseDialogValidation
- public int getReceiveUdpBufferSize()
public void setReceiveUdpBufferSize(int receiveUdpBufferSize)
public int getSendUdpBufferSize()
public void setSendUdpBufferSize(int sendUdpBufferSize)
public void setStackLogger(gov.nist.core.StackLogger stackLogger)
stackLogger
- the stackLogger to setpublic boolean checkBranchId()
|
NIST-SIP: The Reference Implementation for JAIN-SIP 1.2 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |