@Override public long getLastAccessedTime() { assertIsValid(); return this.lastAccessedTime; }
@Override public long getCreationTime() { assertIsValid(); return this.creationTime; }
@Override public boolean isNew() { assertIsValid(); return this.isNew; }
@Override public Object getAttribute(String name) { assertIsValid(); Assert.notNull(name, "Attribute name must not be null"); return this.attributes.get(name); }
@Override public Enumeration<String> getAttributeNames() { assertIsValid(); return Collections.enumeration(new LinkedHashSet<>(this.attributes.keySet())); }
@Override public String[] getValueNames() { assertIsValid(); return StringUtils.toStringArray(this.attributes.keySet()); }
/** * Invalidates this session then unbinds any objects bound to it. * @throws IllegalStateException if this method is called on an already invalidated session */ @Override public void invalidate() { assertIsValid(); this.invalid = true; clearAttributes(); }
@Override public void removeAttribute(String name) { assertIsValid(); Assert.notNull(name, "Attribute name must not be null"); Object value = this.attributes.remove(name); if (value instanceof HttpSessionBindingListener) { ((HttpSessionBindingListener) value).valueUnbound(new HttpSessionBindingEvent(this, name, value)); } }
@Override public void setAttribute(String name, @Nullable Object value) { assertIsValid(); Assert.notNull(name, "Attribute name must not be null"); if (value != null) { Object oldValue = this.attributes.put(name, value); if (value != oldValue) { if (oldValue instanceof HttpSessionBindingListener) { ((HttpSessionBindingListener) oldValue).valueUnbound(new HttpSessionBindingEvent(this, name, oldValue)); } if (value instanceof HttpSessionBindingListener) { ((HttpSessionBindingListener) value).valueBound(new HttpSessionBindingEvent(this, name, value)); } } } else { removeAttribute(name); } }
@Override public long getLastAccessedTime() { assertIsValid(); return this.lastAccessedTime; }
@Override public boolean isNew() { assertIsValid(); return this.isNew; }
@Override public long getCreationTime() { assertIsValid(); return this.creationTime; }
@Override public Object getAttribute(String name) { assertIsValid(); Assert.notNull(name, "Attribute name must not be null"); return this.attributes.get(name); }
@Override public Object getAttribute(String name) { assertIsValid(); Assert.notNull(name, "Attribute name must not be null"); return this.attributes.get(name); }
@Override public Enumeration<String> getAttributeNames() { assertIsValid(); return Collections.enumeration(new LinkedHashSet<>(this.attributes.keySet())); }
@Override public Enumeration<String> getAttributeNames() { assertIsValid(); return Collections.enumeration(new LinkedHashSet<String>(this.attributes.keySet())); }
/** * Invalidates this session then unbinds any objects bound to it. * @throws IllegalStateException if this method is called on an already invalidated session */ @Override public void invalidate() { assertIsValid(); this.invalid = true; clearAttributes(); }
@Override public String[] getValueNames() { assertIsValid(); return StringUtils.toStringArray(this.attributes.keySet()); }
@Override public void removeAttribute(String name) { assertIsValid(); Assert.notNull(name, "Attribute name must not be null"); Object value = this.attributes.remove(name); if (value instanceof HttpSessionBindingListener) { ((HttpSessionBindingListener) value).valueUnbound(new HttpSessionBindingEvent(this, name, value)); } }
@Override public void removeAttribute(String name) { assertIsValid(); Assert.notNull(name, "Attribute name must not be null"); Object value = this.attributes.remove(name); if (value instanceof HttpSessionBindingListener) { ((HttpSessionBindingListener) value).valueUnbound(new HttpSessionBindingEvent(this, name, value)); } }