Package org.cyclos.impl.banking
Class VoucherTypeServiceImpl
- java.lang.Object
-
- org.cyclos.impl.AbstractServerComponent
-
- org.cyclos.impl.AbstractNetworkedServerComponent
-
- org.cyclos.impl.BaseServiceImpl
-
- org.cyclos.impl.CRUDServiceImpl<VoucherType,QVoucherType,VoucherTypeDTO,VoucherTypeData,ConfigurationVO>
-
- org.cyclos.impl.banking.VoucherTypeServiceImpl
-
- All Implemented Interfaces:
VoucherTypeServiceLocal,CRUDServiceLocal<VoucherType,VoucherTypeDTO,VoucherTypeData,ConfigurationVO>,VoucherTypeService,CRUDService<VoucherTypeDTO,VoucherTypeData,ConfigurationVO>,CRUDWithConfirmationPasswordService<VoucherTypeDTO,VoucherTypeData,ConfigurationVO>,Service
@Service public class VoucherTypeServiceImpl extends CRUDServiceImpl<VoucherType,QVoucherType,VoucherTypeDTO,VoucherTypeData,ConfigurationVO> implements VoucherTypeServiceLocal
Implementation forVoucherTypeService
-
-
Field Summary
-
Fields inherited from class org.cyclos.impl.CRUDServiceImpl
$, ATTR_CURRENT_COPY, cacheHandler, 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 VoucherTypeServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description VoucherTypefindAny()Finds any of the voucher types or null otherwiseprotected VoucherTypeDatagetData(VoucherType type)Returns details data for the given entityprotected Object[]getExcludedPropertiesToEntity(VoucherTypeDTO dto)May be overridden in order to exclude properties when converting the given DTO to entityVoucherTypeListDatagetListData()Returns data for listing voucher typesList<VoucherTypeVO>list()Returns a list with all voucher types regardless of whether they are enabled or not or have expired.List<VoucherType>listEnabledByConfiguration(Collection<VoucherConfiguration> configurations, Boolean allowBuy)Returns the voucher types that are enabled and not expired belonging to the given configurations, optionally filtering by allow buying.List<VoucherType>listForSearchFilterByConfiguration(Collection<VoucherConfiguration> configurations)Returns the voucher types, regardless have expired or not, belonging to the given configurations.VoucherTypenewEntity(ConfigurationVO configurationVO)Should be implemented in order to instantiate a new entity based on the given context parametersprotected voidonAfterSave(VoucherType entity, VoucherType currentCopy, Object dataFromOnBeforeSave)May be overridden in order to perform custom logic after saving an entityprotected voidonBeforeRemove(VoucherType voucherType)May be overridden in order to perform custom logic before removing an entityprotected ObjectonBeforeSave(VoucherType voucherType, VoucherType currentCopy)May be overridden in order to perform custom logic before saving an entity.protected voidpreProcessCurrentCopy(VoucherTypeDTO dto, VoucherType 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 networkprotected ValidatorresolveValidator(VoucherTypeDTO dto)VoucherTypetoEntity(VoucherTypeDTO 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, getNameLabel, getUniqueInternalNameQuery, getUniqueNameQuery, isEntityInternalNameRequired, isNameRequired, load, logEntity, onAfterRemove, remove, remove, removeAll, removeAll, removeAllWithConfirmationPassword, removeWithConfirmationPassword, resolveDTOType, resolveEntityType, resolveExtensionPointAccessor, save, saveOrder, saveSkippingEntityLog, saveWithConfirmationPassword, shouldCheckConfirmationPassword, subClassMappings, 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
-
findAny
public VoucherType findAny()
Description copied from interface:VoucherTypeServiceLocalFinds any of the voucher types or null otherwise- Specified by:
findAnyin interfaceVoucherTypeServiceLocal
-
getListData
public VoucherTypeListData getListData() throws FrameworkException
Description copied from interface:VoucherTypeServiceReturns data for listing voucher types- Specified by:
getListDatain interfaceVoucherTypeService- Throws:
FrameworkException
-
list
public List<VoucherTypeVO> list() throws FrameworkException
Description copied from interface:VoucherTypeServiceReturns a list with all voucher types regardless of whether they are enabled or not or have expired.- Specified by:
listin interfaceVoucherTypeService- Throws:
FrameworkException
-
listEnabledByConfiguration
public List<VoucherType> listEnabledByConfiguration(Collection<VoucherConfiguration> configurations, Boolean allowBuy) throws FrameworkException
Description copied from interface:VoucherTypeServiceLocalReturns the voucher types that are enabled and not expired belonging to the given configurations, optionally filtering by allow buying.- Specified by:
listEnabledByConfigurationin interfaceVoucherTypeServiceLocal- Throws:
FrameworkException
-
listForSearchFilterByConfiguration
public List<VoucherType> listForSearchFilterByConfiguration(Collection<VoucherConfiguration> configurations) throws FrameworkException
Description copied from interface:VoucherTypeServiceLocalReturns the voucher types, regardless have expired or not, belonging to the given configurations. For admins it will return both enabled and disabled types- Specified by:
listForSearchFilterByConfigurationin interfaceVoucherTypeServiceLocal- Throws:
FrameworkException
-
newEntity
public VoucherType newEntity(ConfigurationVO configurationVO)
Description copied from class:CRUDServiceImplShould be implemented in order to instantiate a new entity based on the given context parameters- Specified by:
newEntityin interfaceCRUDServiceLocal<VoucherType,VoucherTypeDTO,VoucherTypeData,ConfigurationVO>- Specified by:
newEntityin classCRUDServiceImpl<VoucherType,QVoucherType,VoucherTypeDTO,VoucherTypeData,ConfigurationVO>
-
toEntity
public VoucherType toEntity(VoucherTypeDTO dto)
Description copied from class:CRUDServiceImplConverts the given DTO in an entity, handling theCRUDServiceImpl.subClassMappings()mappings for subclasses- Specified by:
toEntityin interfaceCRUDServiceLocal<VoucherType,VoucherTypeDTO,VoucherTypeData,ConfigurationVO>- Overrides:
toEntityin classCRUDServiceImpl<VoucherType,QVoucherType,VoucherTypeDTO,VoucherTypeData,ConfigurationVO>
-
getData
protected VoucherTypeData getData(VoucherType type)
Description copied from class:CRUDServiceImplReturns details data for the given entity- Specified by:
getDatain classCRUDServiceImpl<VoucherType,QVoucherType,VoucherTypeDTO,VoucherTypeData,ConfigurationVO>
-
getExcludedPropertiesToEntity
protected Object[] getExcludedPropertiesToEntity(VoucherTypeDTO dto)
Description copied from class:CRUDServiceImplMay be overridden in order to exclude properties when converting the given DTO to entity- Overrides:
getExcludedPropertiesToEntityin classCRUDServiceImpl<VoucherType,QVoucherType,VoucherTypeDTO,VoucherTypeData,ConfigurationVO>
-
onAfterSave
protected void onAfterSave(VoucherType entity, VoucherType currentCopy, Object dataFromOnBeforeSave)
Description copied from class:CRUDServiceImplMay be overridden in order to perform custom logic after saving an entity- Overrides:
onAfterSavein classCRUDServiceImpl<VoucherType,QVoucherType,VoucherTypeDTO,VoucherTypeData,ConfigurationVO>
-
onBeforeRemove
protected void onBeforeRemove(VoucherType voucherType)
Description copied from class:CRUDServiceImplMay be overridden in order to perform custom logic before removing an entity- Overrides:
onBeforeRemovein classCRUDServiceImpl<VoucherType,QVoucherType,VoucherTypeDTO,VoucherTypeData,ConfigurationVO>
-
onBeforeSave
protected Object onBeforeSave(VoucherType voucherType, VoucherType 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<VoucherType,QVoucherType,VoucherTypeDTO,VoucherTypeData,ConfigurationVO>
-
preProcessCurrentCopy
protected void preProcessCurrentCopy(VoucherTypeDTO dto, VoucherType 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<VoucherType,QVoucherType,VoucherTypeDTO,VoucherTypeData,ConfigurationVO>
-
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(VoucherTypeDTO dto)
- Specified by:
resolveValidatorin classCRUDServiceImpl<VoucherType,QVoucherType,VoucherTypeDTO,VoucherTypeData,ConfigurationVO>
-
-