Package com.vaadin.portlet
Class WrappedPortletSession
- java.lang.Object
-
- com.vaadin.portlet.WrappedPortletSession
-
- All Implemented Interfaces:
WrappedSession,Serializable
public class WrappedPortletSession extends Object implements WrappedSession
Wrapper forPortletSession.- Since:
- 7.0.0
- Author:
- Vaadin Ltd
- See Also:
WrappedSession, Serialized Form
-
-
Constructor Summary
Constructors Constructor Description WrappedPortletSession(javax.portlet.PortletSession session)Creates a new wrapped portlet session.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ObjectgetAttribute(String name)ObjectgetAttribute(String name, int scope)Returns the object bound with the specified name in this session, ornullif no object is bound under the name in the given scope.Set<String>getAttributeNames()Set<String>getAttributeNames(int scope)Gets the current set of attribute names bound to this session in the given scope.longgetCreationTime()StringgetId()longgetLastAccessedTime()intgetMaxInactiveInterval()javax.portlet.PortletSessiongetPortletSession()Gets the wrappedPortletSession.voidinvalidate()booleanisNew()voidremoveAttribute(String name)voidremoveAttribute(String name, int scope)Removes the object bound with the specified name and the given scope from this session.voidsetAttribute(String name, Object value)voidsetAttribute(String name, Object value, int scope)Binds an object to this session in the given scope, using the name specified.voidsetMaxInactiveInterval(int interval)
-
-
-
Method Detail
-
getMaxInactiveInterval
public int getMaxInactiveInterval()
- Specified by:
getMaxInactiveIntervalin interfaceWrappedSession
-
getAttribute
public Object getAttribute(String name)
- Specified by:
getAttributein interfaceWrappedSession
-
getAttribute
public Object getAttribute(String name, int scope)
Returns the object bound with the specified name in this session, ornullif no object is bound under the name in the given scope.- Parameters:
name- a string specifying the name of the objectscope- session scope of this attribute- Returns:
- the object with the specified name
- Throws:
IllegalStateException- if this method is called on an invalidated session, or the scope is unknown to the container.IllegalArgumentException- if name isnull.- Since:
- 7.6
- See Also:
PortletSession.getAttribute(String, int),PortletSession.PORTLET_SCOPE,PortletSession.APPLICATION_SCOPE
-
setAttribute
public void setAttribute(String name, Object value)
- Specified by:
setAttributein interfaceWrappedSession
-
setAttribute
public void setAttribute(String name, Object value, int scope)
Binds an object to this session in the given scope, using the name specified. If an object of the same name in this scope is already bound to the session, that object is replaced.If the value is
null, this has the same effect as callingremoveAttribute().- Parameters:
name- the name to which the object is bound; this cannot benull.value- the object to be boundscope- session scope of this attribute- Throws:
IllegalStateException- if this method is called on a session which has been invalidatedIllegalArgumentException- if name isnullor scope is unknown to the container.- Since:
- 7.6
- See Also:
PortletSession.setAttribute(String, Object, int),PortletSession.PORTLET_SCOPE,PortletSession.APPLICATION_SCOPE
-
getPortletSession
public javax.portlet.PortletSession getPortletSession()
Gets the wrappedPortletSession.- Returns:
- the wrapped portlet session
-
getAttributeNames
public Set<String> getAttributeNames()
- Specified by:
getAttributeNamesin interfaceWrappedSession
-
getAttributeNames
public Set<String> getAttributeNames(int scope)
Gets the current set of attribute names bound to this session in the given scope.- Parameters:
scope- session scope of the attribute names- Returns:
- an unmodifiable set of the current attribute names in the given scope
- Since:
- 7.6
- See Also:
PortletSession.getAttributeNames()
-
invalidate
public void invalidate()
- Specified by:
invalidatein interfaceWrappedSession
-
getId
public String getId()
- Specified by:
getIdin interfaceWrappedSession
-
getCreationTime
public long getCreationTime()
- Specified by:
getCreationTimein interfaceWrappedSession
-
getLastAccessedTime
public long getLastAccessedTime()
- Specified by:
getLastAccessedTimein interfaceWrappedSession
-
isNew
public boolean isNew()
- Specified by:
isNewin interfaceWrappedSession
-
removeAttribute
public void removeAttribute(String name)
- Specified by:
removeAttributein interfaceWrappedSession
-
removeAttribute
public void removeAttribute(String name, int scope)
Removes the object bound with the specified name and the given scope from this session. If the session does not have an object bound with the specified name, this method does nothing.- Parameters:
name- the name of the object to be removed from this sessionscope- session scope of this attribute- Throws:
IllegalStateException- if this method is called on a session which has been invalidatedIllegalArgumentException- if name isnull.- Since:
- 7.6
- See Also:
PortletSession.removeAttribute(String, int),PortletSession.PORTLET_SCOPE,PortletSession.APPLICATION_SCOPE
-
setMaxInactiveInterval
public void setMaxInactiveInterval(int interval)
- Specified by:
setMaxInactiveIntervalin interfaceWrappedSession
-
-