org.kuali.kfs.coa.service.impl
Class AccountServiceImpl

java.lang.Object
  extended by org.kuali.kfs.coa.service.impl.AccountServiceImpl
All Implemented Interfaces:
AccountService

public class AccountServiceImpl
extends Object
implements AccountService

This class is the service implementation for the Account structure. This is the default, Kuali provided implementation.


Constructor Summary
AccountServiceImpl()
           
 
Method Summary
 boolean accountsCanCrossCharts()
          Returns true if parameter ACCOUNTS_CAN_CROSS_CHARTS_IND is set to "Y"; otherwise false.
protected  List<AccountDelegate> filterAccountDelegates(AccountDelegate delegateExample, List<AccountDelegate> accountDelegatesToFilterFrom)
          This method filters account delegates by 1) performing an exact match on the document type name of delegateExample 2) if no match is found for 1), then by performing an exact match on the closest parent document type name of delegateExample document type name.
protected  List<AccountDelegate> filterAccountDelegates(List<AccountDelegate> delegations, String documentTypeNameToFilterOn)
          This method filters account delegates by performing an exact match on the document type name passed in.
 Collection<Account> getAccountsForAccountNumber(String accountNumber)
          Returns the accounts associated with a given account number
 List getAccountsThatUserIsResponsibleFor(org.kuali.rice.kim.bo.Person person)
          Fetches the accounts that the user is either the fiscal officer or fiscal officer delegate for.
 Iterator<Account> getActiveAccountsForAccountSupervisor(String principalId)
          Retrieves all active accounts from the database where the given principal is the account supervisor
 Iterator<Account> getActiveAccountsForFiscalOfficer(String principalId)
          Retrieves all active accounts from the database where the given principal is the fiscal officer
 Iterator getAllAccounts()
          get all accounts in the system.
 Account getByPrimaryId(String chartOfAccountsCode, String accountNumber)
          Retrieves an Account object based on primary key.
 Account getByPrimaryIdWithCaching(String chartOfAccountsCode, String accountNumber)
          Method is used by KualiAccountAttribute to enable caching of accounts for routing.
 Iterator<Account> getExpiredAccountsForAccountSupervisor(String principalId)
          Retrieves all active accounts from the database where the given principal is the account supervisor
 Iterator<Account> getExpiredAccountsForFiscalOfficer(String principalId)
          Retrieves all expired accounts from the database where the given principal is the fiscal officer
protected  Set<String> getPotentialParentDocumentTypeNames(List<AccountDelegate> delegations)
          This method gets a list of potential parent document type names by collecting the unique doc type names from the list of account delegations
 AccountDelegate getPrimaryDelegationByExample(AccountDelegate delegateExample, String totalDollarAmount)
          This method retrieves the fiscal officers primary delegate based on the chart, account, and document type specified on the example, along with the total dollar amount
 List getSecondaryDelegationsByExample(AccountDelegate delegateExample, String totalDollarAmount)
          This method retrieves the fiscal officers secondary delegates based on the chart, account, and document type specified on the example, along with the total dollar amount
 Account getUniqueAccountForAccountNumber(String accountNumber)
          Returns the unique account associated with a given account number.
 boolean hasResponsibilityOnAccount(org.kuali.rice.kim.bo.Person kualiUser, Account account)
          Does the given user have responsibilities on the given account?
 boolean isPrincipalInAnyWayShapeOrFormAccountManager(String principalId)
          Determines if the given principal is the account manager of any non-closed account
 boolean isPrincipalInAnyWayShapeOrFormAccountSupervisor(String principalId)
          Determines if the given principal is the account supervisor of any non-closed account
 boolean isPrincipalInAnyWayShapeOrFormFiscalOfficer(String principalId)
          Determines if the given principal is the fiscal officer of any non-closed account
 void populateAccountingLineChartIfNeeded(AccountingLine line)
           
 void setAccountDao(AccountDao accountDao)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AccountServiceImpl

public AccountServiceImpl()
Method Detail

getByPrimaryId

public Account getByPrimaryId(String chartOfAccountsCode,
                              String accountNumber)
Retrieves an Account object based on primary key.

Specified by:
getByPrimaryId in interface AccountService
Parameters:
chartOfAccountsCode - - Chart of Accounts Code
accountNumber - - Account Number
Returns:
Account
See Also:
AccountService

getByPrimaryIdWithCaching

public Account getByPrimaryIdWithCaching(String chartOfAccountsCode,
                                         String accountNumber)
Method is used by KualiAccountAttribute to enable caching of accounts for routing.

Specified by:
getByPrimaryIdWithCaching in interface AccountService
See Also:
getByPrimaryId(java.lang.String, java.lang.String)

getAccountsThatUserIsResponsibleFor

