01: /**
02: * $Id: ProducerSessionInfo.java,v 1.1 2004/01/22 00:19:07 mjain Exp $
03: * Copyright 2003 Sun Microsystems, Inc. All
04: * rights reserved. Use of this product is subject
05: * to license terms. Federal Acquisitions:
06: * Commercial Software -- Government Users
07: * Subject to Standard License Terms and
08: * Conditions.
09: *
10: * Sun, Sun Microsystems, the Sun logo, and Sun ONE
11: * are trademarks or registered trademarks of Sun Microsystems,
12: * Inc. in the United States and other countries.
13: */package com.sun.portal.wsrp.consumer.markup.impl;
14:
15: import java.util.List;
16: import java.util.ArrayList;
17: import java.util.HashMap;
18: import java.util.Map;
19: import java.util.Collections;
20:
21: import com.sun.portal.wsrp.common.stubs.WSRP_v1_Markup_PortType;
22:
23: /**
24: * This class encapsulates session information
25: * for all requests for a user to a producer,
26: * that can share the same markup port.
27: * TODO - this class would implement SSOTokenListener
28: * so that it can call releaseSessions when user logs out.
29: */
30:
31: public class ProducerSessionInfo /*implements SSOTokenListener */{
32:
33: private String _producerId;
34: private String _groupId;
35: private Map _sessionIdMap;
36: private WSRP_v1_Markup_PortType _port;
37:
38: public ProducerSessionInfo(String producerId, String groupId,
39: WSRP_v1_Markup_PortType port) {
40:
41: _producerId = producerId;
42: _groupId = groupId;
43: _port = port;
44: _sessionIdMap = Collections.synchronizedMap(new HashMap());
45:
46: }
47:
48: public String getSessionId(String entityID) {
49: return (String) _sessionIdMap.get(entityID);
50: }
51:
52: // ignoring this expire stuff for now
53: public void setSessionId(String entityID, String sessionId) {
54: _sessionIdMap.put(entityID, sessionId);
55: }
56:
57: public void releaseSessionId(String entityID) {
58: _sessionIdMap.remove(entityID);
59:
60: }
61:
62: public void setMarkupPort(WSRP_v1_Markup_PortType newPort) {
63: _port = newPort;
64: }
65:
66: public WSRP_v1_Markup_PortType getMarkupPort() {
67: return _port;
68: }
69:
70: }
|