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

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.AuthCookieBeanImpl
All Implemented Interfaces:
com.hyper9.common.beans.Bean, com.hyper9.common.beans.UniqueBean<java.lang.Integer>, AdminBean, AuthCookieBean, java.io.Serializable

public class AuthCookieBeanImpl
extends AdminBeanImpl
implements AuthCookieBean

A bean describing a row in the tbl_auth_cookies 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
AuthCookieBeanImpl()
          The default constructor for serialization.
AuthCookieBeanImpl(java.sql.Connection connection, int id, java.lang.String cookieValue, int userID, java.util.Date created)
          Initializes a new instance of the AuthCookieBeanImpl class.
 
Method Summary
static AuthCookieBean add(java.sql.Connection conn, java.lang.String cookieValue, int userID)
          Adds a new authentication cookie to the table.
static AuthCookieBean add(UserBean user)
          Adds a new authentication cookie to the table.
static AuthCookieBean get(java.sql.Connection conn, int id)
          Get an authentication cookie from the data source.
static AuthCookieBean getByCookieValue(java.sql.Connection conn, java.lang.String cookieValue)
          Get an authentication cookie from the data source by its cookie value.
 java.lang.String getCookieValue()
          Gets the cookie's value.
 java.util.Date getCreated()
          Gets the date and time this cookie was created.
 UserBean getUser()
          Gets the user this cookie is for.
 int getUserID()
          Gets the identifier of the user this cookie is for.
 void setCookieValue(java.lang.String toSet)
          Sets the cookie's value.
 void setCreated(java.util.Date toSet)
          Sets the date and time this cookie was created.
 void setUserID(int toSet)
          Sets the identifier of the user this cookie is for.
 
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

AuthCookieBeanImpl

public AuthCookieBeanImpl()
The default constructor for serialization.


AuthCookieBeanImpl

public AuthCookieBeanImpl(java.sql.Connection connection,
                          int id,
                          java.lang.String cookieValue,
                          int userID,
                          java.util.Date created)
Initializes a new instance of the AuthCookieBeanImpl class.

Parameters:
connection - The underlying data connection.
id - The user ID.
cookieValue - The value of the authentication cookie.
userID - The identifier of the user the cookie is for.
created - When the cookie was created.
Method Detail

getCookieValue

public java.lang.String getCookieValue()
Description copied from interface: AuthCookieBean
Gets the cookie's value.

Specified by:
getCookieValue in interface AuthCookieBean
Returns:
The cookie's value.

getCreated

public java.util.Date getCreated()
Description copied from interface: AuthCookieBean
Gets the date and time this cookie was created.

Specified by:
getCreated in interface AuthCookieBean
Returns:
The date and time this cookie was created.

getUser

public UserBean getUser()
                 throws java.lang.Exception
Description copied from interface: AuthCookieBean
Gets the user this cookie is for.

Specified by:
getUser in interface AuthCookieBean
Returns:
The user this cookie is for.
Throws:
java.lang.Exception - When an error occurs.

getUserID

public int getUserID()
Description copied from interface: AuthCookieBean
Gets the identifier of the user this cookie is for.

Specified by:
getUserID in interface AuthCookieBean
Returns:
The identifier of the user this cookie is for.

setCookieValue

public void setCookieValue(java.lang.String toSet)
Description copied from interface: AuthCookieBean
Sets the cookie's value.

Specified by:
setCookieValue in interface AuthCookieBean
Parameters:
toSet - The cookie's value.

setCreated

public void setCreated(java.util.Date toSet)
Description copied from interface: AuthCookieBean
Sets the date and time this cookie was created.

Specified by:
setCreated in interface AuthCookieBean
Parameters:
toSet - The date and time this cookie was created.

setUserID

public void setUserID(int toSet)
Description copied from interface: AuthCookieBean
Sets the identifier of the user this cookie is for.

Specified by:
setUserID in interface AuthCookieBean
Parameters:
toSet - The identifier of the user this cookie is for.

get

public static AuthCookieBean get(java.sql.Connection conn,
                                 int id)
                          throws java.lang.Exception
Get an authentication cookie from the data source.

Parameters:
id - The cookie's identifier.
conn - The underlying data connection.
Returns:
An authentication cookie.
Throws:
java.lang.Exception - When an error occurs.

getByCookieValue

public static AuthCookieBean getByCookieValue(java.sql.Connection conn,
                                              java.lang.String cookieValue)
                                       throws java.sql.SQLException
Get an authentication cookie from the data source by its cookie value.

Parameters:
cookieValue - The cookie's value.
conn - The underlying data connection.
Returns:
An authentication cookie.
Throws:
java.sql.SQLException - When a SQL error occurs.

add

public static AuthCookieBean add(UserBean user)
                          throws java.sql.SQLException
Adds a new authentication cookie to the table.

Parameters:
user - The user to add the cookie for.
Returns:
A new authentication cookie.
Throws:
java.sql.SQLException - When a SQL error occurs.

add

public static AuthCookieBean add(java.sql.Connection conn,
                                 java.lang.String cookieValue,
                                 int userID)
                          throws java.sql.SQLException
Adds a new authentication cookie to the table.

Parameters:
conn - The data connection to use.
cookieValue - The cookie value.
userID - The identifier of the user this cookie is for.
created - When this cookie was created.
Returns:
A new authentication cookie.
Throws:
java.sql.SQLException - When a SQL error occurs.


Copyright © 2009 Hyper9. All Rights Reserved.