public List getAccountsThatUserIsResponsibleFor(org.kuali.rice.kim.bo.Person person)
Description copied from interface: AccountService
Fetches the accounts that the user is either the fiscal officer or fiscal officer delegate for.

Specified by:
getAccountsThatUserIsResponsibleFor in interface AccountService
Returns:
a list of Accounts that the user has responsibility for
See Also:
org.kuali.kfs.coa.service.AccountService#getAccountsThatUserIsResponsibleFor(org.kuali.bo.user.KualiUser)

hasResponsibilityOnAccount

public boolean hasResponsibilityOnAccount(org.kuali.rice.kim.bo.Person kualiUser,
                                          Account account)
Description copied from interface: AccountService
Does the given user have responsibilities on the given account?

Specified by:
hasResponsibilityOnAccount in interface AccountService
Parameters:
kualiUser - the universal user to check responsibilities for
account - the account to check responsibilities on
Returns:
true if user does have responsibilities, false if otherwise
See Also:
AccountService.hasResponsibilityOnAccount(org.kuali.rice.kim.bo.Person, org.kuali.kfs.coa.businessobject.Account)

getPrimaryDelegationByExample

public AccountDelegate getPrimaryDelegationByExample(AccountDelegate delegateExample,
                                                     String totalDollarAmount)
Description copied from interface: AccountService
This method retrieves the fiscal officers primary delegate based on the chart, account, and document type specified on the example, along with the total dollar amount

Specified by:
getPrimaryDelegationByExample in interface AccountService
Parameters:
delegateExample - The object that contains the chart, account, and document type that should be used to query the account delegate table
totalDollarAmount - The amount that should be compared to the from and to amount on the account delegate table
Returns:
The primary delegate for this account, document type, and amount
See Also:
AccountService.getPrimaryDelegationByExample(org.kuali.kfs.coa.businessobject.AccountDelegate, java.lang.String)

getSecondaryDelegationsByExample

public List getSecondaryDelegationsByExample(AccountDelegate delegateExample,
                                             String totalDollarAmount)
Description copied from interface: AccountService
This method retrieves the fiscal officers secondary delegates based on the chart, account, and document type specified on the example, along with the total dollar amount

Specified by:
getSecondaryDelegationsByExample in interface AccountService
Parameters:
delegateExample - The object that contains the chart, account, and document type that should be used to query the account delegate table
totalDollarAmount - The amount that should be compared to the from and to amount on the account delegate table
Returns:
The primary delegate for this account, document type, and amount
See Also:
AccountService.getSecondaryDelegationsByExample(org.kuali.kfs.coa.businessobject.AccountDelegate, java.lang.String)

filterAccountDelegates

protected List<AccountDelegate> filterAccountDelegates(AccountDelegate delegateExample,
                                                       List<AccountDelegate> accountDelegatesToFilterFrom)
This method filters account delegates by 1) performing an exact match on the document type name of delegateExample 2) if no match is found for 1), then by performing an exact match on the closest parent document type name of delegateExample document type name.

Parameters:
delegateExample -
accountDelegatesToFilterFrom -
Returns:

filterAccountDelegates

protected List<AccountDelegate> filterAccountDelegates(List<AccountDelegate> delegations,
                                                       String documentTypeNameToFilterOn)
This method filters account delegates by performing an exact match on the document type name passed in.

Parameters:
delegations -
documentTypeNameToFilterOn -
Returns:

getPotentialParentDocumentTypeNames

protected Set<String> getPotentialParentDocumentTypeNames(List<AccountDelegate> delegations)
This method gets a list of potential parent document type names by collecting the unique doc type names from the list of account delegations

Parameters:
delegations -
Returns:

getAllAccounts

public Iterator getAllAccounts()
get all accounts in the system. This is needed by a sufficient funds rebuilder job

Specified by:
getAllAccounts in interface AccountService
Returns:
iterator of all accounts

getActiveAccountsForAccountSupervisor

public Iterator<Account> getActiveAccountsForAccountSupervisor(String principalId)
Description copied from interface: AccountService
Retrieves all active accounts from the database where the given principal is the account supervisor

Specified by:
getActiveAccountsForAccountSupervisor in interface AccountService
Parameters:
principalId - the principal id of the account supervisor
Returns:
an Iterator of active Accounts
See Also:
AccountService.getActiveAccountsForAccountSupervisor(java.lang.String)

getActiveAccountsForFiscalOfficer

public Iterator<Account> getActiveAccountsForFiscalOfficer(String principalId)
Description copied from interface: AccountService
Retrieves all active accounts from the database where the given principal is the fiscal officer

