[jboss-user] [JBoss Portal] - Re: Looking for Jar file for org.jboss.portal.identity.User

cry4dawn do-not-reply at jboss.com
Thu Oct 18 17:54:28 EDT 2007


i beilive you would have to find the jbosssx.jar source. 

as an example here is an example User i created that i use with our custom Login module:


  | /**
  |  * com.xxx.databaseUser
  |  */
  | package com.xxx.database;
  | 
  | import java.sql.Date;
  | import java.sql.ResultSet;
  | import java.sql.SQLException;
  | 
  | /**
  |  *
  |  */
  | final class User {
  | 
  | 	private final long userID;
  | 	private final String loginName;
  | 	private final String encryptedPassword;
  | 	private final Date fromDate;
  | 	private final Date termDate;
  | 	private final long loginCount;
  | 	private final Date lastLoginDate;
  | 	private int loginAttempts;
  | 
  | 	/**
  | 	 * @param rs {@link ResultSet}
  | 	 * @throws SQLException se
  | 	 * aanderson Sep 24, 2007
  | 	 */
  | 	User(final ResultSet rs) throws SQLException {
  | 		this.userID = rs.getLong("USER_ID");
  | 		this.loginName = rs.getString("LOGIN_NAME");
  | 		this.encryptedPassword = rs.getString("PASSWORD");
  | 		this.fromDate = rs.getDate("FROM_DATE");
  | 		this.termDate = rs.getDate("TERM_DATE");
  | 		this.loginCount = rs.getLong("LOGIN_CNT");
  | 		this.lastLoginDate = rs.getDate("LAST_LOGIN_DATE");
  | 		this.loginAttempts = rs.getInt("LOGIN_ATTEMPTS");
  | 	}
  | 
  | 	/**
  | 	 * @return the encryptedPassword
  | 	 */
  | 	String getEncryptedPassword() {
  | 		return this.encryptedPassword;
  | 	}
  | 
  | 	/**
  | 	 * @return the fromDate
  | 	 */
  | 	Date getFromDate() {
  | 		return this.fromDate;
  | 	}
  | 
  | 	/**
  | 	 * @return the lastLoginDate
  | 	 */
  | 	Date getLastLoginDate() {
  | 		return this.lastLoginDate;
  | 	}
  | 
  | 	/**
  | 	 * @return the loginAttempts
  | 	 */
  | 	int getLoginAttempts() {
  | 		return this.loginAttempts;
  | 	}
  | 
  | 	/**
  | 	 * @return the loginCount
  | 	 */
  | 	long getLoginCount() {
  | 		return this.loginCount;
  | 	}
  | 
  | 	/**
  | 	 * @return the loginName
  | 	 */
  | 	String getLoginName() {
  | 		return this.loginName;
  | 	}
  | 
  | 	/**
  | 	 * @return the termDate
  | 	 */
  | 	Date getTermDate() {
  | 		return this.termDate;
  | 	}
  | 
  | 	/**
  | 	 * @return the userID
  | 	 */
  | 	long getUserID() {
  | 		return this.userID;
  | 	}
  | 
  | 	/**
  | 	 * increments the login attempts and returns the incremented value
  | 	 * @param loginAttemptsIn int
  | 	 */
  | 	void incrementLoginAttempts(final int loginAttemptsIn) {
  | 		this.loginAttempts = loginAttemptsIn;
  | 	}
  | 
  | 	/**
  | 	 * @return true if this users term date is before today
  | 	 */
  | 	boolean isUserTermed() {
  | 		if (this.termDate == null) {
  | 			return false;
  | 		}
  | 		return this.termDate.before(new java.sql.Date(System.currentTimeMillis()));
  | 	}
  | 
  | }
  | 

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4096761#4096761

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4096761



More information about the jboss-user mailing list