public Map<String, Object> getSipSessionAttributeMap() { return getAttributeMap(); } /*
public Object getAttribute(String name) { if(!isValid()) { throw new IllegalStateException("SipApplicationSession already invalidated !"); } return getAttributeMap().get(name); }
public Enumeration<String> getAttributeNames() { if(!isValid()) { throw new IllegalStateException("SipApplicationSession already invalidated !"); } Vector<String> names = new Vector<String>(getAttributeMap().keySet()); return names.elements(); }
/** * Perform internal processing required to activate this * session. */ public void activate() { // Notify ActivationListeners SipSessionEvent event = null; if(sipSessionAttributeMap != null) { Set<String> keySet = getAttributeMap().keySet(); for (String key : keySet) { Object attribute = getAttributeMap().get(key); if (attribute instanceof SipSessionActivationListener) { if (event == null) event = new SipSessionActivationEvent(this, SessionActivationNotificationCause.ACTIVATION); try { ((SipSessionActivationListener)attribute) .sessionDidActivate(event); } catch (Throwable t) { logger.error("SipSessionActivationListener threw exception", t); } } } } }
/** * Perform the internal processing required to passivate * this session. */ public void passivate() { // Notify ActivationListeners SipSessionEvent event = null; if(this.sipSessionAttributeMap != null) { Set<String> keySet = getAttributeMap().keySet(); for (String key : keySet) { Object attribute = getAttributeMap().get(key); if (attribute instanceof SipSessionActivationListener) { if (event == null) event = new SipSessionActivationEvent(this, SessionActivationNotificationCause.PASSIVATION); try { ((SipSessionActivationListener)attribute) .sessionWillPassivate(event); } catch (Throwable t) { logger.error("SipSessionActivationListener threw exception", t); } } } } }
Object value = getAttributeMap().get(name); this.getAttributeMap().remove(name);
Object oldValue = getAttributeMap().get(key); if (attribute != oldValue) { event = new SipSessionBindingEvent(this, key); Object previousValue = this.getAttributeMap().put(key, attribute);