Specified by:
getActiveAccountsForFiscalOfficer in interface AccountService
Parameters:
principalId - the principal id of the fiscal officer
Returns:
an Iterator of active Accounts
See Also:
AccountService.getActiveAccountsForFiscalOfficer(java.lang.String)

getExpiredAccountsForAccountSupervisor

public Iterator<Account> getExpiredAccountsForAccountSupervisor(String principalId)
Description copied from interface: AccountService
Retrieves all active accounts from the database where the given principal is the account supervisor

Specified by:
getExpiredAccountsForAccountSupervisor in interface AccountService
Parameters:
principalId - the principal id of the account supervisor
Returns:
an Iterator of expired Accounts
See Also:
AccountService.getExpiredAccountsForAccountSupervisor(java.lang.String)

getExpiredAccountsForFiscalOfficer

public Iterator<Account> getExpiredAccountsForFiscalOfficer(String principalId)
Description copied from interface: AccountService
Retrieves all expired accounts from the database where the given principal is the fiscal officer

Specified by:
getExpiredAccountsForFiscalOfficer in interface AccountService
Parameters:
principalId - the principal id of the fiscal officer
Returns:
an Iterator of expired Accounts
See Also:
AccountService.getExpiredAccountsForFiscalOfficer(java.lang.String)

isPrincipalInAnyWayShapeOrFormAccountManager

public boolean isPrincipalInAnyWayShapeOrFormAccountManager(String principalId)
Description copied from interface: AccountService
Determines if the given principal is the account manager of any non-closed account

Specified by:
isPrincipalInAnyWayShapeOrFormAccountManager in interface AccountService
Parameters:
principalId - the principal to check for the account manager role
Returns:
true if the principal is a account manager for any non-closed account, false otherwise
See Also:
AccountService.isPrincipalInAnyWayShapeOrFormAccountManager(java.lang.String)

isPrincipalInAnyWayShapeOrFormAccountSupervisor

public boolean isPrincipalInAnyWayShapeOrFormAccountSupervisor(String principalId)
Description copied from interface: AccountService
Determines if the given principal is the account supervisor of any non-closed account

Specified by:
isPrincipalInAnyWayShapeOrFormAccountSupervisor in interface AccountService
Parameters:
principalId - the principal to check for the account supervisor role
Returns:
true if the principal is a account supervisor for any non-closed account, false otherwise
See Also:
AccountService.isPrincipalInAnyWayShapeOrFormAccountSupervisor(java.lang.String)

isPrincipalInAnyWayShapeOrFormFiscalOfficer

public boolean isPrincipalInAnyWayShapeOrFormFiscalOfficer(String principalId)
Description copied from interface: AccountService
Determines if the given principal is the fiscal officer of any non-closed account

Specified by:
isPrincipalInAnyWayShapeOrFormFiscalOfficer in interface AccountService
Parameters:
principalId - the principal to check for the fiscal officer role
Returns:
true if the principal is a fiscal officer for any non-closed account, false otherwise
See Also:
AccountService.isPrincipalInAnyWayShapeOrFormFiscalOfficer(java.lang.String)

getAccountsForAccountNumber

public Collection<Account> getAccountsForAccountNumber(String accountNumber)
Description copied from interface: AccountService
Returns the accounts associated with a given account number

Specified by:
getAccountsForAccountNumber in interface AccountService
Parameters:
accountNumber - the account number
Returns:
a list of accounts associated with that account number
See Also:
AccountService.getAccountsForAccountNumber(java.lang.String)

getUniqueAccountForAccountNumber

public Account getUniqueAccountForAccountNumber(String accountNumber)
Description copied from interface: AccountService
Returns the unique account associated with a given account number. This method only applies when parameter ACCOUNTS_CAN_CROSS_CHARTS_IND is set to "N".

Specified by:
getUniqueAccountForAccountNumber in interface AccountService
Parameters:
accountNumber - the account number
Returns:
the unique account associated with that account number
See Also:
AccountService.getUniqueAccountForAccountNumber(java.lang.String)

accountsCanCrossCharts

public boolean accountsCanCrossCharts()
Description copied from interface: AccountService
Returns true if parameter ACCOUNTS_CAN_CROSS_CHARTS_IND is set to "Y"; otherwise false.

Specified by:
accountsCanCrossCharts in interface AccountService
See Also:
AccountService.accountsCanCrossCharts()

populateAccountingLineChartIfNeeded

public void populateAccountingLineChartIfNeeded(AccountingLine line)
Specified by:
populateAccountingLineChartIfNeeded in interface AccountService
See Also:
AccountService.accountsCanCrossCharts()

setAccountDao

public void setAccountDao(AccountDao accountDao)
Parameters:
accountDao - The accountDao to set.


Copyright © 2005-2012 The Kuali Foundation. All Rights Reserved.