001: /**
002: * $Id: ProducerSessionManager.java,v 1.4 2004/01/07 23:54:16 mjain Exp $
003: * Copyright 2003 Sun Microsystems, Inc. All
004: * rights reserved. Use of this product is subject
005: * to license terms. Federal Acquisitions:
006: * Commercial Software -- Government Users
007: * Subject to Standard License Terms and
008: * Conditions.
009: *
010: * Sun, Sun Microsystems, the Sun logo, and Sun ONE
011: * are trademarks or registered trademarks of Sun Microsystems,
012: * Inc. in the United States and other countries.
013: */package com.sun.portal.wsrp.consumer.markup;
014:
015: import com.sun.portal.container.ContainerRequest;
016: import com.sun.portal.container.ContainerException;
017: import com.sun.portal.container.ContentException;
018: import com.sun.portal.wsrp.common.stubs.SessionContext;
019: import com.sun.portal.wsrp.common.stubs.WSRP_v1_Markup_PortType;
020:
021: /**
022: * This interface has methods to manage the session and cookies
023: * with a WSRP Producer.
024: *
025: */
026: public interface ProducerSessionManager {
027:
028: /**
029: * This method processes the SessionContext sent by the producer
030: * as part of the response.
031: * Information in SessionContext must be stored so that it can be returned
032: * on following requests to maintain the session.
033: *
034: * @param markupConfig markup configuration object.
035: * @param request container request.
036: * @param sessionContext session context sent back as a response from the producer.
037: * @exception com.sun.portal.container.ContainerException
038: * @exception com.sun.portal.container.ContentException
039: */
040:
041: public void processSessionContext(MarkupConfig markupConfig,
042: ContainerRequest request, SessionContext sessionContext)
043: throws ContainerException, ContentException;
044:
045: /**
046: * Get the session id to be returned back to producer
047: * for this request
048: *
049: * @param markupConfig
050: * @param request
051: * @exception com.sun.portal.container.ContainerException
052: * @exception com.sun.portal.container.ContentException
053: */
054: public String getProducerSessionId(MarkupConfig markupConfig,
055: ContainerRequest request) throws ContainerException,
056: ContentException;
057:
058: /**
059: * Invalidate or remove the session explicitly.
060: *
061: * @param markupConfig
062: * @param request
063: * @exception com.sun.portal.container.ContainerException
064: * @exception com.sun.portal.container.ContentException
065: */
066: public void resetSessionId(String invalidSessionId,
067: MarkupConfig markupConfig, ContainerRequest request)
068: throws ContainerException, ContentException;
069:
070: /**
071: * Returns a markup porttype stub that can be used
072: * for calling remote markup methods. If initCookie
073: * requirement is on for this producer, this stub
074: * is ornamented with all the right cookies.
075: *
076: * @param markupConfig
077: * @param request
078: * @exception com.sun.portal.container.ContainerException
079: * @exception com.sun.portal.container.ContentException
080: */
081:
082: public WSRP_v1_Markup_PortType getMarkupPortType(
083: MarkupConfig markupConfig, ContainerRequest request)
084: throws ContainerException, ContentException;
085:
086: /**
087: * Clears the markup port type used, whenever caller
088: * finds invalid cookie setting on it.
089: *
090: * @param markupConfig
091: * @param request
092: * @exception com.sun.portal.container.ContainerException
093: * @exception com.sun.portal.container.ContentException
094: */
095: public void resetMarkupPortType(
096: WSRP_v1_Markup_PortType invalidPortType,
097: MarkupConfig markupConfig, ContainerRequest request)
098: throws ContainerException, ContentException;
099:
100: /**
101: * Returns the key that it is used to store the
102: * cookie jar in the session.
103: * We need to share this string with the proxy servlet
104: * that also might want to read or update the cookies
105: * when processing a url of type resource. ( Alejandro
106: * belives it this way. Personally I don't believe it.)
107: *
108: * @param markupConfig
109: * @param request
110: * @exception com.sun.portal.container.ContainerException
111: * @exception com.sun.portal.container.ContentException
112: */
113: public String getCookieHandleKey(MarkupConfig markupConfig,
114: ContainerRequest request) throws ContainerException;
115:
116: }
|