KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > cocoon > portal > wsrp > consumer > UserSessionImpl


1 /*
2  * Copyright 2005 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package org.apache.cocoon.portal.wsrp.consumer;
17
18 import java.util.Hashtable JavaDoc;
19
20 import org.apache.avalon.framework.logger.Logger;
21 import org.apache.wsrp4j.consumer.GroupSessionMgr;
22 import org.apache.wsrp4j.consumer.driver.GenericUserSessionImpl;
23 import org.apache.wsrp4j.exception.WSRPException;
24
25 /**
26  * Implements a simple consumer-based user session<br/>
27  *
28  * Note: Since most of this methods all only for the session handler,
29  * consider to make most of the methods package scoped.<br/>
30  *
31  * @author <a HREF="mailto:cziegeler@s-und-n.de">Carsten Ziegeler</a>
32  * @author <a HREF="mailto:malessandrini@s-und-n.de">Michel Alessandrini</a>
33  *
34  * @version $Id: UserSessionImpl.java 264755 2005-08-30 10:29:21Z cziegeler $
35  **/

36 public class UserSessionImpl extends GenericUserSessionImpl {
37
38     /** The logger */
39     protected final Logger logger;
40
41     /**
42      * Constructor <br/
43      *
44      * @param producerID
45      * @param userID
46      * @param markupURL
47      * @param logger
48      * @throws WSRPException
49      */

50     public UserSessionImpl(String JavaDoc producerID,
51                            String JavaDoc userID,
52                            String JavaDoc markupURL,
53                            Logger logger)
54     throws WSRPException {
55         super(producerID, userID, markupURL);
56         this.logger = logger;
57         this.setGroupSessionTable(new Hashtable JavaDoc());
58     }
59
60     /**
61      * Get the group session for this group ID<br/>
62      *
63      * @param groupID ID of the portlet application
64      * @return The a group session for the provided group ID or a new groupSession
65      **/

66     public GroupSessionMgr getGroupSession(String JavaDoc groupID) throws WSRPException {
67         GroupSessionMgr groupSession = null;
68         if (groupID != null) {
69             groupSession = (GroupSessionMgr)this.groupSessions.get(groupID);
70             if (groupSession == null) {
71                 groupSession = new GroupSessionImpl(groupID, this.getMarkupInterfaceURL(), this.logger);
72                 addGroupSession(groupSession);
73             }
74         }
75         return groupSession;
76     }
77 }
78
Popular Tags