|
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.MessageChannel
gov.nist.javax.sip.stack.SIPTransaction
public abstract class SIPTransaction
Abstract class to support both client and server transactions. Provides an encapsulation of a message channel, handles timer events, and creation of the Via header for a message.
Field Summary | |
---|---|
long |
auditTag
|
static TransactionState |
CALLING_STATE
CALLING State. |
static TransactionState |
COMPLETED_STATE
Completed state. |
static TransactionState |
CONFIRMED_STATE
Confirmed state. |
static TransactionState |
INITIAL_STATE
Initialized but no state assigned. |
static TransactionState |
PROCEEDING_STATE
Proceeding state. |
static TransactionState |
TERMINATED_STATE
Terminated state. |
static TransactionState |
TRYING_STATE
Trying state. |
Method Summary | |
---|---|
boolean |
acquireSem()
A given tx can process only a single outstanding event at a time. |
void |
addEventListener(SIPTransactionEventListener newListener)
Adds a new event listener to this transaction. |
void |
close()
Close the encapsulated channel. |
boolean |
doesCancelMatchTransaction(SIPRequest requestToTest)
A method that can be used to test if an incoming request belongs to this transction. |
Object |
getApplicationData()
Get the application data associated with this transaction. |
String |
getBranch()
Gets the current setting for the branch parameter of this transaction. |
String |
getBranchId()
Returns a unique branch identifer that identifies this transaction. |
long |
getCSeq()
Get the Sequence number of the request used to create the transaction. |
abstract Dialog |
getDialog()
Gets the dialog object of this Transaction object. |
String |
getHost()
Get the host of this message channel. |
String |
getKey()
Generate a key which identifies the message channel. |
SIPResponse |
getLastResponse()
Get the last response. |
MessageChannel |
getMessageChannel()
Returns the message channel used for transmitting/receiving messages for this transaction. |
MessageProcessor |
getMessageProcessor()
Get the message processor. |
String |
getMethod()
Get the method of the request used to create this transaction. |
SIPRequest |
getOriginalRequest()
Gets the request being handled by this transaction. |
String |
getPeerAddress()
Get the peer address of the machine that sent us this message. |
InetAddress |
getPeerPacketSourceAddress()
|
int |
getPeerPacketSourcePort()
|
int |
getPeerPort()
Get the sender port ( the port of the other end that sent me the message). |
int |
getPort()
Get port of this message channel. |
Request |
getRequest()
Get the original request but cast to a Request structure. |
Response |
getResponse()
Get the JAIN interface response |
int |
getRetransmitTimer()
Returns the current value of the retransmit timer in milliseconds used to retransmit messages over unreliable transports. |
SipProviderImpl |
getSipProvider()
Return the SipProvider for which the transaction is assigned. |
SIPTransactionStack |
getSIPStack()
Get the SIPStack object from this message channel. |
TransactionState |
getState()
Gets the current state of this transaction. |
String |
getTransactionId()
Get the transaction Id. |
String |
getTransport()
Get transport string of this message channel. |
Via |
getViaHeader()
Returns the Via header for this channel. |
String |
getViaHost()
Get the host to assign for an outgoing Request via header. |
int |
getViaPort()
Get the port to assign for the via header of an outgoing message. |
int |
hashCode()
Hashcode method for fast hashtable lookup. |
boolean |
isByeTransaction()
Return a flag that states if this is a BYE transaction. |
boolean |
isCancelTransaction()
Return true if the transaction corresponds to a CANCEL message. |
boolean |
isInviteTransaction()
Returns a flag stating whether this transaction is for an INVITE request or not. |
abstract boolean |
isMessagePartOfTransaction(SIPMessage messageToTest)
Tests a message to see if it is part of this transaction. |
boolean |
isReliable()
Get whether this channel is reliable or not. |
boolean |
isSecure()
Return true if this is a secure channel. |
boolean |
isTerminated()
Tests if this transaction has terminated. |
boolean |
passToListener()
Set true to pass the request up to the listener. |
void |
raiseIOExceptionEvent()
Raise an IO Exception event - this is used for reporting asynchronous IO Exceptions that are attributable to this transaction. |
void |
releaseSem()
Release the transaction semaphore. |
void |
removeEventListener(SIPTransactionEventListener oldListener)
Removed an event listener from this transaction. |
void |
sendMessage(SIPMessage messageToSend)
Process the message through the transaction and sends it to the SIP peer. |
void |
setApplicationData(Object applicationData)
Set the application data pointer. |
void |
setBranch(String newBranch)
Sets the Via header branch parameter used to identify this transaction. |
abstract void |
setDialog(SIPDialog sipDialog,
String dialogId)
set the dialog object. |
void |
setEncapsulatedChannel(MessageChannel messageChannel)
Set the encapsuated channel. |
void |
setOriginalRequest(SIPRequest newOriginalRequest)
Sets the request message that this transaction handles. |
void |
setPassToListener()
Set the passToListener flag to true. |
void |
setRetransmitTimer(int retransmitTimer)
Sets the value of the retransmit timer to the newly supplied timer value. |
void |
setState(TransactionState newState)
Changes the state of this transaction. |
Methods inherited from class gov.nist.javax.sip.stack.MessageChannel |
---|
getHostPort, getKey, getKey, getPeerHostPort, getRawIpSourceAddress, getViaHostPort, logResponse, sendMessage, sendMessage |
Methods inherited from class java.lang.Object |
---|
equals, getClass, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface javax.sip.Transaction |
---|
terminate |
Field Detail |
---|
public long auditTag
public static final TransactionState INITIAL_STATE
public static final TransactionState TRYING_STATE
public static final TransactionState CALLING_STATE
public static final TransactionState PROCEEDING_STATE
public static final TransactionState COMPLETED_STATE
public static final TransactionState CONFIRMED_STATE
public static final TransactionState TERMINATED_STATE
Method Detail |
---|
public String getBranchId()
Transaction
getBranchId
in interface Transaction
public void setOriginalRequest(SIPRequest newOriginalRequest)
newOriginalRequest
- Request being handled.public SIPRequest getOriginalRequest()
public Request getRequest()
getRequest
in interface Transaction
public final boolean isInviteTransaction()
public final boolean isCancelTransaction()
public final boolean isByeTransaction()
public MessageChannel getMessageChannel()
public final void setBranch(String newBranch)
newBranch
- New string used as the branch for this transaction.public final String getBranch()
public final String getMethod()
public final long getCSeq()
public void setState(TransactionState newState)
newState
- New state of this transaction.public TransactionState getState()
getState
in interface Transaction
public final boolean isTerminated()
public String getHost()
MessageChannel
getHost
in interface TransactionExt
getHost
in class MessageChannel
public String getKey()
MessageChannel
getKey
in class MessageChannel
public int getPort()
MessageChannel
getPort
in interface TransactionExt
getPort
in class MessageChannel
public SIPTransactionStack getSIPStack()
MessageChannel
getSIPStack
in class MessageChannel
public String getPeerAddress()
MessageChannel
getPeerAddress
in interface TransactionExt
getPeerAddress
in class MessageChannel
public int getPeerPort()
MessageChannel
getPeerPort
in interface TransactionExt
getPeerPort
in class MessageChannel
public int getPeerPacketSourcePort()
getPeerPacketSourcePort
in class MessageChannel
public InetAddress getPeerPacketSourceAddress()
getPeerPacketSourceAddress
in class MessageChannel
public String getTransport()
MessageChannel
getTransport
in interface TransactionExt
getTransport
in class MessageChannel
public boolean isReliable()
MessageChannel
isReliable
in class MessageChannel
public Via getViaHeader()
getViaHeader
in class MessageChannel
public void sendMessage(SIPMessage messageToSend) throws IOException
sendMessage
in class MessageChannel
messageToSend
- Message to send to the SIP peer.
IOException
public void addEventListener(SIPTransactionEventListener newListener)
newListener
- Listener to add.public void removeEventListener(SIPTransactionEventListener oldListener)
oldListener
- Listener to remove.public abstract Dialog getDialog()
getDialog
in interface Transaction
Dialog
public abstract void setDialog(SIPDialog sipDialog, String dialogId)
sipDialog
- --
the dialog to set.dialogId
- --
the dialog id ot associate with the dialog.spublic int getRetransmitTimer()
getRetransmitTimer
in interface Transaction
public String getViaHost()
getViaHost
in class MessageChannel
public SIPResponse getLastResponse()
public Response getResponse()
public String getTransactionId()
public int hashCode()
hashCode
in class Object
public int getViaPort()
getViaPort
in class MessageChannel
public boolean doesCancelMatchTransaction(SIPRequest requestToTest)
requestToTest
- is the request to test.
public void setRetransmitTimer(int retransmitTimer)
setRetransmitTimer
in interface Transaction
retransmitTimer
- -
the new integer value of the retransmit timer in milliseconds.public void close()
close
in class MessageChannel
public boolean isSecure()
MessageChannel
isSecure
in class MessageChannel
public MessageProcessor getMessageProcessor()
MessageChannel
getMessageProcessor
in class MessageChannel
public void setApplicationData(Object applicationData)
setApplicationData
in interface Transaction
applicationData
- --
application data pointer to set. null clears the applicationd
data pointer.public Object getApplicationData()
getApplicationData
in interface Transaction
public void setEncapsulatedChannel(MessageChannel messageChannel)
public SipProviderImpl getSipProvider()
getSipProvider
in interface TransactionExt
public void raiseIOExceptionEvent()
public boolean acquireSem()
public void releaseSem()
public boolean passToListener()
public void setPassToListener()
public abstract boolean isMessagePartOfTransaction(SIPMessage messageToTest)
|
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 |