|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.shiro.session.ProxiedSession org.apache.shiro.session.mgt.ImmutableProxiedSession
public class ImmutableProxiedSession
Implementation of the Session
interface that proxies another Session
, but does not
allow any 'write' operations to the underlying session. It allows 'read' operations only.
Session
write operations are defined as follows. A call to any of these methods on this
proxy will immediately result in an InvalidSessionException
being thrown:
Session.setTimeout(long)
Session.touch()
Session.stop()
Session.setAttribute(key,value)
Session.removeAttribute(key)
Session
.
Field Summary |
---|
Fields inherited from class org.apache.shiro.session.ProxiedSession |
---|
delegate |
Constructor Summary | |
---|---|
ImmutableProxiedSession(Session target)
Constructs a new instance of this class proxying the specified Session . |
Method Summary | |
---|---|
Object |
removeAttribute(Object key)
Immediately throws an InvalidSessionException in all
cases because this proxy is immutable. |
void |
setAttribute(Object key,
Object value)
Immediately throws an InvalidSessionException in all
cases because this proxy is immutable. |
void |
setTimeout(long maxIdleTimeInMillis)
Immediately throws an InvalidSessionException in all
cases because this proxy is immutable. |
void |
stop()
Immediately throws an InvalidSessionException in all
cases because this proxy is immutable. |
protected void |
throwImmutableException()
Simply throws an InvalidSessionException indicating that this proxy is immutable. |
void |
touch()
Immediately throws an InvalidSessionException in all
cases because this proxy is immutable. |
Methods inherited from class org.apache.shiro.session.ProxiedSession |
---|
getAttribute, getAttributeKeys, getHost, getId, getLastAccessTime, getStartTimestamp, getTimeout |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ImmutableProxiedSession(Session target)
Session
.
target
- the target Session
to proxy.Method Detail |
---|
protected void throwImmutableException() throws InvalidSessionException
InvalidSessionException
indicating that this proxy is immutable. Used
only in the Session's 'write' methods documented in the top class-level JavaDoc.
InvalidSessionException
- in all cases - used by the Session 'write' method implementations.public void setTimeout(long maxIdleTimeInMillis) throws InvalidSessionException
throws
an InvalidSessionException
in all
cases because this proxy is immutable.
setTimeout
in interface Session
setTimeout
in class ProxiedSession
maxIdleTimeInMillis
- the time in milliseconds that the session may remain idle before expiring.
InvalidSessionException
- if the session has been stopped or expired prior to calling this method.public void touch() throws InvalidSessionException
throws
an InvalidSessionException
in all
cases because this proxy is immutable.
touch
in interface Session
touch
in class ProxiedSession
InvalidSessionException
- if this session has stopped or expired prior to calling this method.public void stop() throws InvalidSessionException
throws
an InvalidSessionException
in all
cases because this proxy is immutable.
stop
in interface Session
stop
in class ProxiedSession
InvalidSessionException
- if this session has stopped or expired prior to calling this method.public void setAttribute(Object key, Object value) throws InvalidSessionException
throws
an InvalidSessionException
in all
cases because this proxy is immutable.
setAttribute
in interface Session
setAttribute
in class ProxiedSession
key
- the name under which the value
object will be bound in this sessionvalue
- the object to bind in this session.
InvalidSessionException
- if this session has stopped or expired prior to calling
this method.public Object removeAttribute(Object key) throws InvalidSessionException
throws
an InvalidSessionException
in all
cases because this proxy is immutable.
removeAttribute
in interface Session
removeAttribute
in class ProxiedSession
key
- the name uniquely identifying the object to remove
null
if there was no object bound under the name
key
.
InvalidSessionException
- if this session has stopped or expired prior to calling
this method.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |