@Override public boolean equals(Object obj) { if(obj instanceof MobicentsSipApplicationSession) { return ((MobicentsSipApplicationSession)obj).getKey().equals(getKey()); } return false; }
@Override public int hashCode() { return getKey().hashCode(); }
public boolean addSipSession(MobicentsSipSession mobicentsSipSession) { boolean wasNotPresent = this.sipSessions.add((SipSessionKey)mobicentsSipSession.getKey()); if(logger.isDebugEnabled() && wasNotPresent) { logger.debug("Added sip session " + mobicentsSipSession.getKey() + " to sip app session " + getKey()); } readyToInvalidate = false; return wasNotPresent; // sipSessionImpl.setSipApplicationSession(this); }
public boolean removeHttpSession(HttpSession httpSession) { if(httpSessions != null) { if(logger.isDebugEnabled()) { logger.debug("Trying to remove http session " + JvmRouteUtil.removeJvmRoute(httpSession.getId())); } boolean wasPresent = this.httpSessions.remove(JvmRouteUtil.removeJvmRoute(httpSession.getId())); if(logger.isDebugEnabled() && wasPresent) { logger.debug("Removed http session " + JvmRouteUtil.removeJvmRoute(httpSession.getId()) + " from sip app session " + getKey()); } return wasPresent; } return false; }
public boolean addHttpSession(HttpSession httpSession) { if(httpSessions == null) { httpSessions = new CopyOnWriteArraySet<String>(); } boolean wasNotPresent = this.httpSessions.add(JvmRouteUtil.removeJvmRoute(httpSession.getId())); if(logger.isDebugEnabled() && wasNotPresent) { logger.debug("Added http session " + JvmRouteUtil.removeJvmRoute(httpSession.getId()) + " to sip app session " + getKey()); } readyToInvalidate = false; // TODO: We assume that there is only one HTTP session in the app session. In this case // we are safe to only assign jvmRoute once here. When we support multiple http sessions // we will need something more sophisticated. String jvmRoute = JvmRouteUtil.extractJvmRoute(httpSession.getId()); if(jvmRoute != null) { if(logger.isDebugEnabled()) { logger.debug("JVM Route " + jvmRoute + " for just added http session " + JvmRouteUtil.removeJvmRoute(httpSession.getId())); } setJvmRoute(jvmRoute); } return wasNotPresent; }
logger.debug("Removed sip session " + key + " from sip app session " + getKey());