public abstract class Transaction extends java.lang.Object implements SipProviderListener, TimerListener
The changes of the internal status and the received messages are fired to the corrsponding transaction listener.
Modifier and Type | Field and Description |
---|---|
protected static int |
STATE_COMPLETED
State Completed - When sent/received a final response.
|
protected static int |
STATE_CONFIRMED
State Confirmed (used only by invite server transactions) - When received an ACK request.
|
protected static int |
STATE_IDLE
State Waiting (used only by server transactions) - When transaction is just created.
|
protected static int |
STATE_PROCEEDING
State Proceeding - When sent/received a provisional response.
|
protected static int |
STATE_TERMINATED
State Terminated - When the transaction is terminated.
|
protected static int |
STATE_TRYING
State Trying - When sent/received the request.
|
protected static int |
STATE_WAITING
State Waiting (used only by server transactions) - When the server transaction starts listening.
|
protected static int |
transaction_counter
Transactions counter
|
Modifier | Constructor and Description |
---|---|
protected |
Transaction(SipProvider sip_provider)
Costructs a new Transaction
|
Modifier and Type | Method and Description |
---|---|
protected void |
changeStatus(int newstatus)
Changes the internal status
|
SipMessage |
getRequestMessage()
Gets the Transaction request message
|
SipProvider |
getSipProvider()
Gets the SipProvider of this Transaction.
|
protected java.lang.String |
getStatus()
Gets the current transaction state.
|
protected static java.lang.String |
getStatus(int st)
Gets the transaction state.
|
TransactionId |
getTransactionId()
Gets the transaction identifier
|
java.lang.String |
getTransactionMethod()
Gets the Transaction method
|
ConnectionId |
getTransportConnId()
Gets the transaction connection id
|
boolean |
isCompleted()
Whether the transaction is in COMPLETED state, i.e. it has sent/received a final response.
|
boolean |
isProceeding()
Whether the transaction is in PROCEEDING state, i.e. it has sent/received a provisional response.
|
boolean |
isTerminated()
Whether the transaction is in TERMINATED state, i.e. it is terminated.
|
boolean |
isTrying()
Whether the transaction is in TRYING state, i.e. it has sent/received the request.
|
protected void |
log(LogLevel level,
java.lang.Exception e)
Adds the Exception to the log file.
|
protected void |
log(LogLevel level,
java.lang.String str)
Adds a new string to the default log.
|
void |
onReceivedMessage(SipProvider provider,
SipMessage msg)
Method derived from interface SipListener.
|
void |
onTimeout(Timer to)
Method derived from interface TimerListener.
|
protected boolean |
statusIs(int st)
Whether the internal status is equal to st
|
abstract void |
terminate()
Terminates the transaction.
|
protected static int transaction_counter
protected static final int STATE_IDLE
protected static final int STATE_WAITING
protected static final int STATE_TRYING
protected static final int STATE_PROCEEDING
protected static final int STATE_COMPLETED
protected static final int STATE_CONFIRMED
protected static final int STATE_TERMINATED
protected Transaction(SipProvider sip_provider)
protected static java.lang.String getStatus(int st)
protected void changeStatus(int newstatus)
protected boolean statusIs(int st)
protected java.lang.String getStatus()
public boolean isTrying()
public boolean isProceeding()
public boolean isCompleted()
public boolean isTerminated()
public SipProvider getSipProvider()
public SipMessage getRequestMessage()
public java.lang.String getTransactionMethod()
public TransactionId getTransactionId()
public ConnectionId getTransportConnId()
public void onReceivedMessage(SipProvider provider, SipMessage msg)
onReceivedMessage
in interface SipProviderListener
public void onTimeout(Timer to)
onTimeout
in interface TimerListener
to
- the timerpublic abstract void terminate()
protected void log(LogLevel level, java.lang.String str)
protected void log(LogLevel level, java.lang.Exception e)