org.tolven.core
Interface AccountDAOLocal

All Known Implementing Classes:
AccountDAOBean

public interface AccountDAOLocal

This is the business interface for AccountDAO enterprise bean.


Method Summary
 void accountTypeConversion()
          One-time migration 5-Nov-2006 for Accounts without an AccountType.
 AccountUser addAccountUser(Account account, TolvenUser user, java.util.Date now, boolean accountPermission)
           
 Account createAccount(java.lang.String knownType)
          Create a new account.
 Account createAccount(java.lang.String knownType, java.lang.String title, java.lang.String timeZone)
          Create a new account.
 Account createAccount2(java.lang.String title, java.lang.String timeZone, AccountType accType)
          Create a new account.
 AccountType createAccountType(java.lang.String knownType)
          createAccountType - create a new row in AccountType
 AccountType createAccountType(java.lang.String knownType, java.lang.String homePage, java.lang.String longDesc, boolean readOnly, java.lang.String status, boolean userCanCreate)
          Create new AccountType record
 Sponsorship createSponsorship(Account account, java.lang.String title)
          Create a new sponsorship for the given account.
 Account findAccount(long accountId)
          Find an account given the account id.
 java.util.List<Sponsorship> findAccountSponsorships(Account account)
          Find the list of Sponsorships owned by the specified account
 Account findAccountTemplate(Account account)
          Given an account, return its AccountTemplate, the account containing metadata used to populate the account.
 Account findAccountTemplate(java.lang.String knownType)
          Given an knownType of accountType, return its AccountTemplate.
 AccountType findAccountType(long id)
          Find an accountType by id
 AccountType findAccountTypebyKnownType(java.lang.String kt)
          Return a single AccountType by known_type
 AccountUser findAccountUser(java.lang.String username, long accountId)
          Find an accountUser given the username and account id.
 java.util.List<AccountType> findActiveAccountTypes()
          Get active AccountTypes
 java.util.List<AccountExchange> findActiveEndPoints(Account account, AccountExchange.Direction direction, boolean complete)
          For a given account, return all valid accounts which this account can talk to.
 java.util.List<AccountType> findAllAccountTypes()
          Return a list of all AccountTypes
 java.util.List<TolvenUser> findSponsoredUsers(Sponsorship sponsorship)
          Find the list of TolvenUsers referencing the specified Sponsorship
 java.util.List<SponsoredUser> findSponsoredUsersForAccount(Account account)
          Return a list of users sponsored users by the specified account.
 AccountUser inviteAccountUser(Account account, AccountUser accountUser, TolvenUser invidtedUser, org.tolven.security.key.UserPrivateKey anInviterPrivateKey, java.util.Date now, boolean accountPermission)
           
 boolean isAccountTemplateCurrent(Account account)
          This method checks if the AccountType of an account has a newer version of the template or not.
 void markAccountAsUpToDate(Account account)
          Mark this account as being up to date with the latest account type
 AccountExchange newAccountExchange(Account account, Account otherAccount, AccountExchange.Direction direction)
           
 void setAccountTemplate(java.lang.String knownType, Account account)
          Specifies the account to use as a template when creating new accounts
 void setupAccountKeys(Account account, AccountUser accountUser, Invitation invitation, TolvenUser user)
          This method was added to handle pre-existing accounts which have no keys.
 java.lang.String statusForValue(java.lang.String value)
          Get status type for input value
 void updateAccount(Account account)
          Stick the updated account back in the database.
 void updateAccountType(AccountType accountType)
          Update AccountType record
 

Method Detail

findAccount

Account findAccount(long accountId)
Find an account given the account id.

Parameters:
accountId -
Returns:
the account object

createAccount

Account createAccount(java.lang.String knownType)
Create a new account. No users are associated with this account.

Parameters:
accountType -
Returns:
A new Account object

updateAccount

void updateAccount(Account account)
Stick the updated account back in the database.

Parameters:
account -

createAccount

Account createAccount(java.lang.String knownType,
                      java.lang.String title,
                      java.lang.String timeZone)
Create a new account. No users are associated with this account.

Parameters:
accountType -
timeZone - Java time zone, null means use tolven default
Returns:
A new Account object

createAccount2

Account createAccount2(java.lang.String title,
                       java.lang.String timeZone,
                       AccountType accType)
Create a new account. No users are associated with this account.

Parameters:
accountType -
timeZone - Java time zone, null means use tolven default
Returns:
A new Account object

markAccountAsUpToDate

