com.zphinx.spine.members
Class AccountDetails

java.lang.Object
  extended by com.zphinx.spine.vo.dto.SpineBean
      extended by com.zphinx.spine.members.AccountDetails
All Implemented Interfaces:
MemberAccount, DataTransferObject, Serializable

public class AccountDetails
extends SpineBean
implements MemberAccount

AccountDetails represents the member's account details persisted within the system. Every Member/Principal can possess one of 6 account types namely

Max Caravaggio (mc@zphinx.com)

Version:
$1.0

Copyright ©Zphinx Software Solutions

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class com.zphinx.spine.vo.dto.SpineBean
SpineBean.PermissionFactory
 
Field Summary
 
Fields inherited from interface com.zphinx.spine.members.MemberAccount
ACCOUNT_30_DAYS, ACCOUNT_NO_EXPIRE, ACCOUNT_ONE_DAY, ACCOUNT_ONE_WEEK, ACCOUNT_ONE_YEAR, ACCOUNT_THREE_DAYS, ACCOUNT_VARIABLE
 
Constructor Summary
AccountDetails()
          Default constructor - sets the account expiration period to three 3 days
AccountDetails(long accountId, AccountTypeBean accountType)
          Constructor which presets the account type and sets the default account expiration period to three days
AccountDetails(long accountId, long expire)
          Constructor which presets the expiration time to a time defined above by the rules:
    ACCOUNT_NO_EXPIRE: Account can never expire ACCOUNT_THREE_DAYS: A three day account ACCOUNT_ONE_WEEK: A one week account ACCOUNT_30_DAYS: A thirty day account ACCOUNT_ONE_YEAR: A one year account ACCOUNT_VARIABLE: A variable account period
AccountDetails(String activationCode)
          Constructor - Allows the developer to manually set the activation code and sets the default account expiration period to three days
 
Method Summary
 void changeDetails(AccountTypeBean accountType, long expire)
          Amend the properties of this object with the given parameters
 Date getAccountCreationDate()
          Gets the date this account was created
 Date getAccountExpirationDate()
          Gets the expiration date of this account
 AccountTypeBean getAccountType()
          Gets the type of account we created
 String getActivationCode()
          Gets the activation code associated with this account
 long getExpiration()
          Returns a string representation of the expiration date
 boolean isAccountTypeChanged()
          Checks for changes in the users accountType
 boolean isInitialized()
          Returns true if this object has been fully initialized
 void restoreDate(Date date)
          Restores the expiration date to the parameter date.
 void setAccountCreationDate(Date accountCreationDate)
          Sets the date this account was created
 void setAccountExpirationDate(Date accountExpirationDate)
          Sets the expiration date of this account
 void setAccountType(AccountTypeBean accountTypeBean)
          Sets the type of account we are creating
 void setActivationCode(String activationCode)
          Sets the activation code for this account
 void setExpiration(long expiration)
          Sets the expiration date of this account
 void setInitialized(boolean constructorExpiry)
          Sets this object to the initialized state
 
Methods inherited from class com.zphinx.spine.vo.dto.SpineBean
getCreationDate, getDescription, getId, getLocale, getModifiedDate, getName, getPermission, getSessionId, setCreationDate, setDescription, setId, setLocale, setModifiedDate, setName, setPermission, setSessionId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.zphinx.spine.members.MemberAccount
getId, setId
 

Constructor Detail

AccountDetails

public AccountDetails()
Default constructor - sets the account expiration period to three 3 days


AccountDetails

public AccountDetails(String activationCode)
Constructor - Allows the developer to manually set the activation code and sets the default account expiration period to three days

Parameters:
activationCode - The code to be associated with the activation of this account.

AccountDetails

public AccountDetails(long accountId,
                      AccountTypeBean accountType)
               throws SpineApplicationException
Constructor which presets the account type and sets the default account expiration period to three days

Parameters:
accountId - The account owners id
accountType - The type of account details object we are creating
Throws:
SpineApplicationException - Throws an application exception if an error occurs while initializing this AccountDetails object

AccountDetails

public AccountDetails(long accountId,
                      long expire)
               throws SpineApplicationException
Constructor which presets the expiration time to a time defined above by the rules:

Parameters:
accountId - The account owners id
expire - The time in milliseconds when this account will expire
Throws:
SpineApplicationException
Method Detail

getAccountExpirationDate

public Date getAccountExpirationDate()
Gets the expiration date of this account

Specified by:
getAccountExpirationDate in interface MemberAccount
Returns:
Returns the accountExpirationDate.

setAccountExpirationDate

public void setAccountExpirationDate(Date accountExpirationDate)
                              throws SpineApplicationException
Sets the expiration date of this account

Specified by:
setAccountExpirationDate in interface MemberAccount
Parameters:
accountExpirationDate - The accountExpirationDate to set.
Throws:
SpineApplicationException

getExpiration

public long getExpiration()
Returns a string representation of the expiration date

Returns:
A string representing the expiration date

setExpiration

public void setExpiration(long expiration)
                   throws SpineApplicationException
Sets the expiration date of this account

Parameters:
expiration - The accountExpirationDate to set.
Throws:
SpineApplicationException

getAccountType

public AccountTypeBean getAccountType()
Gets the type of account we created

Specified by:
getAccountType in interface MemberAccount
Returns:
Returns the accountType.

setAccountType

public void setAccountType(AccountTypeBean accountTypeBean)
Sets the type of account we are creating

Specified by:
setAccountType in interface MemberAccount
Parameters:
accountTypeBean - The accountTypeBean to set.

isInitialized

public boolean isInitialized()
Returns true if this object has been fully initialized

Specified by:
isInitialized in interface MemberAccount
Returns:
Returns the initialized.

setInitialized

public void setInitialized(boolean constructorExpiry)
Sets this object to the initialized state

Parameters:
constructorExpiry - A boolean indicating if this object has been initialized

changeDetails

public void changeDetails(AccountTypeBean accountType,
                          long expire)
                   throws SpineApplicationException
Amend the properties of this object with the given parameters

Specified by:
changeDetails in interface MemberAccount
Parameters:
accountType - The type of account details object we are creating
expire - The time in milliseconds when this account will expire
Throws:
SpineApplicationException

getActivationCode

public String getActivationCode()
Gets the activation code associated with this account

Returns:
Returns the activationCode.

setActivationCode

public void setActivationCode(String activationCode)
Sets the activation code for this account

Parameters:
activationCode - The activationCode to set.

getAccountCreationDate

public Date getAccountCreationDate()
Gets the date this account was created

Returns:
Returns the accountCreationDate.

setAccountCreationDate

public void setAccountCreationDate(Date accountCreationDate)
Sets the date this account was created

Parameters:
accountCreationDate - The accountCreationDate to set.

restoreDate

public void restoreDate(Date date)
Restores the expiration date to the parameter date.

Parameters:
date - The expiration date to set

isAccountTypeChanged

public boolean isAccountTypeChanged()
Checks for changes in the users accountType

Specified by:
isAccountTypeChanged in interface MemberAccount
Returns:
True if the accountType is been changed/amended