Package net.officefloor.web.session
Interface HttpSession
-
public interface HttpSessionHTTP session.- Author:
- Daniel Sagenschneider
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.io.SerializablegetAttribute(java.lang.String name)Obtains theObjectthat is bound to the name for thisHttpSession.java.util.Iterator<java.lang.String>getAttributeNames()Obtains anIteratorto the names of the boundObjectinstances.java.time.InstantgetCreationTime()Obtains the time thisHttpSessionwas created.java.time.InstantgetExpireTime()Obtains the time thisHttpSessionwill be expired should it be idle.HttpSessionAdministrationgetHttpSessionAdministration()Obtains theHttpSessionAdministrationto administer thisHttpSession.java.lang.StringgetSessionId()Obtains the session Id.java.lang.StringgetTokenName()Obtains the token name.booleanisNew()Indicates if this is a newHttpSession.voidremoveAttribute(java.lang.String name)Removes the boundObjectby the name from thisHttpSession.voidsetAttribute(java.lang.String name, java.io.Serializable object)Binds theObjectto the name within thisHttpSession.voidsetExpireTime(java.time.Instant expireTime)Specifies the time thisHttpSessionwill expire if idle.
-
-
-
Method Detail
-
getSessionId
java.lang.String getSessionId() throws InvalidatedSessionHttpExceptionObtains the session Id.- Returns:
- Session Id.
- Throws:
InvalidatedSessionHttpException- Indicating theHttpSessionis invalidated.
-
getTokenName
java.lang.String getTokenName()
Obtains the token name.
This is the name of the
HttpRequestCookiethat contains the session Id.- Returns:
- Token name.
-
isNew
boolean isNew() throws InvalidatedSessionHttpExceptionIndicates if this is a newHttpSession.- Returns:
trueif this is a newHttpSession.- Throws:
InvalidatedSessionHttpException- Indicating theHttpSessionis invalidated.
-
getCreationTime
java.time.Instant getCreationTime() throws InvalidatedSessionHttpExceptionObtains the time thisHttpSessionwas created.- Returns:
- Time this
HttpSessionwas created. - Throws:
InvalidatedSessionHttpException- Indicating theHttpSessionis invalidated.
-
getExpireTime
java.time.Instant getExpireTime() throws InvalidatedSessionHttpExceptionObtains the time thisHttpSessionwill be expired should it be idle.- Returns:
- Time this
HttpSessionwill be expired. - Throws:
InvalidatedSessionHttpException- Indicating theHttpSessionis invalidated.
-
setExpireTime
void setExpireTime(java.time.Instant expireTime) throws StoringSessionHttpException, InvalidatedSessionHttpExceptionSpecifies the time this
HttpSessionwill expire if idle.The
HttpSessionStoremay increment this time on further requests to keep theHttpSessionactive over a long conversation.- Parameters:
expireTime- Time to expire thisHttpSession.- Throws:
StoringSessionHttpException- Indicating theHttpSessionis currently being stored and can not be altered.InvalidatedSessionHttpException- Indicating theHttpSessionis invalidated.
-
getAttribute
java.io.Serializable getAttribute(java.lang.String name) throws InvalidatedSessionHttpExceptionObtains theObjectthat is bound to the name for thisHttpSession.- Parameters:
name- Name.- Returns:
Objectbound to the name ornullif noObjectbound by the name.- Throws:
InvalidatedSessionHttpException- Indicating theHttpSessionis invalidated.
-
getAttributeNames
java.util.Iterator<java.lang.String> getAttributeNames() throws InvalidatedSessionHttpExceptionObtains anIteratorto the names of the boundObjectinstances.- Returns:
Iteratorto the names of the boundObjectinstances.- Throws:
InvalidatedSessionHttpException- Indicating theHttpSessionis invalidated.
-
setAttribute
void setAttribute(java.lang.String name, java.io.Serializable object) throws StoringSessionHttpException, InvalidatedSessionHttpExceptionBinds theObjectto the name within thisHttpSession.- Parameters:
name- Name.object-Object. Must beSerializableas the attributes of thisHttpSessionmay be serialised to larger, cheaper memory stores or for clusteredHttpSessionmanagement sent over the network.- Throws:
StoringSessionHttpException- Indicating theHttpSessionis currently being stored and can not be altered.InvalidatedSessionHttpException- Indicating theHttpSessionis invalidated.
-
removeAttribute
void removeAttribute(java.lang.String name) throws StoringSessionHttpException, InvalidatedSessionHttpExceptionRemoves the boundObjectby the name from thisHttpSession.- Parameters:
name- Name of boundObjectto remove.- Throws:
StoringSessionHttpException- Indicating theHttpSessionis currently being stored and can not be altered.InvalidatedSessionHttpException- Indicating theHttpSessionis invalidated.
-
getHttpSessionAdministration
HttpSessionAdministration getHttpSessionAdministration()
Obtains theHttpSessionAdministrationto administer thisHttpSession.- Returns:
HttpSessionAdministrationto administer thisHttpSession.
-
-