亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? portletsessionimpl.java

?? portal越來越流行了
?? JAVA
字號:
/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.apache.pluto.internal.impl;

import java.util.ArrayList;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Vector;

import javax.portlet.PortletContext;
import javax.portlet.PortletSession;
import javax.portlet.PortletSessionUtil;
import javax.servlet.http.HttpSession;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.pluto.PortletWindow;
import org.apache.pluto.internal.InternalPortletSession;
import org.apache.pluto.util.ArgumentUtility;

/**
 * Implementation of the <code>javax.portlet.PortletSession</code> interface.
 * 
 */
public class PortletSessionImpl implements InternalPortletSession {
	
	/** Logger. */
    private static final Log LOG = LogFactory.getLog(PortletSessionImpl.class);
    
    /** The default scope (<code>PORTLET_SCOPE</code>) for storing objects. */
    protected static final int DEFAULT_SCOPE = PortletSession.PORTLET_SCOPE;
    
    /** The portlet scope namespace as defined in PLT. 15.3. */
    protected static final String PORTLET_SCOPE_NAMESPACE = "javax.portlet.p.";
    
    /** The portlet window ID / attribute name separator as defined in PLT. 15.3. */
    protected static final char ID_NAME_SEPARATOR = '?';

    
    // Private Member Variables ------------------------------------------------
    
    /** The wrapped HttpSession object. */
    private HttpSession httpSession;
    
    /** The portlet context. */
    private PortletContext portletContext;
    
    /** The portlet window. */
    private PortletWindow portletWindow;
    
    // Constructor -------------------------------------------------------------
    
    /**
     * Constructs an instance.
     */
    public PortletSessionImpl(PortletContext portletContext,
                              PortletWindow portletWindow,
                              HttpSession httpSession) {
        this.portletContext = portletContext;
        this.portletWindow = portletWindow;
        this.httpSession = httpSession;
    }
    
    // InternalPortletSession Impl -----------------------------------------
    
    public HttpSession getHttpSession()
    {
        return httpSession;
    }
    
    // PortletSession Impl: Attributes -----------------------------------------
    
    public Object getAttribute(String name) {
        return getAttribute(name, DEFAULT_SCOPE);
    }
    
    /**
     * Returns the attribute of the specified name under the given scope.
     * 
     * @param name  the attribute name.
     * @param scope  the scope under which the attribute object is stored.
     * @return the attribute object.
     */
    public Object getAttribute(String name, int scope) {
    	ArgumentUtility.validateNotNull("attributeName", name);
    	String key = (scope == PortletSession.APPLICATION_SCOPE)
    			? name : createPortletScopedId(name);
    	return httpSession.getAttribute(key);
    }
    
    public Enumeration getAttributeNames() {
        return getAttributeNames(DEFAULT_SCOPE);
    }
    
    public Enumeration<String> getAttributeNames(int scope) {
    	// Return all attribute names in the nested HttpSession object.
        if (scope == PortletSession.APPLICATION_SCOPE) {
            return httpSession.getAttributeNames();
        }
        // Return attribute names with the portlet-scoped prefix.
        Vector<String> portletScopedNames = new Vector<String>();
        for (Enumeration<String> en = httpSession.getAttributeNames();
        en.hasMoreElements(); ) {
        	String name = en.nextElement();
        	if (isInCurrentPortletScope(name)) {
        		portletScopedNames.add(
        				PortletSessionUtil.decodeAttributeName(name));
        	}
        }
        return portletScopedNames.elements();
        
    }
    
    public void removeAttribute(String name) {
        removeAttribute(name, DEFAULT_SCOPE);
    }

    public void removeAttribute(String name, int scope) {
    	ArgumentUtility.validateNotNull("attributeName", name);
    	if (scope == PortletSession.APPLICATION_SCOPE) {
    		httpSession.removeAttribute(name);
    	} else {
    		httpSession.removeAttribute(createPortletScopedId(name));
    	}
    }
    
    public void setAttribute(String name, Object value) {
    	setAttribute(name, value, DEFAULT_SCOPE);
    }

    public void setAttribute(String name, Object value, int scope) {
    	ArgumentUtility.validateNotNull("attributeName", name);
    	if (scope == PortletSession.APPLICATION_SCOPE) {
    		httpSession.setAttribute(name, value);
    	} else {
    		httpSession.setAttribute(createPortletScopedId(name),  value);
    	}
    }

    
    // PortletSession Impl: Other Methods --------------------------------------
    
