001: /*
002: * Copyright 2000-2001,2004 The Apache Software Foundation.
003: *
004: * Licensed under the Apache License, Version 2.0 (the "License");
005: * you may not use this file except in compliance with the License.
006: * You may obtain a copy of the License at
007: *
008: * http://www.apache.org/licenses/LICENSE-2.0
009: *
010: * Unless required by applicable law or agreed to in writing, software
011: * distributed under the License is distributed on an "AS IS" BASIS,
012: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013: * See the License for the specific language governing permissions and
014: * limitations under the License.
015: */
016:
017: /*
018:
019: */
020:
021: package org.apache.wsrp4j.consumer;
022:
023: import java.util.Iterator;
024:
025: /**
026: * Interface for a consumer based group session.A group session
027: * is used to hold portlet session objects of portlet instances
028: * which belong to the same group of the same producer according to their
029: * portlet description.
030: *
031: * @author Stephan Laertz
032: * @author <a href='mailto:peter.fischer@de.ibm.com'>Peter Fischer</a>
033: **/
034: public interface GroupSession {
035:
036: /**
037: * Get the ID of the group this group session belongs to.
038: *
039: * @return The group ID
040: **/
041: public String getGroupID();
042:
043: /**
044: * Get the portlet session object which is identified with
045: * the givven instanceKey from the group session. If no portlet session
046: * with that instanceKey exists it depends of the implementation wether
047: * null or a newly created portlet session object is returned.
048: *
049: * @param instanceKey The key which identifies the portlet session object
050: *
051: * @return The portlet session with the given key
052: **/
053: public PortletSession getPortletSession(String instanceKey);
054:
055: /**
056: * Get all portlet session objects currently stored in the group session.
057: *
058: * @return Iterator with all portlet session objects in the group session.
059: **/
060: public Iterator getAllPortletSessions();
061:
062: /**
063: * Check if the group session holds a portlet session with the given key.
064: *
065: * @return True if the group session holds a protlet session with the given key;
066: * false otherwise
067: **/
068: public boolean existsPortletSession(String instanceKey);
069:
070: /**
071: * Set the ID of the group this group session belongs to.
072: *
073: * @param groupID ID of the group
074: **/
075: public void setGroupID(String groupID);
076:
077: /**
078: * Add a portlet session to this group session.
079: *
080: * @param portletSession The portlet session which should be
081: * added to this group session.
082: **/
083: public void addPortletSession(PortletSession portletSession);
084:
085: /**
086: * Remove the portlet session object with the given key from the
087: * group session. Subsequent calls of getPortletSession with the same
088: * key should either return null or a newly created object.
089: *
090: * @param instanceKey Key which identifies the portlet session object to be removed.
091: **/
092: public void removePortletSession(String instanceKey);
093:
094: /**
095: * Removes all portlet session objects from the group session. Consequently
096: * this methods can be used to clear the group session.
097: **/
098: public void removeAllPortletSessions();
099:
100: }
|