Package org.cyclos.impl.banking
Class TransferTypeServiceImpl
- java.lang.Object
-
- org.cyclos.impl.AbstractServerComponent
-
- org.cyclos.impl.AbstractNetworkedServerComponent
-
- org.cyclos.impl.BaseServiceImpl
-
- org.cyclos.impl.CRUDServiceImpl<TransferType,QTransferType,TransferTypeDTO,TransferTypeData,TransferTypeDataParams>
-
- org.cyclos.impl.banking.TransferTypeServiceImpl
-
- All Implemented Interfaces:
TransferTypeServiceLocal,CRUDServiceLocal<TransferType,TransferTypeDTO,TransferTypeData,TransferTypeDataParams>,TransferTypeService,CRUDService<TransferTypeDTO,TransferTypeData,TransferTypeDataParams>,CRUDWithConfirmationPasswordService<TransferTypeDTO,TransferTypeData,TransferTypeDataParams>,Service
@Service public class TransferTypeServiceImpl extends CRUDServiceImpl<TransferType,QTransferType,TransferTypeDTO,TransferTypeData,TransferTypeDataParams> implements TransferTypeServiceLocal
implementation forTransferTypeService
-
-
Field Summary
-
Fields inherited from class org.cyclos.impl.CRUDServiceImpl
$, ATTR_CURRENT_COPY, dtoClass, entityClass, extensionPointService, idPath, internalNamePath, namePath, ownerEntityIdPath, ownerEntityPath, ownerEntityPropertyName, passwordHandler, richTextHandler, withConfirmationPassword
-
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 TransferTypeServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected TransferTypeDatagetData(TransferType transferType)Returns details data for the given entityvoidinitialize()booleanisPaymentTypePossible(InternalAccountOwner from, AccountOwner to, PaymentTransferType paymentType)Returns whether the given payment type can be used for payments between the given account ownersTransferTypenewEntity(TransferTypeDataParams params)Should be implemented in order to instantiate a new entity based on the given context parametersprotected voidonAfterSave(TransferType transferType, TransferType currentCopy, Object dataFromOnBeforeSave)May be overridden in order to perform custom logic after saving an entityprotected voidonBeforeRemove(TransferType tt)May be overridden in order to perform custom logic before removing an entityprotected ObjectonBeforeSave(TransferType tt, TransferType currentCopy)May be overridden in order to perform custom logic before saving an entity.protected voidpreProcessCurrentCopy(TransferTypeDTO dto, TransferType currentCopy)This method is invoked before saving the entity and also, if the log is enabled, before removing.protected voidregisterNetworkMappings(NetworkPathRegistry networkPathRegistry)Needs to be overridden by subclasses to register the path up to the networkvoidresetAllMaturityPolicy(Currency currency)resets the maturity Policy to MaturityPolicy.ALWAYS for all TT's attached to the given currency.TransferTypeDirectionresolveDirection(AccountType from, AccountType to)Determines the payment direction for the given from and to account types.TransferTypeDirectionresolveDirection(InternalAccountOwner from, AccountOwner to)Determines the payment direction for the given from and to ownerprotected ValidatorresolveValidator(TransferTypeDTO dto)<T> Page<T>search(Class<T> resultType, TransferTypeQuery params)Performs the search depending on the priority parameterPage<TransferTypeVO>search(TransferTypeQuery query)Searches for transfer types, according to the specified query parametersPage<PaymentTransferType>searchExternalPayment(PaymentTransferTypeQuery query)Searches payment types for external payment requestsPage<PaymentTransferType>searchPayment(PaymentTransferTypeQuery paymentTransferTypeQuery)Searches payment types for direct paymentsPage<PaymentTransferType>searchPaymentRequest(PaymentTransferTypeQuery paymentTransferTypeQuery)Searches payment types for payment requestsPage<PaymentTransferType>searchTicket(PaymentTransferTypeQuery query)Searches payment types for ticketsprotected org.apache.commons.collections4.BidiMap<Class<? extends TransferType>,Class<? extends TransferTypeDTO>>subClassMappings()Should be overridden by subclasses which handle entity / dto hierarchies.TransferTypetoEntity(TransferTypeDTO dto)Converts the given DTO in an entity, handling theCRUDServiceImpl.subClassMappings()mappings for subclasses-
Methods inherited from class org.cyclos.impl.CRUDServiceImpl
addCustomInternalNameValidations, addCustomNameValidations, checkConfirmationPassword, doRemove, find, findAll, from, getConfirmationPasswordInput, getConfirmationPasswordInputForRemove, getData, getDataForNew, getDeviceConfirmationParams, getEntityClass, getEntityInternalNameKey, getExcludedPropertiesToDTO, getExcludedPropertiesToEntity, getNameLabel, getUniqueInternalNameQuery, getUniqueNameQuery, isEntityInternalNameRequired, isNameRequired, load, logEntity, onAfterRemove, remove, remove, removeAll, removeAll, removeAllWithConfirmationPassword, removeWithConfirmationPassword, resolveDTOType, resolveEntityType, resolveExtensionPointAccessor, save, saveOrder, saveSkippingEntityLog, saveWithConfirmationPassword, shouldCheckConfirmationPassword, toDTO, validate
-
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
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.cyclos.services.CRUDService
getData, getDataForNew, load, remove, removeAll, save
-
Methods inherited from interface org.cyclos.impl.CRUDServiceLocal
find, findAll, getEntityClass, remove, removeAll, saveEntity, saveSkippingEntityLog, toDTO, validate
-
-
-
-
Method Detail
-
initialize
@PostConstruct public void initialize()
-
isPaymentTypePossible
public boolean isPaymentTypePossible(InternalAccountOwner from, AccountOwner to, PaymentTransferType paymentType) throws FrameworkException
Description copied from interface:TransferTypeServiceLocalReturns whether the given payment type can be used for payments between the given account owners- Specified by:
isPaymentTypePossiblein interfaceTransferTypeServiceLocal- Throws:
FrameworkException
-
newEntity
public TransferType newEntity(TransferTypeDataParams params)
Description copied from class:CRUDServiceImplShould be implemented in order to instantiate a new entity based on the given context parameters- Specified by:
newEntityin interfaceCRUDServiceLocal<TransferType,TransferTypeDTO,TransferTypeData,TransferTypeDataParams>- Specified by:
newEntityin classCRUDServiceImpl<TransferType,QTransferType,TransferTypeDTO,TransferTypeData,TransferTypeDataParams>
-
resetAllMaturityPolicy
public void resetAllMaturityPolicy(Currency currency)
Description copied from interface:TransferTypeServiceLocalresets the maturity Policy to MaturityPolicy.ALWAYS for all TT's attached to the given currency.- Specified by:
resetAllMaturityPolicyin interfaceTransferTypeServiceLocal
-
resolveDirection
public TransferTypeDirection resolveDirection(AccountType from, AccountType to)
Description copied from interface:TransferTypeServiceLocalDetermines the payment direction for the given from and to account types. If there is ambiguity, in the case that both accounts are user account types, and different from each other, this method returns null, as it could either beTransferTypeDirection.USER_TO_USERorTransferTypeDirection.USER_TO_SELF- Specified by:
resolveDirectionin interfaceTransferTypeServiceLocal
-
resolveDirection
public TransferTypeDirection resolveDirection(InternalAccountOwner from, AccountOwner to)
Description copied from interface:TransferTypeServiceLocalDetermines the payment direction for the given from and to owner- Specified by:
resolveDirectionin interfaceTransferTypeServiceLocal
-
search
public <T> Page<T> search(Class<T> resultType, TransferTypeQuery params)
Performs the search depending on the priority parameter- Specified by:
searchin interfaceTransferTypeServiceLocal
-
search
public Page<TransferTypeVO> search(TransferTypeQuery query)
Description copied from interface:TransferTypeServiceSearches for transfer types, according to the specified query parameters- Specified by:
searchin interfaceTransferTypeService
-
searchExternalPayment
public Page<PaymentTransferType> searchExternalPayment(PaymentTransferTypeQuery query)
Description copied from interface:TransferTypeServiceLocalSearches payment types for external payment requests- Specified by:
searchExternalPaymentin interfaceTransferTypeServiceLocal
-
searchPayment
public Page<PaymentTransferType> searchPayment(PaymentTransferTypeQuery paymentTransferTypeQuery)
Description copied from interface:TransferTypeServiceLocalSearches payment types for direct payments- Specified by:
searchPaymentin interfaceTransferTypeServiceLocal
-
searchPaymentRequest
public Page<PaymentTransferType> searchPaymentRequest(PaymentTransferTypeQuery paymentTransferTypeQuery) throws FrameworkException
Description copied from interface:TransferTypeServiceLocalSearches payment types for payment requests- Specified by:
searchPaymentRequestin interfaceTransferTypeServiceLocal- Throws:
FrameworkException
-
searchTicket
public Page<PaymentTransferType> searchTicket(PaymentTransferTypeQuery query)
Description copied from interface:TransferTypeServiceLocalSearches payment types for tickets- Specified by:
searchTicketin interfaceTransferTypeServiceLocal
-
toEntity
public TransferType toEntity(TransferTypeDTO dto)
Description copied from class:CRUDServiceImplConverts the given DTO in an entity, handling theCRUDServiceImpl.subClassMappings()mappings for subclasses- Specified by:
toEntityin interfaceCRUDServiceLocal<TransferType,TransferTypeDTO,TransferTypeData,TransferTypeDataParams>- Overrides:
toEntityin classCRUDServiceImpl<TransferType,QTransferType,TransferTypeDTO,TransferTypeData,TransferTypeDataParams>
-
getData
protected TransferTypeData getData(TransferType transferType)
Description copied from class:CRUDServiceImplReturns details data for the given entity- Specified by:
getDatain classCRUDServiceImpl<TransferType,QTransferType,TransferTypeDTO,TransferTypeData,TransferTypeDataParams>
-
onAfterSave
protected void onAfterSave(TransferType transferType, TransferType currentCopy, Object dataFromOnBeforeSave)
Description copied from class:CRUDServiceImplMay be overridden in order to perform custom logic after saving an entity- Overrides:
onAfterSavein classCRUDServiceImpl<TransferType,QTransferType,TransferTypeDTO,TransferTypeData,TransferTypeDataParams>
-
onBeforeRemove
protected void onBeforeRemove(TransferType tt)
Description copied from class:CRUDServiceImplMay be overridden in order to perform custom logic before removing an entity- Overrides:
onBeforeRemovein classCRUDServiceImpl<TransferType,QTransferType,TransferTypeDTO,TransferTypeData,TransferTypeDataParams>
-
onBeforeSave
protected Object onBeforeSave(TransferType tt, TransferType currentCopy)
Description copied from class:CRUDServiceImplMay be overridden in order to perform custom logic before saving an entity. Any returned value will be passed to theCRUDServiceImpl.onAfterSave(BaseEntity, BaseEntity, Object)method- Overrides:
onBeforeSavein classCRUDServiceImpl<TransferType,QTransferType,TransferTypeDTO,TransferTypeData,TransferTypeDataParams>
-
preProcessCurrentCopy
protected void preProcessCurrentCopy(TransferTypeDTO dto, TransferType currentCopy)
Description copied from class:CRUDServiceImplThis method is invoked before saving the entity and also, if the log is enabled, before removing. Subclasses can override it to fetch lazy relationships, etc as the current copy will be detached. In case of removing (i.e the log is enabled for this entity) the dto parameter will be null.- Overrides:
preProcessCurrentCopyin classCRUDServiceImpl<TransferType,QTransferType,TransferTypeDTO,TransferTypeData,TransferTypeDataParams>
-
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
-
resolveValidator
protected Validator resolveValidator(TransferTypeDTO dto)
- Specified by:
resolveValidatorin classCRUDServiceImpl<TransferType,QTransferType,TransferTypeDTO,TransferTypeData,TransferTypeDataParams>
-
subClassMappings
protected org.apache.commons.collections4.BidiMap<Class<? extends TransferType>,Class<? extends TransferTypeDTO>> subClassMappings()
Description copied from class:CRUDServiceImplShould be overridden by subclasses which handle entity / dto hierarchies. The map key should be the entity class, while the map value, the DTO class- Overrides:
subClassMappingsin classCRUDServiceImpl<TransferType,QTransferType,TransferTypeDTO,TransferTypeData,TransferTypeDataParams>
-
-