    public PortletContext getPortletContext() {
        return portletContext;
    }

    public long getCreationTime() {
        return httpSession.getCreationTime();
    }

    public String getId() {
        return httpSession.getId();
    }

    public long getLastAccessedTime() {
        return httpSession.getLastAccessedTime();
    }

    public int getMaxInactiveInterval() {
        return httpSession.getMaxInactiveInterval();
    }

    public void invalidate(){
        httpSession.invalidate();
    }

    public boolean isNew(){
        return httpSession.isNew();
    }
    
    /**
     * Specifies the time, in seconds, between client requests, before the
     * portlet container invalidates this session. A negative time indicates
     * the session should never timeout.
     * <p>
     * [Portlet Spec. PLT. 15.4.] If the PortletSession object is invalidated
     * by a portlet, the portlet container must invalidate the associated
     * HttpSession object.
     * </p>
     * @param interval  an integer specifying the number of seconds.
     */ 
    public void setMaxInactiveInterval(int interval) {
        httpSession.setMaxInactiveInterval(interval);
        if (LOG.isDebugEnabled()) {
            LOG.debug("Session timeout set to: " + interval);
        }
    }
    
    
    // Private Methods ---------------------------------------------------------
    
    /**
     * Creates portlet-scoped ID for the specified attribute name.
     * Portlet-scoped ID for a given attribute name has the following form:
     * <code>javax.portlet.p.&lt;ID&gt;?&lt;name&gt;</code>
     * where <code>ID</code> is a unique identification for the portlet window
     * (assigned by the portal/portlet-container) that must not contain a '?'
     * character. <code>name</code> is the attribute name.
     * <p>
     * Refer to Portlet Specification PLT. 15.3 for more details.
     * </p>
     * @param name  the attribute name.
     * @return portlet-scoped ID for the attribute name.
     */
    protected String createPortletScopedId(String name) {
    	StringBuffer buffer = new StringBuffer();
    	buffer.append(PORTLET_SCOPE_NAMESPACE);
    	buffer.append(portletWindow.getId().getStringId());
    	buffer.append(ID_NAME_SEPARATOR);
    	buffer.append(name);
    	return buffer.toString();
    }
    
    /**
     * Checks if the attribute name in APPLICATION_SCOPE is in the current
     * portlet scope. 
     * @param name  the attribute name to check.
     * @return true if the attribute name is in the current portlet scope.
     * @see #createPortletScopedId(String)
     */
    protected boolean isInCurrentPortletScope(String name) {
    	// Portlet-scoped attribute names MUST start with "javax.portlet.p.",
    	//   and contain the ID-name separator '?'.
    	if (name.startsWith(PORTLET_SCOPE_NAMESPACE)
    			&& name.indexOf(ID_NAME_SEPARATOR) > -1) {
        	String id = name.substring(PORTLET_SCOPE_NAMESPACE.length(),
        	                           name.indexOf(ID_NAME_SEPARATOR));
        	return (id.equals(portletWindow.getId().getStringId()));
        }
    	// Application-scoped attribute names are not in portlet scope.
    	else {
        	return false;
        }
    }
    
    
    // HttpSession Impl --------------------------------------------------------
    
	public Map<String, Object> getMap() {
		List<String> paramNames = getAttributeNamesAsList(DEFAULT_SCOPE);		
		return fillMap(paramNames, DEFAULT_SCOPE);	
	}

	public Map<String, Object> getMap(int scope) {
		List<String> paramNames = getAttributeNamesAsList(scope);		
		return fillMap(paramNames, scope);
	}
    
// ***** private methods *****

	/**
	 * transforms the getAttributeNames enumeration to a list
	 * @return list of getAttributeNames
	 */
	private List<String> getAttributeNamesAsList(int scope) {
		//transform Enum to List
		List<String> paramNames = new ArrayList<String>();
		Enumeration<String> e = getAttributeNames(scope);
		while (e.hasMoreElements()){
			paramNames.add(e.nextElement());
		}
		return paramNames;
	}
	
