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

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

?? simpleuseradapter.java

?? jive3論壇開源 最新 有版主功能 jive3論壇開源 最新 有版主功能 jive3論壇開源 最新 有版主功能
?? JAVA
字號:
import com.jivesoftware.base.*;import com.jivesoftware.base.database.ConnectionManager;import com.jivesoftware.base.event.UserEvent;import com.jivesoftware.util.*;import java.util.*;import java.util.Date;import java.sql.*;/** * An abstract adapter class to aid in creating custom user implementations. The * "set" methods in this class throw UnsupportedOperationExceptions, which means * the external user store will be read-only. You should extend this class to  * create your own User implementation and only override the methods of interest.<p> * * If your user store doesn't support all the fields present in the User interface * (such as the name visible and email visible flags), you should use hardcoded * values in your implementation or load and store these values from somewhere else.<p> *  * User objects have "extended properties", which is a way to allow arbitrary data  * to be attached to users. It's generally advisable to use the jiveUserProp table  * that is built into the Jive database schema to store this information. This adapter * class implements all the logic necessary to load and store properties from the * jiveUserProp database table. *  * @author Jive Software, 2003 */public abstract class SimpleUserAdapter implements User, Cacheable {    // Database queries for property loading and setting.    private static final String LOAD_PROPERTIES =            "SELECT name, propValue FROM jiveUserProp WHERE userID=?";    private static final String DELETE_PROPERTY =            "DELETE FROM jiveUserProp WHERE userID=? AND name=?";    private static final String UPDATE_PROPERTY =            "UPDATE jiveUserProp SET propValue=? WHERE name=? AND userID=?";    private static final String INSERT_PROPERTY =            "INSERT INTO jiveUserProp (userID, name, propValue) VALUES (?, ?, ?)";    // Constant values for permissions.    private static final Permissions USER_ADMIN_PERMS = new Permissions(Permissions.USER_ADMIN);    private static final Permissions NO_PERMS = new Permissions(Permissions.NONE);    protected long ID = -1;    protected String username;    protected String name;    protected String email;    // Use hardcoded values for these properties.    protected boolean nameVisible = true;    protected boolean emailVisible = false;    protected Date creationDate = new java.util.Date();    protected Date modificationDate = new java.util.Date();    protected Map properties = null;    private Object propertiesLock = new Object();	// User Interface -- note, Javadoc descriptions are left off so that    // they will be copied from the User interface.		public long getID() {        return ID;    }		public String getUsername() {        return username;    }		public String getName() {        return name;    }	    public void setName(String name) {        // Setting user data not supported.		throw new UnsupportedOperationException();    }    public void setPassword(String password) {        // Setting user data not supported.		throw new UnsupportedOperationException();    }    public String getPasswordHash() {        // Not implemented.        throw new UnsupportedOperationException();    }    public void setPasswordHash(String passwordHash) {        // Setting user data not supported.		throw new UnsupportedOperationException();    }		public String getEmail() {        return StringUtils.escapeHTMLTags(email);    }    public void setEmail(String email) {        // Setting user data not supported.		throw new UnsupportedOperationException();    }            public boolean isNameVisible() {        return nameVisible;    }		public void setNameVisible(boolean visible) throws UnauthorizedException {        // Setting user data not supported.		throw new UnsupportedOperationException();    }		public boolean isEmailVisible() {        return emailVisible;    }		public void setEmailVisible(boolean visible) throws UnauthorizedException {        // Setting user data not supported.		throw new UnsupportedOperationException();    }	    public Date getCreationDate() {        return creationDate;    }		public void setCreationDate(Date creationDate) throws UnauthorizedException {        // Setting user data not supported.		throw new UnsupportedOperationException();    }    public Date getModificationDate() {        return modificationDate;    }		public void setModificationDate(Date modificationDate) throws UnauthorizedException {        // Setting user data not supported.		throw new UnsupportedOperationException();	}    public String getProperty(String name) {        // Lazy-load properties.        synchronized (propertiesLock) {            if (properties == null) {                loadPropertiesFromDb();            }        }        return (String)properties.get(name);    }    public void setProperty(String name, String value) throws UnauthorizedException {        // Lazy-load properties.        synchronized (propertiesLock) {            if (properties == null) {                loadPropertiesFromDb();            }        }        // Make sure the property name and value aren't null.        if (name == null || value == null || "".equals(name) || "".equals(value)) {            throw new NullPointerException("Cannot set property with empty or null value.");        }        // See if we need to update a property value or insert a new one.        if (properties.containsKey(name)) {            // Only update the value in the database if the property value            // has changed.            if (!(value.equals(properties.get(name)))) {                String original = (String) properties.get(name);                properties.put(name, value);                updatePropertyInDb(name, value);                // Re-add user to cache.                UserManagerFactory.userCache.put(new Long(ID), this);                // fire off an event                Map params = new HashMap();                params.put("Type", "propertyModify");                params.put("PropertyKey", name);                params.put("originalValue", original);                UserEvent event = new UserEvent(UserEvent.USER_MODIFIED, this, params);                EventDispatcher.getInstance().notifyListeners(event);            }        }        else {            properties.put(name, value);            insertPropertyIntoDb(name, value);            // Re-add user to cache.            UserManagerFactory.userCache.put(new Long(ID), this);            // fire off an event            Map params = new HashMap();            params.put("Type", "propertyAdd");            params.put("PropertyKey", name);            UserEvent event = new UserEvent(UserEvent.USER_MODIFIED, this, params);            EventDispatcher.getInstance().notifyListeners(event);        }    }	    public void deleteProperty(String name) throws UnauthorizedException {        // Lazy-load properties.        synchronized (propertiesLock) {            if (properties == null) {                loadPropertiesFromDb();            }        }        if (properties.containsKey(name)) {            // fire off an event            Map params = new HashMap();            params.put("Type", "propertyDelete");            params.put("PropertyKey", name);            UserEvent event = new UserEvent(UserEvent.USER_MODIFIED, this, params);            EventDispatcher.getInstance().notifyListeners(event);            properties.remove(name);            deletePropertyFromDb(name);            // Re-add user to cache.            UserManagerFactory.userCache.put(new Long(ID), this);        }    }    public Iterator getPropertyNames() {        // Lazy-load properties.        synchronized (propertiesLock) {            if (properties == null) {                loadPropertiesFromDb();            }        }        return Collections.unmodifiableSet(properties.keySet()).iterator();    }		public boolean isAuthorized(long permissionType) {        // Always return true. A protection proxy will wrap the User		// object to provide real permissions checking.		return true;    }    public Permissions getPermissions(AuthToken authToken) {        // A user is allowed to administer themselves.		if (authToken.getUserID() == ID) {            return USER_ADMIN_PERMS;        }        else {            return NO_PERMS;        }    }		// Cacheable Interface	    public int getCachedSize() {        // Every item put into cache must be able to calculate it's own size. The "size" of 		// the object is calculated by adding up the sizes of all its member variables.		// The CacheSizes class can be used to help in this calculation.		int size = 0;        size += CacheSizes.sizeOfObject();              // overhead of object        size += CacheSizes.sizeOfLong();                // ID        size += CacheSizes.sizeOfString(username);      // username        size += CacheSizes.sizeOfString(name);          // name        size += CacheSizes.sizeOfString(email);         // email        size += CacheSizes.sizeOfBoolean();             // nameVisible        size += CacheSizes.sizeOfBoolean();             // emailVisible        size += CacheSizes.sizeOfMap(properties);       // properties        size += CacheSizes.sizeOfObject();              // properties lock        size += CacheSizes.sizeOfDate();                // creationDate        size += CacheSizes.sizeOfDate();                // modificationDate        return size;    }		// Other Methods	public String toString() {        return username;    }    public int hashCode() {        return (int)ID;    }    public boolean equals(Object object) {        if (this == object) {            return true;        }        if (object != null && object instanceof User) {            return ID == ((User)object).getID();        }        else {            return false;        }    }    /**     * Loads properties from the database.     */    private void loadPropertiesFromDb() {        this.properties = new Hashtable();        Connection con = null;        PreparedStatement pstmt = null;        try {            con = ConnectionManager.getConnection();            pstmt = con.prepareStatement(LOAD_PROPERTIES);            pstmt.setLong(1, ID);            ResultSet rs = pstmt.executeQuery();            while(rs.next()) {                properties.put(rs.getString(1), rs.getString(2));            }        }        catch (SQLException e) { Log.error(e); }        finally {            try { if (pstmt != null) { pstmt.close(); } }            catch (Exception e) { Log.error(e); }            try { if (con != null) { con.close(); } }            catch (Exception e) { Log.error(e); }        }    }    /**     * Deletes a property from the db.     */    private void deletePropertyFromDb(String name) {        Connection con = null;        PreparedStatement pstmt = null;        try {            con = ConnectionManager.getConnection();            pstmt = con.prepareStatement(DELETE_PROPERTY);            pstmt.setLong(1, ID);            pstmt.setString(2, name);            pstmt.execute();        }        catch (SQLException e) { Log.error(e); }        finally {            try { if (pstmt != null) { pstmt.close(); } }            catch (Exception e) { Log.error(e); }            try { if (con != null) { con.close(); } }            catch (Exception e) { Log.error(e); }        }    }    /**     * Inserts a new property into the datatabase.     */    private void insertPropertyIntoDb(String name, String value) {        Connection con = null;        PreparedStatement pstmt = null;        try {            con = ConnectionManager.getConnection();            pstmt = con.prepareStatement(INSERT_PROPERTY);            pstmt.setLong(1, ID);            pstmt.setString(2, name);            pstmt.setString(3, value);            pstmt.executeUpdate();        }        catch (SQLException e) { Log.error(e); }        finally {            try { if (pstmt != null) { pstmt.close(); } }            catch (Exception e) { Log.error(e); }            try { if (con != null) { con.close(); } }            catch (Exception e) { Log.error(e); }        }    }    /**     * Updates a property value in the database.     */    private void updatePropertyInDb(String name, String value) {        Connection con = null;        PreparedStatement pstmt = null;        try {            con = ConnectionManager.getConnection();            pstmt = con.prepareStatement(UPDATE_PROPERTY);            pstmt.setString(1, value);            pstmt.setString(2, name);            pstmt.setLong(3, ID);            pstmt.executeUpdate();        }        catch (SQLException e) { Log.error(e); }        finally {            try { if (pstmt != null) { pstmt.close(); } }            catch (Exception e) { Log.error(e); }            try { if (con != null) { con.close(); } }            catch (Exception e) { Log.error(e); }        }    }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美三级视频在线观看| 亚洲欧美区自拍先锋| 欧美一二三四区在线| 欧美嫩在线观看| 欧美日韩一级二级三级| 欧美午夜一区二区| 欧美在线视频不卡| 在线亚洲+欧美+日本专区| 色女孩综合影院| 一本一道久久a久久精品| 色琪琪一区二区三区亚洲区| 一本在线高清不卡dvd| 在线亚洲精品福利网址导航| 欧美亚日韩国产aⅴ精品中极品| 色激情天天射综合网| 91国产成人在线| 欧美日韩亚洲国产综合| 欧美日韩亚洲高清一区二区| 91精品国产色综合久久不卡蜜臀| 在线电影院国产精品| 欧美成人精品高清在线播放| 久久久久久久久久久久电影 | 久久在线观看免费| 国产视频一区二区在线观看| 国产精品无人区| 亚洲一区二区av电影| 青青国产91久久久久久| 国内精品在线播放| 99国产精品久久久久久久久久久| 色94色欧美sute亚洲13| 91.xcao| 久久亚洲免费视频| 亚洲视频一区二区在线| 午夜电影一区二区三区| 狠狠狠色丁香婷婷综合久久五月| 福利视频网站一区二区三区| 色欧美片视频在线观看| 日韩一级片在线观看| 久久久久久久网| 国产无人区一区二区三区| 日韩美女精品在线| 青青草国产成人av片免费| 一区二区免费视频| 极品美女销魂一区二区三区 | 日本一区二区动态图| 一区二区久久久| 国产一区欧美日韩| 欧美在线一区二区| 久久久久久久国产精品影院| 亚洲宅男天堂在线观看无病毒| 麻豆国产精品官网| 91免费视频网址| 久久久精品国产免大香伊| 一二三区精品福利视频| 奇米影视在线99精品| 9i在线看片成人免费| 欧美一区二区三区在线看| 国产精品色婷婷久久58| 免费一级欧美片在线观看| 91网站在线观看视频| 精品日韩99亚洲| 亚洲成a天堂v人片| 99免费精品视频| 精品美女在线播放| 亚洲尤物在线视频观看| 国产一区二区中文字幕| 欧美午夜视频网站| 自拍偷拍国产精品| 国产精品99久久久久久久女警| 欧美电影在线免费观看| 亚洲欧美乱综合| 成人美女视频在线观看| 日韩免费观看高清完整版| 亚洲最大成人网4388xx| 成人精品国产一区二区4080| 日韩亚洲欧美一区| 亚洲成av人片在线观看| 91无套直看片红桃| 中文字幕高清一区| 国产乱码一区二区三区| 欧美一区二区三区喷汁尤物| 亚洲二区在线视频| 91蝌蚪国产九色| 国产精品萝li| 懂色av一区二区夜夜嗨| 久久综合色8888| 久久机这里只有精品| 在线免费观看日韩欧美| 国产精品情趣视频| 欧美日本一区二区三区| 国产在线精品免费| 日韩网站在线看片你懂的| 午夜国产不卡在线观看视频| 欧美日韩精品一区二区三区| 亚洲国产精品人人做人人爽| 日本高清不卡aⅴ免费网站| 中文字幕中文字幕中文字幕亚洲无线| 国产精品一区免费在线观看| 精品电影一区二区三区| 免费看日韩精品| 欧美刺激脚交jootjob| 秋霞av亚洲一区二区三| 日韩欧美资源站| 麻豆91精品91久久久的内涵| 欧美一区二区在线免费观看| 日本欧美肥老太交大片| 91精品欧美福利在线观看| 日本视频一区二区三区| 日韩一区二区三区视频在线| 美女网站色91| 国产午夜精品一区二区 | 欧美xxxxx牲另类人与| 久久国产三级精品| 久久久精品免费网站| 成人性色生活片免费看爆迷你毛片| 国产精品视频一二| av不卡在线播放| 玉米视频成人免费看| 欧美日韩高清一区二区| 免费黄网站欧美| 久久久欧美精品sm网站| 国产中文字幕一区| 国产精品视频一二| 在线一区二区三区做爰视频网站| 亚洲成人精品一区二区| 91精品国产综合久久福利软件 | 国产麻豆成人精品| 成人免费在线视频| 欧美色图12p| 开心九九激情九九欧美日韩精美视频电影 | 一区二区三区欧美激情| 欧美二区三区91| 国产乱子伦视频一区二区三区| 欧美猛男男办公室激情| 九一久久久久久| 亚洲精品欧美在线| 欧美v日韩v国产v| 国产精品一线二线三线| 亚洲天堂福利av| 欧美一级夜夜爽| 99久精品国产| 天天综合日日夜夜精品| 中文av一区特黄| 51精品秘密在线观看| 久久国产成人午夜av影院| 国产精品久久久久久久久搜平片| 精品国产伦一区二区三区免费 | 欧美日韩免费一区二区三区视频| 亚洲一区二区三区小说| 久久久久久免费网| 欧美一区二区三区视频免费| 99久久精品99国产精品| 日本最新不卡在线| 亚洲乱码国产乱码精品精的特点 | 夜夜亚洲天天久久| 成人av在线资源网站| 日本中文一区二区三区| 国产精品麻豆欧美日韩ww| 精品理论电影在线| 欧美日韩一区高清| 91丨porny丨蝌蚪视频| 麻豆成人久久精品二区三区小说| 中文字幕精品在线不卡| 欧美精品v日韩精品v韩国精品v| 久久99国产精品久久99| 亚洲一区二区成人在线观看| 日本一区二区三区电影| 欧美日本一区二区三区四区| 91久久线看在观草草青青| 国产精品亚洲а∨天堂免在线| www.日韩精品| 日本欧美在线看| 国产欧美日韩视频一区二区 | 色八戒一区二区三区| 久久看人人爽人人| 久久国产精品99精品国产| 日韩国产成人精品| 国产精品午夜在线| 亚洲国产成人av好男人在线观看| 亚洲精品一区在线观看| 色婷婷久久久久swag精品| 琪琪久久久久日韩精品| 日韩片之四级片| 欧美日韩在线观看一区二区 | 91精品国产入口在线| 精品一区二区免费| 亚洲欧美韩国综合色| 国产亚洲欧美一级| 日本韩国一区二区| 成人深夜福利app| 国产在线精品一区二区| 亚洲精品老司机| 国产精品乱人伦中文| 欧美成人video| 欧美日韩在线播放三区四区| 国产在线视视频有精品| 亚洲综合色噜噜狠狠| 久久综合给合久久狠狠狠97色69| 成人丝袜高跟foot| 亚洲欧美偷拍三级|