Class ProxiedSession
java.lang.Object
org.apache.shiro.session.ProxiedSession
- All Implemented Interfaces:
Session
- Direct Known Subclasses:
ImmutableProxiedSession
Simple
Session implementation that immediately delegates all corresponding calls to an
underlying proxied session instance.
This class is mostly useful for framework subclassing to intercept certain Session calls
and perform additional logic.- Since:
- 0.9
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionProxiedSession(Session target) Constructs an instance that proxies the specifiedtarget. -
Method Summary
Modifier and TypeMethodDescriptiongetAttribute(Object key) Immediately delegates to the underlying proxied session.Immediately delegates to the underlying proxied session.getHost()Immediately delegates to the underlying proxied session.getId()Immediately delegates to the underlying proxied session.Immediately delegates to the underlying proxied session.Immediately delegates to the underlying proxied session.longImmediately delegates to the underlying proxied session.removeAttribute(Object key) Immediately delegates to the underlying proxied session.voidsetAttribute(Object key, Object value) Immediately delegates to the underlying proxied session.voidsetTimeout(long maxIdleTimeInMillis) Immediately delegates to the underlying proxied session.voidstop()Immediately delegates to the underlying proxied session.voidtouch()Immediately delegates to the underlying proxied session.
-
Field Details
-
delegate
-
-
Constructor Details
-
ProxiedSession
Constructs an instance that proxies the specifiedtarget. Subclasses may access this target via theprotected final 'delegate'attribute, i.e.this.delegate.- Parameters:
target- the specified targetSessionto proxy.
-
-
Method Details
-
getId
Immediately delegates to the underlying proxied session. -
getStartTimestamp
Immediately delegates to the underlying proxied session.- Specified by:
getStartTimestampin interfaceSession- Returns:
- The time the system created the session.
-
getLastAccessTime
Immediately delegates to the underlying proxied session.- Specified by:
getLastAccessTimein interfaceSession- Returns:
- The time the user last interacted with the system.
- See Also:
-
getTimeout
Immediately delegates to the underlying proxied session.- Specified by:
getTimeoutin interfaceSession- Returns:
- the time in milliseconds the session may remain idle before expiring.
- Throws:
InvalidSessionException- if the session has been stopped or expired prior to calling this method.
-
setTimeout
Immediately delegates to the underlying proxied session.- Specified by:
setTimeoutin interfaceSession- Parameters:
maxIdleTimeInMillis- the time in milliseconds that the session may remain idle before expiring.- Throws:
InvalidSessionException- if the session has been stopped or expired prior to calling this method.
-
getHost
-
touch
Immediately delegates to the underlying proxied session.- Specified by:
touchin interfaceSession- Throws:
InvalidSessionException- if this session has stopped or expired prior to calling this method.
-
stop
Immediately delegates to the underlying proxied session.- Specified by:
stopin interfaceSession- Throws:
InvalidSessionException- if this session has stopped or expired prior to calling this method.
-
getAttributeKeys
Immediately delegates to the underlying proxied session.- Specified by:
getAttributeKeysin interfaceSession- Returns:
- the keys of all attributes stored under this session, or an empty collection if there are no session attributes.
- Throws:
InvalidSessionException- if this session has stopped or expired prior to calling this method.
-
getAttribute
Immediately delegates to the underlying proxied session.- Specified by:
getAttributein interfaceSession- Parameters:
key- the unique name of the object bound to this session- Returns:
- the object bound under the specified
keyname ornullif there is no object bound under that name. - Throws:
InvalidSessionException- if this session has stopped or expired prior to calling this method.
-
setAttribute
Immediately delegates to the underlying proxied session.- Specified by:
setAttributein interfaceSession- Parameters:
key- the name under which thevalueobject will be bound in this sessionvalue- the object to bind in this session.- Throws:
InvalidSessionException- if this session has stopped or expired prior to calling this method.
-
removeAttribute
Immediately delegates to the underlying proxied session.- Specified by:
removeAttributein interfaceSession- Parameters:
key- the name uniquely identifying the object to remove- Returns:
- the object removed or
nullif there was no object bound under the namekey. - Throws:
InvalidSessionException- if this session has stopped or expired prior to calling this method.
-