Package org.apache.wsrp4j.consumer

Examples of org.apache.wsrp4j.consumer.UserSessionMgr


   * @return The user session object representing a session between an end-user and
   *         a producer.
   **/
    public UserSessionMgr getUserSession(String producerID, String userID)
    throws WSRPException {
        UserSessionMgr userSession = null;

        if (producerID != null && userID != null) {
            String key = createKey(userID, producerID);
            userSession = (UserSessionMgr)this.userSessions.get(key);

View Full Code Here


        return this.portlet;
    }

    protected void resetInitCookie(String userID) throws WSRPException {

        UserSessionMgr userSession =
            this.consumerEnv.getSessionHandler().getUserSession(
                getPortlet().getPortletKey().getProducerId(),
                userID);

        if (initCookie.getValue().equalsIgnoreCase(CookieProtocol._none)) {

            userSession.setInitCookieDone(false);

        } else if (initCookie.getValue().equalsIgnoreCase(CookieProtocol._perGroup)) {

            PortletDescription portletDescription = null;
            try {

                portletDescription = producer.getPortletDescription(getPortlet().getParent());

            } catch (WSRPException e) {

                // do nothing since exception has been logged already

            }

            String groupID = null;
            if (portletDescription != null) {
                groupID = portletDescription.getGroupID();
            }

            if (groupID != null) {
                GroupSessionMgr groupSession = userSession.getGroupSession(groupID);
                groupSession.setInitCookieDone(false);
            }
        }
    }
View Full Code Here

            }
        }
    }

    protected void checkInitCookie(String userID) throws WSRPException {
        UserSessionMgr userSession =
            this.consumerEnv.getSessionHandler().getUserSession(
                getPortlet().getPortletKey().getProducerId(),
                userID);

        if (initCookie.getValue().equalsIgnoreCase(CookieProtocol._perUser)) {

            this.markupPort = userSession.getWSRPBaseService();

            if (!userSession.isInitCookieDone()) {

                userSession.setInitCookieRequired(true);
                initCookie();
                userSession.setInitCookieDone(true);
            }

        } else if (initCookie.getValue().equalsIgnoreCase(CookieProtocol._perGroup)) {

            PortletDescription portletDescription = producer.getPortletDescription(getPortlet().getParent());
            String groupID = null;
            if (portletDescription != null) {
                groupID = portletDescription.getGroupID();
            }

            if (groupID != null) {
                GroupSessionMgr groupSession = userSession.getGroupSession(groupID);

                this.markupPort = groupSession.getWSRPBaseService();

                if (!groupSession.isInitCookieDone()) {
                    groupSession.setInitCookieRequired(true);
                    initCookie();
                    groupSession.setInitCookieDone(true);
                }

            } else {
                // means either we have no service description from the producer containg the portlet
                // or the producer specified initCookieRequired perGroup but didn't provide
                // a groupID in the portlet description                            
            }
        } else {
            this.markupPort = userSession.getWSRPBaseService();
        }
       
    }
View Full Code Here

   * @return The user session object representing a session between an end-user and
   *         a producer.
   **/
    public UserSessionMgr getUserSession(String producerID, String userID)
    throws WSRPException {
        UserSessionMgr userSession = null;

        if (producerID != null && userID != null) {
            String key = createKey(userID, producerID);
            userSession = (UserSessionMgr)this.userSessions.get(key);

View Full Code Here

        return this.portlet;
    }

    protected void resetInitCookie(String userID) throws WSRPException {

        UserSessionMgr userSession =
            this.consumerEnv.getSessionHandler().getUserSession(
                getPortlet().getPortletKey().getProducerId(),
                userID);

        if (initCookie.getValue().equalsIgnoreCase(CookieProtocol._none)) {

            userSession.setInitCookieDone(false);

        } else if (initCookie.getValue().equalsIgnoreCase(CookieProtocol._perGroup)) {

            PortletDescription portletDescription = null;
            try {

                portletDescription = producer.getPortletDescription(getPortlet().getParent());

            } catch (WSRPException e) {

                // do nothing since exception has been logged already

            }

            String groupID = null;
            if (portletDescription != null) {
                groupID = portletDescription.getGroupID();
            }

            if (groupID != null) {
                GroupSessionMgr groupSession = userSession.getGroupSession(groupID);
                groupSession.setInitCookieDone(false);
            }
        }
    }
View Full Code Here

            }
        }
    }

    protected void checkInitCookie(String userID) throws WSRPException {
        UserSessionMgr userSession =
            this.consumerEnv.getSessionHandler().getUserSession(
                getPortlet().getPortletKey().getProducerId(),
                userID);

        if (initCookie.getValue().equalsIgnoreCase(CookieProtocol._perUser)) {

            this.markupPort = userSession.getWSRPBaseService();

            if (!userSession.isInitCookieDone()) {

                userSession.setInitCookieRequired(true);
                initCookie();
                userSession.setInitCookieDone(true);
            }

        } else if (initCookie.getValue().equalsIgnoreCase(CookieProtocol._perGroup)) {

            PortletDescription portletDescription = producer.getPortletDescription(getPortlet().getParent());
            String groupID = null;
            if (portletDescription != null) {
                groupID = portletDescription.getGroupID();
            }

            if (groupID != null) {
                GroupSessionMgr groupSession = userSession.getGroupSession(groupID);

                this.markupPort = groupSession.getWSRPBaseService();

                if (!groupSession.isInitCookieDone()) {
                    groupSession.setInitCookieRequired(true);
                    initCookie();
                    groupSession.setInitCookieDone(true);
                }

            } else {
                // means either we have no service description from the producer containg the portlet
                // or the producer specified initCookieRequired perGroup but didn't provide
                // a groupID in the portlet description                            
            }
        } else {
            this.markupPort = userSession.getWSRPBaseService();
        }
       
    }
View Full Code Here

TOP

Related Classes of org.apache.wsrp4j.consumer.UserSessionMgr

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.