Package org.cyclos.security.banking
Class VoucherServiceSecurity
- java.lang.Object
-
- org.cyclos.impl.AbstractServerComponent
-
- org.cyclos.impl.AbstractNetworkedServerComponent
-
- org.cyclos.security.BaseServiceSecurity
-
- org.cyclos.security.banking.VoucherServiceSecurity
-
- All Implemented Interfaces:
VoucherService,Service
@Security public class VoucherServiceSecurity extends BaseServiceSecurity implements VoucherService
Security layer forVoucherService
-
-
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 VoucherServiceSecurity()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidassign(@NotNull AssignVoucherDTO params)Assigns an unassigned, open generated voucher to a userSerializableInputStreambarcode(VoucherBarcodeParams params)Returns a barcode image of the token of the given voucherVoucherPackWithIdsVObuy(BuyVouchersDTO params)Buys one or more vouchersvoidcancel(CancelVoucherDTO params)Cancels one or more vouchersvoidchangeExpirationDate(ChangeVoucherExpirationDateDTO params)Changes the voucher expiration date according to the given information.FileInfoexportVoucher(@NotNull ExportFormatVO format, @NotNull VoucherVO voucher, boolean markAsPrinted)Generates a file with the voucher.FileInfoexportVouchers(@NotNull ExportFormatVO format, @NotNull VoucherQuery query, boolean markAsPrinted)Generates a file with the query result.VoucherPackWithIdsVOgenerate(GenerateVouchersDTO params)Generates vouchersBuyVoucherDatagetBuyData(CreateVoucherDataParams params)Returns data used to buy a voucherVoucherDatagetData(Long id)Returns data about a specific voucherGenerateVouchersDatagetGenerateData(CreateVoucherDataParams params)Returns data which is needed for generating vouchersRedeemVoucherDatagetRedeemData(RedeemVoucherDataParams params)Returns data used to redeem a voucherInitialRedeemVoucherDatagetRedeemInitialData(UserLocatorVO userVO)Returns data for starting a voucher redeemingVouchersSearchDatagetSearchData(VoucherSearchContext context, UserLocatorVO locator)Returns data for searching vouchers, either over a user or for a general searchList<VoucherTypeDetailedVO>listTypesForBuy(UserLocatorVO forUserVO)Returns the voucher types the logged user can buy vouchers to the given user (defaults to the logged user himself)VoucherVOloadByToken(String token)Returns a voucher by tokenRedeemVoucherResultredeem(RedeemVoucherDTO params)Redeems a voucher, returning the generated voucher idprotected EntityCheck<?>resolveEntityCheck()Must be implemented in order to return theEntityCheckmanaged by this security component, or null if nonePage<VoucherVO>search(VoucherQuery params)Searches for vouchers according to the given filtersVouchersResultsWithSummaryVOsearchWithSummary(VoucherQuery params)Searches for vouchers according to the given filters, also returning summaries per status-
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, toDate, toDateTime, validate
-
Methods inherited from class org.cyclos.impl.AbstractServerComponent
dataTranslationProxy, delete, detach, find, flush, from, getApplicationContext, getFormatter, getFormatter, getFormatter, getLogger, getRemoteAddress, getSessionData, mailContentBuilder, message, message, persist, processBatch, processBatch, refresh, remove, selectFrom, subQuery, update
-
-
-
-
Method Detail
-
assign
public void assign(@NotNull @NotNull AssignVoucherDTO params) throws FrameworkExceptionDescription copied from interface:VoucherServiceAssigns an unassigned, open generated voucher to a user- Specified by:
assignin interfaceVoucherService- Throws:
FrameworkException
-
barcode
public SerializableInputStream barcode(VoucherBarcodeParams params) throws FrameworkException
Description copied from interface:VoucherServiceReturns a barcode image of the token of the given voucher- Specified by:
barcodein interfaceVoucherService- Throws:
FrameworkException
-
buy
public VoucherPackWithIdsVO buy(BuyVouchersDTO params) throws FrameworkException
Description copied from interface:VoucherServiceBuys one or more vouchers- Specified by:
buyin interfaceVoucherService- Throws:
FrameworkException
-
cancel
public void cancel(CancelVoucherDTO params) throws FrameworkException
Description copied from interface:VoucherServiceCancels one or more vouchers- Specified by:
cancelin interfaceVoucherService- Throws:
FrameworkException
-
changeExpirationDate
public void changeExpirationDate(ChangeVoucherExpirationDateDTO params) throws FrameworkException
Description copied from interface:VoucherServiceChanges the voucher expiration date according to the given information.- Specified by:
changeExpirationDatein interfaceVoucherService- Throws:
FrameworkException
-
exportVoucher
public FileInfo exportVoucher(@NotNull @NotNull ExportFormatVO format, @NotNull @NotNull VoucherVO voucher, boolean markAsPrinted) throws FrameworkException
Description copied from interface:VoucherServiceGenerates a file with the voucher. This operation is read/write because it can update the voucher printed flag.- Specified by:
exportVoucherin interfaceVoucherService- Throws:
FrameworkException
-
exportVouchers
public FileInfo exportVouchers(@NotNull @NotNull ExportFormatVO format, @NotNull @NotNull VoucherQuery query, boolean markAsPrinted) throws FrameworkException
Description copied from interface:VoucherServiceGenerates a file with the query result. This operation is read/write because it can update the each voucher printed flag.- Specified by:
exportVouchersin interfaceVoucherService- Throws:
FrameworkException
-
generate
public VoucherPackWithIdsVO generate(GenerateVouchersDTO params) throws FrameworkException
Description copied from interface:VoucherServiceGenerates vouchers- Specified by:
generatein interfaceVoucherService- Throws:
FrameworkException
-
getBuyData
public BuyVoucherData getBuyData(CreateVoucherDataParams params) throws FrameworkException
Description copied from interface:VoucherServiceReturns data used to buy a voucher- Specified by:
getBuyDatain interfaceVoucherService- Throws:
FrameworkException
-
getData
public VoucherData getData(Long id) throws FrameworkException
Description copied from interface:VoucherServiceReturns data about a specific voucher- Specified by:
getDatain interfaceVoucherService- Throws:
FrameworkException
-
getGenerateData
public GenerateVouchersData getGenerateData(CreateVoucherDataParams params) throws FrameworkException
Description copied from interface:VoucherServiceReturns data which is needed for generating vouchers- Specified by:
getGenerateDatain interfaceVoucherService- Throws:
FrameworkException
-
getRedeemData
public RedeemVoucherData getRedeemData(RedeemVoucherDataParams params) throws FrameworkException
Description copied from interface:VoucherServiceReturns data used to redeem a voucher- Specified by:
getRedeemDatain interfaceVoucherService- Throws:
FrameworkException- See Also:
VoucherService.redeem(RedeemVoucherDTO)
-
getRedeemInitialData
public InitialRedeemVoucherData getRedeemInitialData(UserLocatorVO userVO) throws FrameworkException
Description copied from interface:VoucherServiceReturns data for starting a voucher redeeming- Specified by:
getRedeemInitialDatain interfaceVoucherService- Throws:
FrameworkException
-
getSearchData
public VouchersSearchData getSearchData(VoucherSearchContext context, UserLocatorVO locator) throws FrameworkException
Description copied from interface:VoucherServiceReturns data for searching vouchers, either over a user or for a general search- Specified by:
getSearchDatain interfaceVoucherService- Throws:
FrameworkException
-
listTypesForBuy
public List<VoucherTypeDetailedVO> listTypesForBuy(UserLocatorVO forUserVO) throws FrameworkException
Description copied from interface:VoucherServiceReturns the voucher types the logged user can buy vouchers to the given user (defaults to the logged user himself)- Specified by:
listTypesForBuyin interfaceVoucherService- Throws:
FrameworkException
-
loadByToken
public VoucherVO loadByToken(String token) throws FrameworkException
Description copied from interface:VoucherServiceReturns a voucher by token- Specified by:
loadByTokenin interfaceVoucherService- Throws:
FrameworkException
-
redeem
public RedeemVoucherResult redeem(RedeemVoucherDTO params) throws FrameworkException
Description copied from interface:VoucherServiceRedeems a voucher, returning the generated voucher id- Specified by:
redeemin interfaceVoucherService- Throws:
FrameworkException
-
search
public Page<VoucherVO> search(VoucherQuery params) throws FrameworkException
Description copied from interface:VoucherServiceSearches for vouchers according to the given filters- Specified by:
searchin interfaceVoucherService- Throws:
FrameworkException
-
searchWithSummary
public VouchersResultsWithSummaryVO searchWithSummary(VoucherQuery params) throws FrameworkException
Description copied from interface:VoucherServiceSearches for vouchers according to the given filters, also returning summaries per status- Specified by:
searchWithSummaryin interfaceVoucherService- Throws:
FrameworkException
-
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
-
-