Package org.cyclos.impl.banking
Class TransferServiceImpl
- java.lang.Object
-
- org.cyclos.impl.AbstractServerComponent
-
- org.cyclos.impl.AbstractNetworkedServerComponent
-
- org.cyclos.impl.BaseServiceImpl
-
- org.cyclos.impl.banking.TransferServiceImpl
-
- All Implemented Interfaces:
TransferServiceLocal,TransferService,Service
@Service public class TransferServiceImpl extends BaseServiceImpl implements TransferServiceLocal
Implementation forTransferService
-
-
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 TransferServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FileInfoexportTransfer(ExportFormatVO formatVO, TransferVO transferVO)Exports the given transfer to fileTransferfindByTransactionNumber(String transactionNumber)Returns a transfer by transaction number, or throwsEntityNotFoundExceptionif not foundTransferDatagetData(Transfer transfer)Returns details data for the given transferTransferDatagetData(TransferVO vo)Returns details data for a transferStringgetDescription(Transfer transfer)Returns the description of the given transfer.List<Transfer>getRatedTransfers(Account account, int numberOfIncoming)gets a List of transfers with the following properties: transfers are from or toownerlist containsnumberOfIncomingincoming transactions, where: transfers which are charged back, or which are a chargeback of another transfer, do not count for thenumberOfIncomingchild transfers are not counted, only their parents count (for 1).List<Transfer>getTransfers(Account account, DatePeriod period, boolean includeChargebacks)Gets a List of Transfers, depending on the parameters.TransferSummarygetTransferSummary(GetTransferSummaryParameters params)Returns a transaction summary for payments with the given characteristicsAccountFeeTransferinsertAccountFeeTransfer(UserAccountFeeLog userAccountFeeLog)Inserts the transfer for charging an account feeChargebackTransferinsertChargebackTransfer(Chargeback chargeback, Transfer toChargeback)Inserts a transfer to chargeback another transferImportTransferinsertImportTransfer(ImportTransaction importTransaction, Set<TransferStatus> statuses)Inserts an import transfer with the given statuses.InitialCreditTransferinsertInitialCreditTransfer(UserAccount account, GeneratedTransferType transferType, BigDecimal amount)Inserts the initial credit for the given user account, returning the generated transferInstallmentTransferinsertInstallmentTransfer(Installment installment)Inserts the transfer for processing the given installmentPaymentTransferinsertPaymentTransfer(Payment payment)Inserts the transfer for the given paymentbooleanisVisible(Trans trans)Returns whether the logged user can see the givenTrans(transfer / transaction)TransferVOload(Long id)Returns a transfer by id, or throwsEntityNotFoundExceptionif not foundTransferVOloadByTransactionNumber(String transactionNumber)Returns a transfer by transaction number, or throwsEntityNotFoundExceptionif not foundvoidnotifyTransferReceived(Transfer transfer)Send all notifications derived from a transfer creation.protected voidregisterNetworkMappings(NetworkPathRegistry networkPathRegistry)Needs to be overridden by subclasses to register the path up to the network-
Methods inherited from class org.cyclos.impl.BaseServiceImpl
initializeNetworkMappings
-
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
-
exportTransfer
public FileInfo exportTransfer(ExportFormatVO formatVO, TransferVO transferVO)
Description copied from interface:TransferServiceExports the given transfer to file- Specified by:
exportTransferin interfaceTransferService
-
findByTransactionNumber
public Transfer findByTransactionNumber(String transactionNumber) throws FrameworkException
Description copied from interface:TransferServiceLocalReturns a transfer by transaction number, or throwsEntityNotFoundExceptionif not found- Specified by:
findByTransactionNumberin interfaceTransferServiceLocal- Throws:
FrameworkException
-
getData
public TransferData getData(Transfer transfer) throws FrameworkException
Description copied from interface:TransferServiceLocalReturns details data for the given transfer- Specified by:
getDatain interfaceTransferServiceLocal- Throws:
FrameworkException
-
getData
public TransferData getData(TransferVO vo) throws IllegalArgumentException
Description copied from interface:TransferServiceReturns details data for a transfer- Specified by:
getDatain interfaceTransferService- Throws:
IllegalArgumentException
-
getDescription
public String getDescription(Transfer transfer)
Description copied from interface:TransferServiceLocalReturns the description of the given transfer. If there is an associated transaction, and it has a description, return it. Otherwise returns the (translated) transfer type name.- Specified by:
getDescriptionin interfaceTransferServiceLocal
-
getRatedTransfers
public List<Transfer> getRatedTransfers(Account account, int numberOfIncoming)
Description copied from interface:TransferServiceLocalgets a List of transfers with the following properties:- transfers are from or to
owner - list contains
numberOfIncomingincoming transactions, where:- transfers which are charged back, or which are a chargeback of another transfer, do not count for the
numberOfIncoming - child transfers are not counted, only their parents count (for 1).
- transfers which are charged back, or which are a chargeback of another transfer, do not count for the
- order is from new to old, and it includes exactly the
numberOfIncomingmost recent incoming transfers. - all transfers in between are listed too, even if they don't count for the
numberOfIncominggoal. So outgoing transfers and chargebacks are included. - list only contains elements if the D-rate is enabled now. If D-rate is not enabled, an empty list is returned.
- all included tranfers are D-rate enabled. Tranfers from before the enabling date of the present D-rate are
NOT included, even when that
means that the
numberOfIncominggoal is not reached.
- Specified by:
getRatedTransfersin interfaceTransferServiceLocal- Parameters:
account- , may not be null- Returns:
- the list of transfers. Never returns null; if conditons are not met an emtpy list is returned.
- transfers are from or to
-
getTransfers
public List<Transfer> getTransfers(Account account, DatePeriod period, boolean includeChargebacks)
Description copied from interface:TransferServiceLocalGets a List of Transfers, depending on the parameters.- Specified by:
getTransfersin interfaceTransferServiceLocal
-
getTransferSummary
public TransferSummary getTransferSummary(GetTransferSummaryParameters params)
Description copied from interface:TransferServiceLocalReturns a transaction summary for payments with the given characteristics- Specified by:
getTransferSummaryin interfaceTransferServiceLocal
-
insertAccountFeeTransfer
public AccountFeeTransfer insertAccountFeeTransfer(UserAccountFeeLog userAccountFeeLog)
Description copied from interface:TransferServiceLocalInserts the transfer for charging an account fee- Specified by:
insertAccountFeeTransferin interfaceTransferServiceLocal
-
insertChargebackTransfer
public ChargebackTransfer insertChargebackTransfer(Chargeback chargeback, Transfer toChargeback)
Description copied from interface:TransferServiceLocalInserts a transfer to chargeback another transfer- Specified by:
insertChargebackTransferin interfaceTransferServiceLocal
-
insertImportTransfer
public ImportTransfer insertImportTransfer(ImportTransaction importTransaction, Set<TransferStatus> statuses)
Description copied from interface:TransferServiceLocalInserts an import transfer with the given statuses. No fees are processed.- Specified by:
insertImportTransferin interfaceTransferServiceLocal
-
insertInitialCreditTransfer
public InitialCreditTransfer insertInitialCreditTransfer(UserAccount account, GeneratedTransferType transferType, BigDecimal amount) throws FrameworkException, TransferException
Description copied from interface:TransferServiceLocalInserts the initial credit for the given user account, returning the generated transfer- Specified by:
insertInitialCreditTransferin interfaceTransferServiceLocal- Throws:
FrameworkExceptionTransferException
-
insertInstallmentTransfer
public InstallmentTransfer insertInstallmentTransfer(Installment installment)
Description copied from interface:TransferServiceLocalInserts the transfer for processing the given installment- Specified by:
insertInstallmentTransferin interfaceTransferServiceLocal
-
insertPaymentTransfer
public PaymentTransfer insertPaymentTransfer(Payment payment) throws FrameworkException, TransferException
Description copied from interface:TransferServiceLocalInserts the transfer for the given payment- Specified by:
insertPaymentTransferin interfaceTransferServiceLocal- Throws:
FrameworkExceptionTransferException
-
isVisible
public boolean isVisible(Trans trans) throws FrameworkException
Description copied from interface:TransferServiceLocalReturns whether the logged user can see the givenTrans(transfer / transaction)- Specified by:
isVisiblein interfaceTransferServiceLocal- Throws:
FrameworkException
-
load
public TransferVO load(Long id) throws FrameworkException
Description copied from interface:TransferServiceReturns a transfer by id, or throwsEntityNotFoundExceptionif not found- Specified by:
loadin interfaceTransferService- Throws:
FrameworkException
-
loadByTransactionNumber
public TransferVO loadByTransactionNumber(String transactionNumber) throws FrameworkException
Description copied from interface:TransferServiceReturns a transfer by transaction number, or throwsEntityNotFoundExceptionif not found- Specified by:
loadByTransactionNumberin interfaceTransferService- Throws:
FrameworkException
-
notifyTransferReceived
public void notifyTransferReceived(Transfer transfer)
Description copied from interface:TransferServiceLocalSend all notifications derived from a transfer creation. E.g notifies the receiver user- Specified by:
notifyTransferReceivedin interfaceTransferServiceLocal
-
registerNetworkMappings
protected void registerNetworkMappings(NetworkPathRegistry networkPathRegistry)
Description copied from class:BaseServiceImplNeeds to be overridden by subclasses to register the path up to the network- Specified by:
registerNetworkMappingsin classBaseServiceImpl
-
-