Interface Session
- All Known Implementing Classes:
DefaultSession
public interface Session
The Interface Session.
Created: 2017. 6. 13.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionboolean
access()
Called when a session is first accessed by a request.void
complete()
Called when a session is last accessed by a request.<T> T
getAttribute
(String name) long
Returns the reason why the session was destroyed.getId()
long
int
void
Called by users to invalidate a session, or called by the access method as a request enters the session if the session has expired, or called by manager as a result of scavenger expiring session.boolean
isNew()
Returns true if a new session was created for the request.boolean
isValid()
Returns whether it is a valid session or not.removeAttribute
(String name) setAttribute
(String name, Object value) void
setMaxInactiveInterval
(int secs)
-
Method Details
-
getId
String getId() -
getAttribute
-
setAttribute
-
getAttributeNames
-
removeAttribute
-
getCreationTime
long getCreationTime() -
getLastAccessedTime
long getLastAccessedTime() -
getMaxInactiveInterval
int getMaxInactiveInterval() -
setMaxInactiveInterval
void setMaxInactiveInterval(int secs) -
invalidate
void invalidate()Called by users to invalidate a session, or called by the access method as a request enters the session if the session has expired, or called by manager as a result of scavenger expiring session. -
getDestroyedReason
Session.DestroyedReason getDestroyedReason()Returns the reason why the session was destroyed.- Returns:
- the destroyed reason
-
isValid
boolean isValid()Returns whether it is a valid session or not.- Returns:
- true if valid session, false otherwise
-
isNew
boolean isNew()Returns true if a new session was created for the request.- Returns:
- true if the server has created a session, but the client has not yet joined
-
access
boolean access()Called when a session is first accessed by a request. -
complete
void complete()Called when a session is last accessed by a request.
-