org.apache.wsrp4j.consumer
Interface GroupSession

All Known Subinterfaces:
GroupSessionMgr
All Known Implementing Classes:
GenericGroupSessionImpl

public interface GroupSession

Interface for a consumer based group session.A group session is used to hold portlet session objects of portlet instances which belong to the same group of the same producer according to their portlet description.

Author:
Stephan Laertz, Peter Fischer

Method Summary
 void addPortletSession(PortletSession portletSession)
          Add a portlet session to this group session.
 boolean existsPortletSession(java.lang.String instanceKey)
          Check if the group session holds a portlet session with the given key.
 java.util.Iterator getAllPortletSessions()
          Get all portlet session objects currently stored in the group session.
 java.lang.String getGroupID()
          Get the ID of the group this group session belongs to.
 PortletSession getPortletSession(java.lang.String instanceKey)
          Get the portlet session object which is identified with the givven instanceKey from the group session.
 void removeAllPortletSessions()
          Removes all portlet session objects from the group session.
 void removePortletSession(java.lang.String instanceKey)
          Remove the portlet session object with the given key from the group session.
 void setGroupID(java.lang.String groupID)
          Set the ID of the group this group session belongs to.
 

Method Detail

getGroupID

public java.lang.String getGroupID()
Get the ID of the group this group session belongs to.

Returns:
The group ID

getPortletSession

public PortletSession getPortletSession(java.lang.String instanceKey)
Get the portlet session object which is identified with the givven instanceKey from the group session. If no portlet session with that instanceKey exists it depends of the implementation wether null or a newly created portlet session object is returned.

Parameters:
instanceKey - The key which identifies the portlet session object
Returns:
The portlet session with the given key

getAllPortletSessions

public java.util.Iterator getAllPortletSessions()
Get all portlet session objects currently stored in the group session.

Returns:
Iterator with all portlet session objects in the group session.

existsPortletSession

public boolean existsPortletSession(java.lang.String instanceKey)
Check if the group session holds a portlet session with the given key.

Returns:
True if the group session holds a protlet session with the given key; false otherwise

setGroupID

public void setGroupID(java.lang.String groupID)
Set the ID of the group this group session belongs to.

Parameters:
groupID - ID of the group

addPortletSession

public void addPortletSession(PortletSession portletSession)
Add a portlet session to this group session.

Parameters:
portletSession - The portlet session which should be added to this group session.

removePortletSession

public void removePortletSession(java.lang.String instanceKey)
Remove the portlet session object with the given key from the group session. Subsequent calls of getPortletSession with the same key should either return null or a newly created object.

Parameters:
instanceKey - Key which identifies the portlet session object to be removed.

removeAllPortletSessions

public void removeAllPortletSessions()
Removes all portlet session objects from the group session. Consequently this methods can be used to clear the group session.