com.hyper9.vangaea.impls.beans.admin
Class UserBeanImpl

java.lang.Object
  extended by com.hyper9.uvapi.impls.BeanImpl
      extended by com.hyper9.uvapi.impls.UniqueBeanImpl<java.lang.Integer>
          extended by com.hyper9.vangaea.impls.beans.admin.AdminBeanImpl
              extended by com.hyper9.vangaea.impls.beans.admin.UserBeanImpl
All Implemented Interfaces:
com.hyper9.common.beans.Bean, com.hyper9.common.beans.UniqueBean<java.lang.Integer>, AdminBean, UserBean, java.io.Serializable

public class UserBeanImpl
extends AdminBeanImpl
implements UserBean

A class for a row in the tbl_users table.

Author:
akutz
See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.hyper9.vangaea.impls.beans.admin.AdminBeanImpl
conn, isDeleted, isDirty
 
Constructor Summary
UserBeanImpl()
          The default constructor for serialization.
 
Method Summary
static UserBean get(java.sql.Connection conn, int id)
          Gets a user by its ID from the data source.
static UserBean get(java.sql.Connection conn, java.lang.String userName)
          Gets a user by its user name from the data source.
 java.lang.String getKeyHash()
          Gets the key hash.
 java.lang.String getPassphrase()
          Gets the passphrase.
 ServerInformationBean getServer(int serverID)
          Gets a server with the given alias that this user has a set of linked credentials for.
 java.util.List<ServerInformationBean> getServers()
          Gets a list of servers this user has a set of linked credentials for.
 java.lang.String getUserName()
          Get's the user's user name.
 void setKeyHash(java.lang.String keyHash)
          Sets the key hash.
 void setPassphrase(java.lang.String toSet)
          Sets the passphrase.
 void setUserName(java.lang.String userName)
          Get's the user's user name.
 
Methods inherited from class com.hyper9.vangaea.impls.beans.admin.AdminBeanImpl
getConnection, isDeleted, isDirty
 
Methods inherited from class com.hyper9.uvapi.impls.UniqueBeanImpl
getID, setID
 
Methods inherited from class com.hyper9.uvapi.impls.BeanImpl
toString, toString, toString, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.hyper9.vangaea.types.beans.admin.AdminBean
getConnection, isDeleted, isDirty
 
Methods inherited from interface com.hyper9.common.beans.UniqueBean
getID, setID
 
Methods inherited from interface com.hyper9.common.beans.Bean
toString, toString, toString, toString
 

Constructor Detail

UserBeanImpl

public UserBeanImpl()
The default constructor for serialization.

Method Detail

setUserName

public void setUserName(java.lang.String userName)
Description copied from interface: UserBean
Get's the user's user name.

Specified by:
setUserName in interface UserBean
Parameters:
userName - The user's user name.

getUserName

public java.lang.String getUserName()
Description copied from interface: UserBean
Get's the user's user name.

Specified by:
getUserName in interface UserBean
Returns:
The user's user name.

setKeyHash

public void setKeyHash(java.lang.String keyHash)
Description copied from interface: UserBean
Sets the key hash.

Specified by:
setKeyHash in interface UserBean
Parameters:
keyHash - The key hash.

getKeyHash

public java.lang.String getKeyHash()
Description copied from interface: UserBean
Gets the key hash.

Specified by:
getKeyHash in interface UserBean
Returns:
The key hash.

getPassphrase

public java.lang.String getPassphrase()
Description copied from interface: UserBean
Gets the passphrase.

Specified by:
getPassphrase in interface UserBean
Returns:
The passphrase.

setPassphrase

public void setPassphrase(java.lang.String toSet)
Description copied from interface: UserBean
Sets the passphrase.

Specified by:
setPassphrase in interface UserBean
Parameters:
toSet - The passphrase.

get

public static UserBean get(java.sql.Connection conn,
                           int id)
                    throws java.lang.Exception
Gets a user by its ID from the data source.

Parameters:
id - The user's unique ID.
conn - The data connection to use.
Returns:
The user.
Throws:
java.lang.Exception - When an error occurs.

get

public static UserBean get(java.sql.Connection conn,
                           java.lang.String userName)
                    throws java.sql.SQLException
Gets a user by its user name from the data source.

Parameters:
userName - The user name.
conn - The data connection to use.
Returns:
The user.
Throws:
java.sql.SQLException - When a SQL error occurs.

getServers

public java.util.List<ServerInformationBean> getServers()
                                                 throws java.lang.Exception
Description copied from interface: UserBean
Gets a list of servers this user has a set of linked credentials for. If no servers exist an empty list is returned.

Specified by:
getServers in interface UserBean
Returns:
A list of servers this user has a set of linked credentials for.
Throws:
java.lang.Exception - When an error occurs.

getServer

public ServerInformationBean getServer(int serverID)
                                throws java.lang.Exception
Description copied from interface: UserBean
Gets a server with the given alias that this user has a set of linked credentials for. If no server exists a null value is returned.

Specified by:
getServer in interface UserBean
Parameters:
serverID - The ID of the server to get.
Returns:
A server with the given alias that this user has a set of linked credentials for.
Throws:
java.lang.Exception - When an error occurs.


Copyright © 2009 Hyper9. All Rights Reserved.