Package org.cyclos.security.banking
Class TransactionServiceSecurity
- java.lang.Object
-
- org.cyclos.impl.AbstractServerComponent
-
- org.cyclos.impl.AbstractNetworkedServerComponent
-
- org.cyclos.security.BaseServiceSecurity
-
- org.cyclos.security.banking.TransactionServiceSecurity
-
- All Implemented Interfaces:
TransactionService,Service
@Security public class TransactionServiceSecurity extends BaseServiceSecurity implements TransactionService
Security layer forTransactionService
-
-
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
-
-
Constructor Summary
Constructors Constructor Description TransactionServiceSecurity()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcheckBaseTransactionQuery(BaseTransactionQuery query)PaymentTransferTypecheckPerform(CalculateInstallmentsDTO params)PaymentTransferTypecheckPerform(PerformInternalTransactionDTO params)voidcheckQuery(BaseTransactionQuery query)Makes sure that if some authorization status is set, the user has permission to view authorized (returning if true), and check and filter accessible accountsPaymentTransferTypecheckReceive(CalculateInstallmentsDTO parameters)PaymentTransferTypecheckReceive(PerformInternalTransactionDTO parameters)DeviceConfirmationVOcreateDeviceConfirmationForReceive(@NotNull PerformInternalTransactionDTO parameters)Creates a new pending for approval device confirmation for the payer.SerializableInputStreamdeviceConfirmationBarcodeForReceive(InternalAccountOwner payer, DeviceConfirmationBarcodeParams params)Generates a two-dimensional barcode (QR code), only if the confirmation was not already approved nor rejected for the given payer.protected voiddoInitialize()FileInfoexportInstallments(@NotNull ExportFormatVO format, @NotNull InstallmentQuery query)Exports a installments search results to fileFileInfoexportInstallmentsOverview(@NotNull ExportFormatVO format, @NotNull InstallmentOverviewQuery query)Exports an installments overview search results to fileFileInfoexportOverview(@NotNull ExportFormatVO format, @NotNull TransactionOverviewQuery query)Exports a transaction overview search results to fileFileInfoexportTransaction(@NotNull ExportFormatVO format, @NotNull TransactionVO transaction)Exports the details of a given transaction to fileFileInfoexportTransactions(@NotNull ExportFormatVO format, @NotNull TransactionQuery query)Exports a transactions search results to fileTransactionDatagetData(TransactionVO vo)Returns data for a transactionInstallmentOverviewSearchDatagetInstallmentsOverviewSearchData()Returns data for searching installments overviewInstallmentSearchDatagetInstallmentsSearchData(InternalAccountOwner owner)Returns data for searching installments from an account owner perspectivePage<MaturityTableItemData>getMaturityTable(MaturityTableQuery query)returns the maturity table which the user can view in case of paying with a zero d-rate of an earlier account state, when MaturityPolicy.HISTORY is valid.TransactionOverviewSearchDatagetOverviewSearchData(boolean pendingMyAuthorization)Returns data used to search for transaction overviewPerformPaymentDatagetPaymentData(InternalAccountOwner from, InternalAccountOwner to, TransferTypeVO paymentType)Returns data used to prepare a payment matching the given from / to account owners.PerformPaymentToOwnerDatagetPaymentToOwnerData(InternalAccountOwner from, InternalAccountOwner to, TransferTypeVO transferType)Returns simplified data used to prepare a payment matching the given argumentsPerformPaymentTypeDatagetPaymentTypeData(InternalAccountOwner from, InternalAccountOwner to, TransferTypeVO transferTypeVO)Returns the data related to a payment type for a paymentReceivePaymentDatagetReceivePaymentData()Returns data used to receive a paymentReceivePaymentFromUserDatagetReceivePaymentFromUserData(UserLocatorVO locator, TransferTypeVO paymentType)Returns data used to receive a payment from a specific user.PerformPaymentTypeDatagetReceivePaymentTypeData(UserLocatorVO locator, TransferTypeVO transferTypeVO)Returns the data related to a payment type for receiving a payment from a specific user and payment typeTransactionSearchDatagetSearchData(InternalAccountOwner owner)Returns data used to search for transactions for the given ownerbooleanisAccessible(Transaction transaction)TransactionVOload(Long id)Loads a transaction details by id, returning a proper detailed implementation (for example,PaymentVOorScheduledPaymentVO).TransactionVOloadByTransactionNumber(String transactionNumber)Returns a transfer by transaction number, or throwsEntityNotFoundExceptionif not found<D extends TransactionData>
DpostProcess(Transaction transaction, D data)This method must be invoked by the service security of eachTransactionNatureTransferVOprocessInstallment(InstallmentActionDTO action)Settles an installment.voidremoveDeviceConfirmationForReceive(String deviceConfirmationId, @NotNull PerformInternalTransactionDTO parameters)Removes a confirmation for the payer.voidrequestNewOTPForReceive(PerformInternalTransactionDTO parameters, SendMedium medium)Generates a new OTP (removing any previous password, if any) and sends it to the payer by the specified medium using the confirmation password type for theBuiltInChannel.POSchannel for the specified payer.
It has the same security controls as forPaymentService.receive(PerformPaymentDTO), that is the logged user must be allowed to receive payments from the specified payer.protected EntityCheck<?>resolveEntityCheck()Must be implemented in order to return theEntityCheckmanaged by this security component, or null if nonePage<TransactionResultVO>search(TransactionQuery query)Searches for transactions from the point-of-view of a given account owner, according to the given queryPage<InstallmentResultVO>searchInstallments(InstallmentQuery query)Searches for installments from an account owner perspective, according to the given queryPage<InstallmentResultVO>searchInstallmentsOverview(InstallmentOverviewQuery query)Searches for installments overview, according to the given queryPage<TransactionResultVO>searchOverview(TransactionOverviewQuery query)Searches for transactions, according to the given queryvoidsettleInstallment(InstallmentActionDTO action)Settles an installment.DeviceConfirmationVOviewDeviceConfirmationForReceive(String deviceConfirmationId, @NotNull PerformInternalTransactionDTO parameters)Loads the details of a confirmation belonging to the payment payer.-
Methods inherited from class org.cyclos.security.BaseServiceSecurity
checkGuest, checkId, checkIds, checkInternalName, checkLoggedIn, checkManagesUser, checkRelatesToUser, checkScope, checkVO, checkVOs, 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
-
checkBaseTransactionQuery
public void checkBaseTransactionQuery(BaseTransactionQuery query)
-
checkPerform
public PaymentTransferType checkPerform(CalculateInstallmentsDTO params)
-
checkPerform
public PaymentTransferType checkPerform(PerformInternalTransactionDTO params)
-
checkQuery
public void checkQuery(BaseTransactionQuery query)
Makes sure that if some authorization status is set, the user has permission to view authorized (returning if true), and check and filter accessible accounts
-
checkReceive
public PaymentTransferType checkReceive(CalculateInstallmentsDTO parameters)
-
checkReceive
public PaymentTransferType checkReceive(PerformInternalTransactionDTO parameters)
-
createDeviceConfirmationForReceive
public DeviceConfirmationVO createDeviceConfirmationForReceive(@NotNull @NotNull PerformInternalTransactionDTO parameters) throws FrameworkException
Description copied from interface:TransactionServiceCreates a new pending for approval device confirmation for the payer. It has the same security controls as forPaymentService.receive(PerformPaymentDTO), that is the logged user must be allowed to receive payments from the specified payer.- Specified by:
createDeviceConfirmationForReceivein interfaceTransactionService- Throws:
FrameworkException
-
deviceConfirmationBarcodeForReceive
public SerializableInputStream deviceConfirmationBarcodeForReceive(InternalAccountOwner payer, DeviceConfirmationBarcodeParams params) throws FrameworkException
Description copied from interface:TransactionServiceGenerates a two-dimensional barcode (QR code), only if the confirmation was not already approved nor rejected for the given payer. The logged use must be allowed to locate for receive the payer.- Specified by:
deviceConfirmationBarcodeForReceivein interfaceTransactionService- Throws:
FrameworkException
-
exportInstallments
public FileInfo exportInstallments(@NotNull @NotNull ExportFormatVO format, @NotNull @NotNull InstallmentQuery query)
Description copied from interface:TransactionServiceExports a installments search results to file- Specified by:
exportInstallmentsin interfaceTransactionService
-
exportInstallmentsOverview
public FileInfo exportInstallmentsOverview(@NotNull @NotNull ExportFormatVO format, @NotNull @NotNull InstallmentOverviewQuery query)
Description copied from interface:TransactionServiceExports an installments overview search results to file- Specified by:
exportInstallmentsOverviewin interfaceTransactionService
-
exportOverview
public FileInfo exportOverview(@NotNull @NotNull ExportFormatVO format, @NotNull @NotNull TransactionOverviewQuery query)
Description copied from interface:TransactionServiceExports a transaction overview search results to file- Specified by:
exportOverviewin interfaceTransactionService
-
exportTransaction
public FileInfo exportTransaction(@NotNull @NotNull ExportFormatVO format, @NotNull @NotNull TransactionVO transaction) throws FrameworkException
Description copied from interface:TransactionServiceExports the details of a given transaction to file- Specified by:
exportTransactionin interfaceTransactionService- Throws:
FrameworkException
-
exportTransactions
public FileInfo exportTransactions(@NotNull @NotNull ExportFormatVO format, @NotNull @NotNull TransactionQuery query)
Description copied from interface:TransactionServiceExports a transactions search results to file- Specified by:
exportTransactionsin interfaceTransactionService
-
getData
public TransactionData getData(TransactionVO vo) throws FrameworkException
Description copied from interface:TransactionServiceReturns data for a transaction- Specified by:
getDatain interfaceTransactionService- Throws:
FrameworkException
-
getInstallmentsOverviewSearchData
public InstallmentOverviewSearchData getInstallmentsOverviewSearchData() throws FrameworkException
Description copied from interface:TransactionServiceReturns data for searching installments overview- Specified by:
getInstallmentsOverviewSearchDatain interfaceTransactionService- Throws:
FrameworkException
-
getInstallmentsSearchData
public InstallmentSearchData getInstallmentsSearchData(InternalAccountOwner owner) throws FrameworkException
Description copied from interface:TransactionServiceReturns data for searching installments from an account owner perspective- Specified by:
getInstallmentsSearchDatain interfaceTransactionService- Throws:
FrameworkException
-
getMaturityTable
public Page<MaturityTableItemData> getMaturityTable(MaturityTableQuery query)
Description copied from interface:TransactionServicereturns the maturity table which the user can view in case of paying with a zero d-rate of an earlier account state, when MaturityPolicy.HISTORY is valid.- Specified by:
getMaturityTablein interfaceTransactionService
-
getOverviewSearchData
public TransactionOverviewSearchData getOverviewSearchData(boolean pendingMyAuthorization) throws FrameworkException
Description copied from interface:TransactionServiceReturns data used to search for transaction overview- Specified by:
getOverviewSearchDatain interfaceTransactionService- Throws:
FrameworkException
-
getPaymentData
public PerformPaymentData getPaymentData(InternalAccountOwner from, InternalAccountOwner to, TransferTypeVO paymentType) throws FrameworkException
Description copied from interface:TransactionServiceReturns data used to prepare a payment matching the given from / to account owners. The given payment type is optional. If not passed in, will return detailed data for the first available payment type. If passed in, will return detailed data for that payment type, and must be valid.- Specified by:
getPaymentDatain interfaceTransactionService- Throws:
FrameworkException
-
getPaymentToOwnerData
public PerformPaymentToOwnerData getPaymentToOwnerData(InternalAccountOwner from, InternalAccountOwner to, TransferTypeVO transferType) throws FrameworkException
Description copied from interface:TransactionServiceReturns simplified data used to prepare a payment matching the given arguments- Specified by:
getPaymentToOwnerDatain interfaceTransactionService- Throws:
FrameworkException
-
getPaymentTypeData
public PerformPaymentTypeData getPaymentTypeData(InternalAccountOwner from, InternalAccountOwner to, TransferTypeVO transferTypeVO) throws FrameworkException
Description copied from interface:TransactionServiceReturns the data related to a payment type for a payment- Specified by:
getPaymentTypeDatain interfaceTransactionService- Throws:
FrameworkException
-
getReceivePaymentData
public ReceivePaymentData getReceivePaymentData() throws FrameworkException
Description copied from interface:TransactionServiceReturns data used to receive a payment- Specified by:
getReceivePaymentDatain interfaceTransactionService- Throws:
FrameworkException
-
getReceivePaymentFromUserData
public ReceivePaymentFromUserData getReceivePaymentFromUserData(UserLocatorVO locator, TransferTypeVO paymentType) throws FrameworkException
Description copied from interface:TransactionServiceReturns data used to receive a payment from a specific user. The given payment type is optional. If not passed in, will return detailed data for the first available payment type. If passed in, will return detailed data for that payment type, and must be valid.- Specified by:
getReceivePaymentFromUserDatain interfaceTransactionService- Throws:
FrameworkException
-
getReceivePaymentTypeData
public PerformPaymentTypeData getReceivePaymentTypeData(UserLocatorVO locator, TransferTypeVO transferTypeVO) throws FrameworkException
Description copied from interface:TransactionServiceReturns the data related to a payment type for receiving a payment from a specific user and payment type- Specified by:
getReceivePaymentTypeDatain interfaceTransactionService- Throws:
FrameworkException
-
getSearchData
public TransactionSearchData getSearchData(InternalAccountOwner owner) throws FrameworkException
Description copied from interface:TransactionServiceReturns data used to search for transactions for the given owner- Specified by:
getSearchDatain interfaceTransactionService- Throws:
FrameworkException
-
isAccessible
public boolean isAccessible(Transaction transaction)
-
load
public TransactionVO load(Long id) throws FrameworkException
Description copied from interface:TransactionServiceLoads a transaction details by id, returning a proper detailed implementation (for example,PaymentVOorScheduledPaymentVO).- Specified by:
loadin interfaceTransactionService- Throws:
FrameworkException
-
loadByTransactionNumber
public TransactionVO loadByTransactionNumber(String transactionNumber) throws FrameworkException
Description copied from interface:TransactionServiceReturns a transfer by transaction number, or throwsEntityNotFoundExceptionif not found- Specified by:
loadByTransactionNumberin interfaceTransactionService- Throws:
FrameworkException
-
postProcess
public <D extends TransactionData> D postProcess(Transaction transaction, D data)
This method must be invoked by the service security of eachTransactionNature
-
processInstallment
public TransferVO processInstallment(InstallmentActionDTO action) throws FrameworkException
Description copied from interface:TransactionServiceSettles an installment. Currently only scheduled payment installments can be settled.- Specified by:
processInstallmentin interfaceTransactionService- Throws:
FrameworkException
-
removeDeviceConfirmationForReceive
public void removeDeviceConfirmationForReceive(String deviceConfirmationId, @NotNull @NotNull PerformInternalTransactionDTO parameters) throws FrameworkException
Description copied from interface:TransactionServiceRemoves a confirmation for the payer. It has the same security controls as forPaymentService.receive(PerformPaymentDTO), that is the logged user must be allowed to receive payments from the specified payer.- Specified by:
removeDeviceConfirmationForReceivein interfaceTransactionService- Throws:
FrameworkException
-
requestNewOTPForReceive
public void requestNewOTPForReceive(PerformInternalTransactionDTO parameters, SendMedium medium) throws FrameworkException, SmsSendingException
Description copied from interface:TransactionServiceGenerates a new OTP (removing any previous password, if any) and sends it to the payer by the specified medium using the confirmation password type for theBuiltInChannel.POSchannel for the specified payer.
It has the same security controls as forPaymentService.receive(PerformPaymentDTO), that is the logged user must be allowed to receive payments from the specified payer.- Specified by:
requestNewOTPForReceivein interfaceTransactionService- Parameters:
parameters- the payment to be received.medium- the medium used to send the OTP.- Throws:
SmsSendingException- only if medium isSendMedium.SMSand the OTP could not be sent to any enabled for sms phone.FrameworkException
-
search
public Page<TransactionResultVO> search(TransactionQuery query) throws FrameworkException
Description copied from interface:TransactionServiceSearches for transactions from the point-of-view of a given account owner, according to the given query- Specified by:
searchin interfaceTransactionService- Throws:
FrameworkException
-
searchInstallments
public Page<InstallmentResultVO> searchInstallments(InstallmentQuery query) throws FrameworkException
Description copied from interface:TransactionServiceSearches for installments from an account owner perspective, according to the given query- Specified by:
searchInstallmentsin interfaceTransactionService- Throws:
FrameworkException
-
searchInstallmentsOverview
public Page<InstallmentResultVO> searchInstallmentsOverview(InstallmentOverviewQuery query) throws FrameworkException
Description copied from interface:TransactionServiceSearches for installments overview, according to the given query- Specified by:
searchInstallmentsOverviewin interfaceTransactionService- Throws:
FrameworkException
-
searchOverview
public Page<TransactionResultVO> searchOverview(TransactionOverviewQuery query) throws FrameworkException
Description copied from interface:TransactionServiceSearches for transactions, according to the given query- Specified by:
searchOverviewin interfaceTransactionService- Throws:
FrameworkException
-
settleInstallment
public void settleInstallment(InstallmentActionDTO action) throws FrameworkException
Description copied from interface:TransactionServiceSettles an installment. Currently only scheduled payment installments can be settled.- Specified by:
settleInstallmentin interfaceTransactionService- Throws:
FrameworkException
-
viewDeviceConfirmationForReceive
public DeviceConfirmationVO viewDeviceConfirmationForReceive(String deviceConfirmationId, @NotNull @NotNull PerformInternalTransactionDTO parameters) throws FrameworkException
Description copied from interface:TransactionServiceLoads the details of a confirmation belonging to the payment payer. It has the same security controls as forPaymentService.receive(PerformPaymentDTO), that is the logged user must be allowed to receive payments from the specified payer.- Specified by:
viewDeviceConfirmationForReceivein interfaceTransactionService- Throws:
FrameworkException
-
doInitialize
protected void doInitialize()
- Overrides:
doInitializein classBaseServiceSecurity
-
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
-
-