|
NIST SIP Parser and Stack (v1.2) API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--gov.nist.javax.sip.stack.MessageChannel | +--gov.nist.javax.sip.stack.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 | |
static int |
CALLING_STATE
CALLING State. |
static int |
COMPLETED_STATE
Completed state. |
static int |
CONFIRMED_STATE
Confirmed state. |
static int |
INITIAL_STATE
Initialized but no state assigned. |
static int |
PROCEEDING_STATE
Proceeding state. |
static int |
TERMINATED_STATE
Terminated state. |
static int |
TRYING_STATE
Trying state. |
Method Summary | |
void |
addEventListener(SIPTransactionEventListener newListener)
Adds a new event listener to this transaction. |
void |
close()
Close the encapsulated channel. |
boolean |
doesCancelMatchTransaction(gov.nist.javax.sip.message.SIPRequest requestToTest)
A method that can be used to test if an incoming request belongs to this transction. |
String |
getBranch()
Gets the current setting for the branch parameter of this transaction. |
String |
getBranchId()
Returns a unique branch identifer that identifies this transaction. |
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. |
gov.nist.javax.sip.message.SIPResponse |
getLastResponse()
Get the last response. |
MessageChannel |
getMessageChannel()
Returns the message channel used for transmitting/receiving messages for this transaction. |
gov.nist.javax.sip.message.SIPRequest |
getOriginalRequest()
Gets the request being handled by this transaction. |
String |
getPeerAddress()
Get the peer address of the machine that sent us this message. |
String |
getPeerName()
Get the name of the machine that sent us this message. |
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. |
SIPStack |
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. |
String |
getUser()
Get the user from the original request. |
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. |
Object |
getWrapper()
Get the wrapper. |
void |
handleException(SIPServerException ex)
Handle an exception. |
abstract boolean |
isMessagePartOfTransaction(gov.nist.javax.sip.message.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. |
void |
removeEventListener(SIPTransactionEventListener oldListener)
Removed an event listener from this transaction. |
abstract void |
sendMessage(gov.nist.javax.sip.message.SIPMessage messageToSend)
Process the message through the transaction and sends it to the SIP peer. |
void |
setBranch(String newBranch)
Sets the Via header branch parameter used to identify this transaction. |
void |
setDialog(DialogImpl dialog)
set the dialog object. |
void |
setOriginalRequest(gov.nist.javax.sip.message.SIPRequest newOriginalRequest)
Sets the request message that this transaction handles. |
void |
setRetransmitTimer(int retransmitTimer)
Sets the value of the retransmit timer to the newly supplied timer value. |
void |
setState(int newState)
Changes the state of this transaction. |
void |
setWrapper(Object wrapper)
Set the encapsulation object ptr. |
Methods inherited from class gov.nist.javax.sip.stack.MessageChannel |
getHostPort, getKey, getMessageProcessor, getPeerHostPort, getRawIpSourceAddress, getViaHostPort, logResponse, sendMessage |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int INITIAL_STATE
public static final int TRYING_STATE
public static final int CALLING_STATE
public static final int PROCEEDING_STATE
public static final int COMPLETED_STATE
public static final int CONFIRMED_STATE
public static final int TERMINATED_STATE
Method Detail |
public String getBranchId()
Transaction
getBranchId
in interface Transaction
public void setWrapper(Object wrapper)
public Object getWrapper()
public void setOriginalRequest(gov.nist.javax.sip.message.SIPRequest newOriginalRequest)
newOriginalRequest
- Request being handled.public gov.nist.javax.sip.message.SIPRequest getOriginalRequest()
public Request getRequest()
getRequest
in interface Transaction
public MessageChannel getMessageChannel()
public final void setBranch(String newBranch)
newBranch
- New string used as the branch
for this transaction.public final String getBranch()
public void setState(int newState)
newState
- New state of this transaction.public final TransactionState getState()
getState
in interface Transaction
public abstract boolean isMessagePartOfTransaction(gov.nist.javax.sip.message.SIPMessage messageToTest)
public String getHost()
MessageChannel
getHost
in class MessageChannel
public String getKey()
MessageChannel
getKey
in class MessageChannel
public int getPort()
MessageChannel
getPort
in class MessageChannel
public SIPStack getSIPStack()
MessageChannel
getSIPStack
in class MessageChannel
public String getPeerAddress()
MessageChannel
getPeerAddress
in class MessageChannel
public int getPeerPort()
MessageChannel
getPeerPort
in class MessageChannel
public String getPeerName()
MessageChannel
getPeerName
in class MessageChannel
public String getTransport()
MessageChannel
getTransport
in class MessageChannel
public boolean isReliable()
MessageChannel
isReliable
in class MessageChannel
public Via getViaHeader()
getViaHeader
in class MessageChannel
public void handleException(SIPServerException ex)
MessageChannel
handleException
in class MessageChannel
public abstract void sendMessage(gov.nist.javax.sip.message.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 Dialog getDialog()
getDialog
in interface Transaction
Dialog
public void setDialog(DialogImpl dialog)
dialog
- -- the dialog to set.public int getRetransmitTimer()
getRetransmitTimer
in interface Transaction
public String getViaHost()
getViaHost
in class MessageChannel
public String getUser()
public gov.nist.javax.sip.message.SIPResponse getLastResponse()
public Response getResponse()
public String getTransactionId()
public int getViaPort()
getViaPort
in class MessageChannel
public boolean doesCancelMatchTransaction(gov.nist.javax.sip.message.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
|
NIST SIP Parser and Stack (v1.2) API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |