Package org.cyclos.security.banking
Class AccountServiceSecurity
- java.lang.Object
-
- org.cyclos.impl.AbstractServerComponent
-
- org.cyclos.impl.AbstractNetworkedServerComponent
-
- org.cyclos.security.BaseServiceSecurity
-
- org.cyclos.security.banking.AccountServiceSecurity
-
- All Implemented Interfaces:
AccountService,Service
@Security public class AccountServiceSecurity extends BaseServiceSecurity implements AccountService
Security layer forAccountService
-
-
Field Summary
-
Fields inherited from class org.cyclos.impl.AbstractNetworkedServerComponent
authHandler, conversionHandler, customFieldValueHandler, entityManagerHandler, groupsHandler, productsHandler, restBeanPropertyMapping, userLocatorHandler
-
Fields inherited from class org.cyclos.impl.AbstractServerComponent
accountHandler, configurationHandler, dataTranslationHandler, notificationHandler, profileFieldHandler, transactionHandler, translationHandler
-
Fields inherited from interface org.cyclos.services.banking.AccountService
MAX_BALANCE_HISTORY_DATAPOINTS
-
-
Constructor Summary
Constructors Constructor Description AccountServiceSecurity()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcheckAccessibleAccounts(InternalAccountOwner owner)protected voidcheckAccountHistoriesOverviewQuery(AccountHistoriesOverviewQuery params)protected voidcheckAccountHistoryQuery(AccountHistoryQuery params)protected voidcheckAccountLimitsOverviewQuery(AccountLimitsOverviewQuery params)voidcheckTransQuery(AbstractTransQuery query)FileInfoexportAccountBalanceLimitsOverview(@NotNull ExportFormatVO format, @NotNull AccountBalanceLimitsOverviewQuery params)Generates a file with the query result listing the account balance limitsFileInfoexportAccountHistoriesOverview(@NotNull ExportFormatVO format, @NotNull AccountHistoriesOverviewQuery params)Exports the account histories overview result to fileFileInfoexportAccountHistory(@NotNull ExportFormatVO format, @NotNull AccountHistoryQuery params)Exports the account history result to fileFileInfoexportAccountPaymentAmountLimitsOverview(@NotNull ExportFormatVO format, @NotNull AccountPaymentAmountLimitsOverviewQuery params)Generates a file with the query result listing the account balance limitsFileInfoexportUsersWithBalances(@NotNull ExportFormatVO format, @NotNull UserWithBalanceQuery params)Generates a file with the query result listing the user balancesAccountBalanceHistoryVOgetAccountBalanceHistory(@NotNull AccountBalanceHistoryParams params)Returns the balance at each data point for a given account.AccountLimitsOverviewDatagetAccountBalanceLimitsOverviewData()Account limits (balance and payment amounts) overview data for performing searches.AccountHistoriesOverviewDatagetAccountHistoriesOverviewData()Gets the details for viewing an account histories overviewAccountHistoriesOverviewStatusVOgetAccountHistoriesOverviewStatus(AccountHistoriesOverviewQuery params)Returns the statuses by currency for the result of searching transactions with the given parametersAccountHistoryDatagetAccountHistoryData(AccountVO account, RateVisibility rateVisibility)Gets the details for viewing an account historyAccountWithHistoryStatusVOgetAccountHistoryStatus(AccountHistoryQuery params)Returns historic status for the accountAccountLimitsOverviewDatagetAccountPaymentAmountLimitsOverviewData()Account limits (balance and payment amounts) overview data for performing searches.List<AccountWithStatusVO>getAccountsSummary(InternalAccountOwner owner, DateTime dateTime)Lists the visible accounts summary for the given account owner, with balances relative to the given dateAccountStatusVOgetAccountStatus(AccountVO account, DateTime dateTime, RateVisibility rateVisibility)Gets the status for the given accountAccountWithStatusVOgetAccountWithStatus(AccountVO account, DateTime dateTime)Returns the information of an account, with its status, by owner and typeAccountPermissionsDatagetPermissions(@NotNull AccountVO account)Returns permissions of what the logged user can do over the given accountUserAccountBalanceLimitDatagetUserAccountBalanceLimitData(AccountVO vo)Get an account limit dataUserAccountPaymentAmountLimitDatagetUserAccountPaymentAmountLimitData(AccountVO vo)Get an account payment amount limit dataList<AccountBalanceLimitVO>getUserAccountsBalanceLimits(UserLocatorVO userLocator)Returns the user accounts with their upper and lower balance limitsList<AccountPaymentAmountLimitVO>getUserAccountsPaymentAmountLimits(UserLocatorVO userLocator)Returns the user accounts with their upper and lower balance limitsUsersWithBalancesOverviewgetUsersWithBalancesOverview(UserWithBalanceQuery params)Returns the overview of users with balances according to the given queryUserWithBalanceSearchDatagetUserWithBalanceSearchData()Returns data to search for users with balancesbooleanisAccessible(Account account)booleanisAccessible(AccountLocator locator)booleanisAccessible(AccountVO account)booleanisAccessible(InternalAccountOwner owner, AccountType type)AccountWithCurrencyVOload(Long id)Loads an account by idprotected EntityCheck<?>resolveEntityCheck()Must be implemented in order to return theEntityCheckmanaged by this security component, or null if nonePage<AccountBalanceLimitVO>searchAccountBalanceLimitsOverview(AccountBalanceLimitsOverviewQuery params)Overview search of account balance limitsPage<AccountHistoryOverviewEntryVO>searchAccountHistoriesOverview(AccountHistoriesOverviewQuery params)Account histories overview filtered by the specified query parameters.Page<AccountHistoryEntryVO>searchAccountHistory(AccountHistoryQuery params)Searches the history entries of a required visible account according to the given query parameters.Page<AccountPaymentAmountLimitVO>searchAccountPaymentAmountLimitsOverview(AccountPaymentAmountLimitsOverviewQuery params)Overview search of account balance limitsPage<UserWithBalanceVO>searchUsersWithBalances(UserWithBalanceQuery params)Searches for users together with their respective account balancesvoidsetBalanceLimit(AccountBalanceLimitDTO data)Change limits of an accountvoidsetPaymentAmountLimit(AccountPaymentAmountLimitDTO data)Change limits of an account-
Methods inherited from class org.cyclos.security.BaseServiceSecurity
checkGuest, checkId, checkIds, checkInternalName, checkLoggedIn, checkManagesUser, checkRelatesToUser, checkScope, checkVO, checkVOs, doInitialize, getEntityCheckRegistry, getUser, initialize
-
Methods inherited from class org.cyclos.impl.AbstractNetworkedServerComponent
canManage, checkManagesUser, checkPermission, checkRelatesToUser, checkValue, clearAlreadyValidated, getBaseEntityManagerHandler, getConfiguration, getLoggedBasicUser, getLoggedUser, getProducts, getTranslatedName, getTranslatedValue, hasPermission, hasValue, inSameNetwork, inSameNetworkOrGlobal, isAdmin, isAlreadyValidated, isBroker, isGlobalAdmin, isGlobalAdminInNetwork, isGuest, isLoggedIn, isMember, isMemberOnly, isNetworkAdmin, isOperator, isRelatedToUser, isSystem, isUserManager, isUserManagerOf, message, message, permission, permission, permissionOptionalValue, permissionOptionalValue, setAlreadyValidated, toDate, toDateTime, validate
-
Methods inherited from class org.cyclos.impl.AbstractServerComponent
dataTranslationProxy, dataTranslationProxy, delete, detach, doDataTranslationProxy, find, flush, from, getApplicationContext, getFormatter, getFormatter, getFormatter, getLogger, getRemoteAddress, getSessionData, mailContentBuilder, message, message, persist, processBatch, processBatch, refresh, remove, selectFrom, subQuery, update
-
-
-
-
Method Detail
-
checkAccessibleAccounts
public void checkAccessibleAccounts(InternalAccountOwner owner)
-
checkTransQuery
public void checkTransQuery(AbstractTransQuery query)
-
exportAccountBalanceLimitsOverview
public FileInfo exportAccountBalanceLimitsOverview(@NotNull @NotNull ExportFormatVO format, @NotNull @NotNull AccountBalanceLimitsOverviewQuery params) throws FrameworkException
Description copied from interface:AccountServiceGenerates a file with the query result listing the account balance limits- Specified by:
exportAccountBalanceLimitsOverviewin interfaceAccountService- Throws:
FrameworkException
-
exportAccountHistoriesOverview
public FileInfo exportAccountHistoriesOverview(@NotNull @NotNull ExportFormatVO format, @NotNull @NotNull AccountHistoriesOverviewQuery params) throws FrameworkException
Description copied from interface:AccountServiceExports the account histories overview result to file- Specified by:
exportAccountHistoriesOverviewin interfaceAccountService- Throws:
FrameworkException
-
exportAccountHistory
public FileInfo exportAccountHistory(@NotNull @NotNull ExportFormatVO format, @NotNull @NotNull AccountHistoryQuery params) throws FrameworkException
Description copied from interface:AccountServiceExports the account history result to file- Specified by:
exportAccountHistoryin interfaceAccountService- Throws:
FrameworkException
-
exportAccountPaymentAmountLimitsOverview
public FileInfo exportAccountPaymentAmountLimitsOverview(@NotNull @NotNull ExportFormatVO format, @NotNull @NotNull AccountPaymentAmountLimitsOverviewQuery params) throws FrameworkException
Description copied from interface:AccountServiceGenerates a file with the query result listing the account balance limits- Specified by:
exportAccountPaymentAmountLimitsOverviewin interfaceAccountService- Throws:
FrameworkException
-
exportUsersWithBalances
public FileInfo exportUsersWithBalances(@NotNull @NotNull ExportFormatVO format, @NotNull @NotNull UserWithBalanceQuery params) throws FrameworkException
Description copied from interface:AccountServiceGenerates a file with the query result listing the user balances- Specified by:
exportUsersWithBalancesin interfaceAccountService- Throws:
FrameworkException
-
getAccountBalanceHistory
public AccountBalanceHistoryVO getAccountBalanceHistory(@NotNull @NotNull AccountBalanceHistoryParams params) throws FrameworkException
Description copied from interface:AccountServiceReturns the balance at each data point for a given account. The account and status are also returned. For example, if the account had 50 transfers over 1 month, but in 20 distinct days of the month, and the request was to return for the month, with a balance per day, there will be 21 entries (the balance on the first day, plus the 20 days that had changed) When no period is given, or if the begin date was before the account creation, it is assumed since the day the account was created. The possible periods for data points are: - Months - Weeks - Days The maximum number of data points cannot exceed 61. So, for example, if the requested period is 1 year, it is possible to request balances per month or week (there's about 52 weeks in a year), but not days.- Specified by:
getAccountBalanceHistoryin interfaceAccountService- Throws:
FrameworkException
-
getAccountBalanceLimitsOverviewData
public AccountLimitsOverviewData getAccountBalanceLimitsOverviewData() throws FrameworkException
Description copied from interface:AccountServiceAccount limits (balance and payment amounts) overview data for performing searches.- Specified by:
getAccountBalanceLimitsOverviewDatain interfaceAccountService- Throws:
FrameworkException
-
getAccountHistoriesOverviewData
public AccountHistoriesOverviewData getAccountHistoriesOverviewData()
Description copied from interface:AccountServiceGets the details for viewing an account histories overview- Specified by:
getAccountHistoriesOverviewDatain interfaceAccountService
-
getAccountHistoriesOverviewStatus
public AccountHistoriesOverviewStatusVO getAccountHistoriesOverviewStatus(AccountHistoriesOverviewQuery params)
Description copied from interface:AccountServiceReturns the statuses by currency for the result of searching transactions with the given parameters- Specified by:
getAccountHistoriesOverviewStatusin interfaceAccountService
-
getAccountHistoryData
public AccountHistoryData getAccountHistoryData(AccountVO account, RateVisibility rateVisibility)
Description copied from interface:AccountServiceGets the details for viewing an account history- Specified by:
getAccountHistoryDatain interfaceAccountServicerateVisibility- if nullRateVisibility.NOTis used
-
getAccountHistoryStatus
public AccountWithHistoryStatusVO getAccountHistoryStatus(AccountHistoryQuery params) throws FrameworkException
Description copied from interface:AccountServiceReturns historic status for the account- Specified by:
getAccountHistoryStatusin interfaceAccountService- Throws:
FrameworkException
-
getAccountPaymentAmountLimitsOverviewData
public AccountLimitsOverviewData getAccountPaymentAmountLimitsOverviewData() throws FrameworkException
Description copied from interface:AccountServiceAccount limits (balance and payment amounts) overview data for performing searches.- Specified by:
getAccountPaymentAmountLimitsOverviewDatain interfaceAccountService- Throws:
FrameworkException
-
getAccountsSummary
public List<AccountWithStatusVO> getAccountsSummary(InternalAccountOwner owner, DateTime dateTime) throws FrameworkException
Description copied from interface:AccountServiceLists the visible accounts summary for the given account owner, with balances relative to the given date- Specified by:
getAccountsSummaryin interfaceAccountService- Throws:
FrameworkException
-
getAccountStatus
public AccountStatusVO getAccountStatus(AccountVO account, DateTime dateTime, RateVisibility rateVisibility)
Description copied from interface:AccountServiceGets the status for the given account- Specified by:
getAccountStatusin interfaceAccountServicerateVisibility- if nullRateVisibility.NOTis used
-
getAccountWithStatus
public AccountWithStatusVO getAccountWithStatus(AccountVO account, DateTime dateTime) throws FrameworkException
Description copied from interface:AccountServiceReturns the information of an account, with its status, by owner and type- Specified by:
getAccountWithStatusin interfaceAccountService- Throws:
FrameworkException
-
getPermissions
public AccountPermissionsData getPermissions(@NotNull @NotNull AccountVO account) throws FrameworkException
Description copied from interface:AccountServiceReturns permissions of what the logged user can do over the given account- Specified by:
getPermissionsin interfaceAccountService- Throws:
PermissionDeniedException- if the given account is not managed by the authenticated userFrameworkException
-
getUserAccountBalanceLimitData
public UserAccountBalanceLimitData getUserAccountBalanceLimitData(AccountVO vo)
Description copied from interface:AccountServiceGet an account limit data- Specified by:
getUserAccountBalanceLimitDatain interfaceAccountService
-
getUserAccountPaymentAmountLimitData
public UserAccountPaymentAmountLimitData getUserAccountPaymentAmountLimitData(AccountVO vo)
Description copied from interface:AccountServiceGet an account payment amount limit data- Specified by:
getUserAccountPaymentAmountLimitDatain interfaceAccountService
-
getUserAccountsBalanceLimits
public List<AccountBalanceLimitVO> getUserAccountsBalanceLimits(UserLocatorVO userLocator) throws FrameworkException
Description copied from interface:AccountServiceReturns the user accounts with their upper and lower balance limits- Specified by:
getUserAccountsBalanceLimitsin interfaceAccountService- Throws:
FrameworkException
-
getUserAccountsPaymentAmountLimits
public List<AccountPaymentAmountLimitVO> getUserAccountsPaymentAmountLimits(UserLocatorVO userLocator) throws FrameworkException
Description copied from interface:AccountServiceReturns the user accounts with their upper and lower balance limits- Specified by:
getUserAccountsPaymentAmountLimitsin interfaceAccountService- Throws:
FrameworkException
-
getUsersWithBalancesOverview
public UsersWithBalancesOverview getUsersWithBalancesOverview(UserWithBalanceQuery params) throws FrameworkException, QueryParseException
Description copied from interface:AccountServiceReturns the overview of users with balances according to the given query- Specified by:
getUsersWithBalancesOverviewin interfaceAccountService- Throws:
FrameworkExceptionQueryParseException
-
getUserWithBalanceSearchData
public UserWithBalanceSearchData getUserWithBalanceSearchData() throws FrameworkException
Description copied from interface:AccountServiceReturns data to search for users with balances- Specified by:
getUserWithBalanceSearchDatain interfaceAccountService- Throws:
FrameworkException
-
isAccessible
public boolean isAccessible(Account account)
-
isAccessible
public boolean isAccessible(AccountLocator locator)
-
isAccessible
public boolean isAccessible(AccountVO account)
-
isAccessible
public boolean isAccessible(InternalAccountOwner owner, AccountType type)
-
load
public AccountWithCurrencyVO load(Long id) throws EntityNotFoundException
Description copied from interface:AccountServiceLoads an account by id- Specified by:
loadin interfaceAccountService- Throws:
EntityNotFoundException
-
searchAccountBalanceLimitsOverview
public Page<AccountBalanceLimitVO> searchAccountBalanceLimitsOverview(AccountBalanceLimitsOverviewQuery params)
Description copied from interface:AccountServiceOverview search of account balance limits- Specified by:
searchAccountBalanceLimitsOverviewin interfaceAccountService
-
searchAccountHistoriesOverview
public Page<AccountHistoryOverviewEntryVO> searchAccountHistoriesOverview(AccountHistoriesOverviewQuery params)
Description copied from interface:AccountServiceAccount histories overview filtered by the specified query parameters.- Specified by:
searchAccountHistoriesOverviewin interfaceAccountService
-
searchAccountHistory
public Page<AccountHistoryEntryVO> searchAccountHistory(AccountHistoryQuery params)
Description copied from interface:AccountServiceSearches the history entries of a required visible account according to the given query parameters. For searching on multiple accounts seeAccountService.searchAccountHistoriesOverview(AccountHistoriesOverviewQuery)- Specified by:
searchAccountHistoryin interfaceAccountService
-
searchAccountPaymentAmountLimitsOverview
public Page<AccountPaymentAmountLimitVO> searchAccountPaymentAmountLimitsOverview(AccountPaymentAmountLimitsOverviewQuery params)
Description copied from interface:AccountServiceOverview search of account balance limits- Specified by:
searchAccountPaymentAmountLimitsOverviewin interfaceAccountService
-
searchUsersWithBalances
public Page<UserWithBalanceVO> searchUsersWithBalances(UserWithBalanceQuery params) throws FrameworkException
Description copied from interface:AccountServiceSearches for users together with their respective account balances- Specified by:
searchUsersWithBalancesin interfaceAccountService- Throws:
FrameworkException
-
setBalanceLimit
public void setBalanceLimit(AccountBalanceLimitDTO data)
Description copied from interface:AccountServiceChange limits of an account- Specified by:
setBalanceLimitin interfaceAccountService
-
setPaymentAmountLimit
public void setPaymentAmountLimit(AccountPaymentAmountLimitDTO data)
Description copied from interface:AccountServiceChange limits of an account- Specified by:
setPaymentAmountLimitin interfaceAccountService
-
checkAccountHistoriesOverviewQuery
protected void checkAccountHistoriesOverviewQuery(AccountHistoriesOverviewQuery params)
-
checkAccountHistoryQuery
protected void checkAccountHistoryQuery(AccountHistoryQuery params)
-
checkAccountLimitsOverviewQuery
protected void checkAccountLimitsOverviewQuery(AccountLimitsOverviewQuery params)
-
resolveEntityCheck
protected EntityCheck<?> resolveEntityCheck()
Description copied from class:BaseServiceSecurityMust be implemented in order to return theEntityCheckmanaged by this security component, or null if none- Specified by:
resolveEntityCheckin classBaseServiceSecurity
-
-