	/**
	 * @param paramNames list of the attribute names to be filled in the map
	 * @return the filled map
	 */
	private Map<String, Object> fillMap(List<String> paramNames, int scope) {
		Map<String, Object> resultMap = new HashMap<String, Object>();
		for (String string : paramNames) {
			resultMap.put(string, getAttribute(string,scope));
		}
		return resultMap;
	}

	/** 
	   * Returns a <code>Map</code> of the session attributes in
	   * the portlet session scope.
	   * <p>
	   * The keys are of type <code>String</code> and the values in the 
	   * returned <code>Map</code> are from type <code>Object</code>.
	   * <p>
	   * If no session attributes exist this method returns an empty <code>Map</code>.
	   *
	   * @return     an immutable <code>Map</code> containing the session attributes in the  
	   *             portlet session scope as keys and attribute values as map values, or an empty <code>Map</code>
	   *             if no session attributes exist. The keys in the
	   *             map are of type String, the values of type
	   *             Object.
	   *  @since 2.0
	   */
	  public Map<String, Object> getAttributeMap(int scope){
		  return getMap(scope); 
	  }
	  /** 
	   * Returns a <code>Map</code> of the session attributes in
	   * the portlet session scope.
	   * <p>
	   * The keys are of type <code>String</code> and the values in the 
	   * returned <code>Map</code> are from type <code>Object</code>.
	   * <p>
	   * If no session attributes exist this method returns an empty <code>Map</code>.
	   *
	   * @return     an immutable <code>Map</code> containing the session attributes in the  
	   *             portlet session scope as keys and attribute values as map values, or an empty <code>Map</code>
	   *             if no session attributes exist. The keys in the
	   *             map are of type String, the values of type
	   *             Object.
	   *  @since 2.0
	   */
	  public Map<String, Object> getAttributeMap(){
		  return getMap();
	  }
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
麻豆精品精品国产自在97香蕉 | 美女精品自拍一二三四| 欧美性受xxxx黑人xyx| 亚洲国产一区二区在线播放| 国产精品理论在线观看| 26uuu国产电影一区二区| 久久激情五月激情| 亚洲自拍另类综合| 日韩毛片精品高清免费| 国产精品影音先锋| 国产suv一区二区三区88区| 韩国精品一区二区| 久久亚洲综合色一区二区三区| 国产农村妇女毛片精品久久麻豆| 国产成人亚洲综合a∨婷婷图片| 美女任你摸久久| 91网站最新网址| 久久se这里有精品| 99久久精品国产一区二区三区| 亚洲欧美偷拍另类a∨色屁股| 亚洲一区二区高清| 国产剧情在线观看一区二区 | 欧美大片免费久久精品三p| 精品国产一区久久| 国产欧美一区二区三区在线看蜜臀 | 欧美r级电影在线观看| 国产日韩欧美一区二区三区乱码| 国产精品久线观看视频| 亚洲网友自拍偷拍| www.久久久久久久久| 欧美精品色综合| 中文字幕日韩精品一区| 久久99国内精品| 欧美伦理视频网站| 亚洲午夜久久久久久久久电影网 | 国产 欧美在线| 国产日韩综合av| 国产在线视频一区二区三区| 亚洲18女电影在线观看| 91福利视频网站| 国产一区二区主播在线| 欧美在线视频你懂得| 精品国产一区二区三区av性色 | 美女看a上一区| 在线视频一区二区三区| 日韩欧美高清dvd碟片| 最近日韩中文字幕| 成人丝袜18视频在线观看| 久久福利资源站| 日韩精品一区二区三区视频播放 | 欧美一区二区三区男人的天堂| 国产精品国产三级国产普通话蜜臀 | 亚洲图片欧美综合| 欧美亚洲国产bt| 日韩精品一区第一页| 在线综合+亚洲+欧美中文字幕| 国内久久精品视频| 中文字幕一区二区视频| 欧美日韩国产一级二级| 国产69精品一区二区亚洲孕妇| 日本丶国产丶欧美色综合| 一区二区三区蜜桃| 91一区二区在线| 婷婷中文字幕综合| 欧美一区二区三区白人| 美女视频网站久久| 国产欧美日韩视频一区二区| jlzzjlzz欧美大全| 亚洲午夜激情av| 久久久久国产精品免费免费搜索| 国产麻豆精品95视频| 亚洲一区二区三区免费视频| 337p亚洲精品色噜噜噜| 国产乱妇无码大片在线观看| 亚洲伦理在线免费看| 欧美情侣在线播放| 亚洲人成精品久久久久| 欧美一激情一区二区三区| 成人福利视频在线看| 亚洲无线码一区二区三区| 狠狠久久亚洲欧美| 亚洲人精品午夜| 91精品久久久久久久久99蜜臂| 国产在线观看一区二区| 中文字幕第一区二区| 欧美日本免费一区二区三区| 国产精品亚洲人在线观看| 亚洲大尺度视频在线观看| 亚洲日本va在线观看| 国产夜色精品一区二区av| 欧美巨大另类极品videosbest| 成人网在线免费视频| 成人动漫一区二区在线| 韩国欧美国产一区| 精品午夜一区二区三区在线观看| 免费成人性网站| 国产乱码字幕精品高清av| 精品夜夜嗨av一区二区三区| 韩国成人福利片在线播放| 日韩中文字幕一区二区三区| 亚洲成人www| 国产成人精品网址| 色94色欧美sute亚洲线路二 | 日韩亚洲欧美一区二区三区| 91精品国产综合久久精品图片| 精品国产1区2区3区| 日韩毛片在线免费观看| 亚洲成av人片一区二区| 亚洲欧洲精品一区二区三区| 亚洲一区二区三区四区中文字幕| 国产精品久久久久影院亚瑟| 国产精品久久久久久久浪潮网站 | 一区二区高清免费观看影视大全| 亚洲欧美日韩国产另类专区 | 91麻豆精品国产91| 精品免费视频一区二区| 久久午夜电影网| 亚洲精品视频自拍| 国模娜娜一区二区三区| 久久综合久久综合亚洲| 亚洲精品国产无天堂网2021 | 亚洲成人免费电影| 欧美人牲a欧美精品| 欧美va亚洲va| 伊人婷婷欧美激情| 国产成人精品免费看| 欧美丝袜自拍制服另类| 欧美变态tickle挠乳网站| 99久久精品久久久久久清纯| 欧美一区二区三区日韩| 国产精品国产三级国产aⅴ中文| 婷婷国产在线综合| 91麻豆精品国产自产在线| 亚洲三级理论片| 国产精品一区在线观看你懂的| 91麻豆精品国产自产在线观看一区 | 国产ts人妖一区二区| 国产精品麻豆99久久久久久| 不卡区在线中文字幕| 欧美一区二区成人6969| 三级欧美在线一区| 在线观看www91| 婷婷成人激情在线网| 56国语精品自产拍在线观看| 91精品国产乱码| 亚洲午夜av在线| 欧美精品丝袜中出| 亚洲小说春色综合另类电影| 成人三级在线视频| 午夜欧美视频在线观看| 欧美一区二区三区的| 91在线一区二区| 一个色在线综合| 欧美mv日韩mv国产| 色综合天天综合网国产成人综合天 | 日韩欧美高清一区| 91污在线观看| 美女视频黄 久久| 国产乱码一区二区三区| 亚洲人成网站精品片在线观看| 欧美军同video69gay| 久久精品国内一区二区三区| 久久天堂av综合合色蜜桃网 | 亚洲欧洲无码一区二区三区| 欧美久久久久久久久| 在线观看国产精品网站| 成人免费视频视频| 欧美在线观看18| 成人免费观看视频| 亚洲免费av观看| 国产人伦精品一区二区| 3atv一区二区三区| 欧美日韩小视频| 亚洲二区视频在线| 日韩精品中文字幕一区 | 欧美老年两性高潮| 91高清视频在线| 亚洲国产精品成人久久综合一区| xvideos.蜜桃一区二区| 久久久综合精品| 久久色.com| 国产亚洲欧洲997久久综合| 日本不卡的三区四区五区| 丝袜亚洲精品中文字幕一区| 一区二区三区日韩欧美精品| 亚洲精品乱码久久久久久久久| 国产精品久久久久久久岛一牛影视 | 日韩欧美国产三级| 国产亚洲精品aa| 国产精品久久久久aaaa| 亚洲少妇30p| 成人性生交大片免费看视频在线 | 成人的网站免费观看| 久久精品视频免费| 99精品久久只有精品| 99久久er热在这里只有精品66| va亚洲va日韩不卡在线观看| 在线免费亚洲电影| 日韩欧美一区二区久久婷婷| 亚洲国产精品激情在线观看|