org.rhq.core.domain.auth
Class Principal

java.lang.Object
  extended by org.rhq.core.domain.auth.Principal
All Implemented Interfaces:
Serializable

public class Principal
extends Object
implements Serializable

See Also:
Serialized Form

Field Summary
static String QUERY_FIND_ALL_USERS
           
static String QUERY_FIND_BY_USERNAME
           
 
Constructor Summary
Principal()
           
Principal(String principal, String password_md5)
          Constructor for Principal.
 
Method Summary
 boolean equals(Object obj)
           
 int getId()
           
 String getPassword()
          Returns the principal password's MD5 hash.
 String getPrincipal()
           
 int hashCode()
           
 void setPassword(String password_md5)
          Sets the principal password's MD5 hash.
 void setPrincipal(String principal)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

QUERY_FIND_BY_USERNAME

public static final String QUERY_FIND_BY_USERNAME
See Also:
Constant Field Values

QUERY_FIND_ALL_USERS

public static final String QUERY_FIND_ALL_USERS
See Also:
Constant Field Values
Constructor Detail

Principal

public Principal()

Principal

public Principal(String principal,
                 String password_md5)
Constructor for Principal. Note that the password_md5 is not the actual password string; it must be the MD5 hash of the password. See setPassword(String).

Parameters:
principal -
password_md5 -
Method Detail

getId

public int getId()

getPrincipal

public String getPrincipal()

setPrincipal

public void setPrincipal(String principal)

getPassword

public String getPassword()
Returns the principal password's MD5 hash. The password itself is never persisted.

Returns:
the password's MD5 hashcode

setPassword

public void setPassword(String password_md5)
Sets the principal password's MD5 hash. Do not pass in the actual password itself, the caller must pass in an MD5 hash that was generated from the actual password string using something like: org.jboss.security.Util.createPasswordHash("MD5", "base64", null, null, password);

Parameters:
password_md5 - the MD5 hash representing the actual password

toString

public String toString()
Overrides:
toString in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object


Copyright © 2008-2009 RHQ Project Advisory Board (Red Hat, Inc.). All Rights Reserved.