Interface ServerTransaction

  • All Superinterfaces:
    Serializable, javax.sip.ServerTransaction, Transaction, javax.sip.Transaction

    public interface ServerTransaction
    extends javax.sip.ServerTransaction, Transaction
    Experimental extension to the ServerTransaction interface.

    This version has the "stateful" flag, which defines whether the server transaction behaves statefully (no request retransmits are seen by the application) or statelessly (all request retransmits are seen by the application). The stack always creates a server transaction for new requests, but if the app instructs the server transaction to behave statelessly then it will be able to process every request retransmission as if it were a stateless proxy.

    Typically an app that wishes to behave statelessly would use this as follows:

     public void processRequest(RequestEvent event) {
       ServerTransaction txn = event.getServerTransaction();
     
       // Set stateless flag first time we see the transaction
       if (txn.isStateful()) txn.setStateful(false);
     
       // process request statelessly
       ...
     
     }
     
    Because the stateful flag is per-transaction, stateful and stateless apps can run using the same stack instance, eg. in a container.

    This version supports the per-transaction retransmission filter flag for INVITE transactions. Note if the stateful flag is disabled, then the INVITE transaction retransmission filter (See Transaction.setRetransmissionFilter(boolean) is automatically disabled.

    By default, server transactions are stateful, as this is the most common usage.

    • Method Detail

      • setStateful

        void setStateful​(boolean enabled)
        Set the stateful/stateless behaviour of this transaction.
        Parameters:
        enabled - if true, stateful behaviour is enabled (the default). If false, the transaction behaves statelessly, ie. the application must handle all retransmissions.
      • isStateful

        boolean isStateful()
        Get the value of the retransmission filter.
        Returns:
        true if enabled, false otherwise.