@SuppressWarnings(value="unchecked") public Iterator<?> getSessions() { if(!isValid()) { throw new IllegalStateException("SipApplicationSession already invalidated !"); } Set<MobicentsSipSession> sipSessions = getSipSessions(false); Set<HttpSession> httpSessions = getHttpSessions(); Set protocolSessions = new HashSet(); protocolSessions.addAll(httpSessions); protocolSessions.addAll(sipSessions); return protocolSessions.iterator(); }
public Iterator<?> getSessions(String protocol) { if(!isValid()) { throw new IllegalStateException("SipApplicationSession already invalidated !"); } if(protocol == null) { throw new NullPointerException("protocol given in argument is null"); } if("SIP".equalsIgnoreCase(protocol)) { return getSipSessions(false).iterator(); } else if("HTTP".equalsIgnoreCase(protocol)) { return getHttpSessions().iterator(); } else { throw new IllegalArgumentException(protocol + " sessions are not handled by this container"); } } // internal flag in parameter added for https://github.com/Mobicents/sip-servlets/issues/43 so that we return the facade object
private void updateReadyToInvalidateState() { if(isValidInternal() && !readyToInvalidate) { if(logger.isDebugEnabled()) { logger.debug("underlying sip sessions " + getSipSessions(true).size()); for(MobicentsSipSession sipSession : getSipSessions(true)) { if(logger.isDebugEnabled()) { logger.debug("Is Sip Session Key " + sipSession.getKey() + " ready to be invalidated, "
for(MobicentsSipSession sipSession : getSipSessions(true)) { if(sipSession.isValidInternal()) { allSipSessionsInvalidated = false;
for(MobicentsSipSession session: getSipSessions(true)) { if(session.isValidInternal()) { boolean lockSession = false;