public void setState(State state) { this.state = state; if(state == State.TERMINATED) { setReadyToInvalidate(true); } }
public void setReadyToInvalidateInternal(boolean readyToInvalidate) { super.setReadyToInvalidate(readyToInvalidate); }
@Override public void setReadyToInvalidate(boolean readyToInvalidate) { super.setReadyToInvalidate(readyToInvalidate); sessionMetadataDirty(); metaModifiedMap_.put(READY_TO_INVALIDATE, readyToInvalidate); }
/** * Add an ongoing tx to the session. */ public void addOngoingTransaction(Transaction transaction) { if(transaction != null && ongoingTransactions != null && !isReadyToInvalidate() ) { boolean added = this.ongoingTransactions.add(transaction); if(added) { if(logger.isDebugEnabled()) { logger.debug("transaction "+ transaction +" has been added to sip session's ongoingTransactions" ); } setReadyToInvalidate(false); } } }
private void updateReadyToInvalidate(Transaction transaction) { // Section 6.2.4.1.2 Invalidate When Ready Mechanism : // "The container determines the SipSession to be in the ready-to-invalidate state under any of the following conditions: // 3. A SipSession acting as a UAC transitions from the EARLY state back to // the INITIAL state on account of receiving a non-2xx final response (6.2.1 Relationship to SIP Dialogs, point 4) // and has not initiated any new requests (does not have any pending transactions)." if(logger.isDebugEnabled()) { if(ongoingTransactions != null) { logger.debug("ongoingTransactions " + ongoingTransactions.isEmpty() + " for sipsession " + key); } else { logger.debug("ongoingTransactions " + null + " for sipsession " + key); } } if(!readyToInvalidate && (ongoingTransactions == null || ongoingTransactions.isEmpty()) && transaction instanceof ClientTransaction && getProxy() == null && state != null && state.equals(State.INITIAL) && // Fix for Issue 1734 sessionCreatingTransactionRequest != null && sessionCreatingTransactionRequest.getLastFinalResponse() != null && sessionCreatingTransactionRequest.getLastFinalResponse().getStatus() >= 300) { setReadyToInvalidate(true); } }
/** * This method is called immediately when the conditions for read to invalidate * session are met */ public void onReadyToInvalidate() { this.setReadyToInvalidate(true); if(logger.isDebugEnabled()) { logger.debug("invalidateWhenReady flag is set to " + invalidateWhenReady); } if(isValid() && this.invalidateWhenReady) { this.notifySipSessionListeners(SipSessionEventType.READYTOINVALIDATE); //If the application does not explicitly invalidate the session in the callback or has not defined a listener, //the container will invalidate the session. if(isValid()) { invalidate(true); } } }
logger.debug("Setting SipSession " + getKey() + " for response " + response.getStatus() + " to a non dialog creating or terminating request " + method + " in state " + state + " to ReadyToInvalidate=true"); setReadyToInvalidate(true); setReadyToInvalidate(true);