void markAccountAsUpToDate(Account account)
Mark this account as being up to date with the latest account type


isAccountTemplateCurrent

boolean isAccountTemplateCurrent(Account account)
This method checks if the AccountType of an account has a newer version of the template or not.

Returns:
true

findAccountTemplate

Account findAccountTemplate(Account account)
Given an account, return its AccountTemplate, the account containing metadata used to populate the account.

Parameters:
account -
Returns:

findAccountTemplate

Account findAccountTemplate(java.lang.String knownType)
Given an knownType of accountType, return its AccountTemplate.

Parameters:
knownType -
Returns:

setAccountTemplate

void setAccountTemplate(java.lang.String knownType,
                        Account account)
Specifies the account to use as a template when creating new accounts

Parameters:
knownType -
account -

findAccountUser

AccountUser findAccountUser(java.lang.String username,
                            long accountId)
Find an accountUser given the username and account id.


addAccountUser

AccountUser addAccountUser(Account account,
                           TolvenUser user,
                           java.util.Date now,
                           boolean accountPermission)
See Also:
AccountDAOBean

inviteAccountUser

AccountUser inviteAccountUser(Account account,
                              AccountUser accountUser,
                              TolvenUser invidtedUser,
                              org.tolven.security.key.UserPrivateKey anInviterPrivateKey,
                              java.util.Date now,
                              boolean accountPermission)
See Also:
AccountDAOBean

findAccountSponsorships

java.util.List<Sponsorship> findAccountSponsorships(Account account)
Find the list of Sponsorships owned by the specified account

Parameters:
account -
Returns:

findSponsoredUsers

java.util.List<TolvenUser> findSponsoredUsers(Sponsorship sponsorship)
Find the list of TolvenUsers referencing the specified Sponsorship

Parameters:
sponsorship -
Returns:

createSponsorship

Sponsorship createSponsorship(Account account,
                              java.lang.String title)
Create a new sponsorship for the given account.


findAccountType

AccountType findAccountType(long id)
Find an accountType by id

Returns:
AccountType

findSponsoredUsersForAccount

java.util.List<SponsoredUser> findSponsoredUsersForAccount(Account account)
Return a list of users sponsored users by the specified account. This attributes returned are captive in order to avoid cross-account peeping beyond the scope of sponsorship.

Parameters:
account -
Returns:

findAllAccountTypes

java.util.List<AccountType> findAllAccountTypes()
Return a list of all AccountTypes


findActiveAccountTypes

java.util.List<AccountType> findActiveAccountTypes()
Get active AccountTypes

Returns:

findAccountTypebyKnownType

AccountType findAccountTypebyKnownType(java.lang.String kt)
Return a single AccountType by known_type

Parameters:
kt -
Returns:
AccountType

createAccountType

AccountType createAccountType(java.lang.String knownType,
                              java.lang.String homePage,
                              java.lang.String longDesc,
                              boolean readOnly,
                              java.lang.String status,
                              boolean userCanCreate)
Create new AccountType record

Parameters:
knownType, - homePage, longDesc, readOnly
Returns:
AccountType

createAccountType

AccountType createAccountType(java.lang.String knownType)
createAccountType - create a new row in AccountType

Parameters:
knownType -
Returns:
New AccountType

updateAccountType

void updateAccountType(AccountType accountType)
Update AccountType record

Parameters:
accountType -

statusForValue

java.lang.String statusForValue(java.lang.String value)
Get status type for input value


accountTypeConversion

void accountTypeConversion()
One-time migration 5-Nov-2006 for Accounts without an AccountType.


setupAccountKeys

void setupAccountKeys(Account account,
                      AccountUser accountUser,
                      Invitation invitation,
                      TolvenUser user)
This method was added to handle pre-existing accounts which have no keys. An invitation does not have to be supplied but if the account already has a public key, then the invitation cannot be null

Parameters:
account -
accountUser -
invitation -
user -

findActiveEndPoints

java.util.List<AccountExchange> findActiveEndPoints(Account account,
                                                    AccountExchange.Direction direction,
                                                    boolean complete)
For a given account, return all valid accounts which this account can talk to.

Parameters:
account -
direction -
complete - A boolean that when true indicates that both parties in the exchange are in agreement about the exchange. False means that the "other party" need not have agreed to the exchange. For example, if the account administrator wants to see a list of other accounts that one could potentially. communicate with.
Returns:

newAccountExchange

AccountExchange newAccountExchange(Account account,
                                   Account otherAccount,
                                   AccountExchange.Direction direction)