Package org.cyclos.impl.banking
Class CurrencyServiceImpl
- java.lang.Object
-
- org.cyclos.impl.AbstractServerComponent
-
- org.cyclos.impl.AbstractNetworkedServerComponent
-
- org.cyclos.impl.BaseServiceImpl
-
- org.cyclos.impl.CRUDServiceImpl<Currency,QCurrency,CurrencyDTO,CurrencyData,Void>
-
- org.cyclos.impl.banking.CurrencyServiceImpl
-
- All Implemented Interfaces:
CurrencyServiceLocal,CRUDServiceLocal<Currency,CurrencyDTO,CurrencyData,Void>,CurrencyService,CRUDService<CurrencyDTO,CurrencyData,Void>,CRUDWithConfirmationPasswordService<CurrencyDTO,CurrencyData,Void>,Service
@Service public class CurrencyServiceImpl extends CRUDServiceImpl<Currency,QCurrency,CurrencyDTO,CurrencyData,Void> implements CurrencyServiceLocal
implementation forCurrencyService
-
-
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 CurrencyServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected CurrencyDatagetData(Currency currency)Returns details data for the given entityList<CurrencyVO>list()List all available currenciesList<Currency>listAccessible(Collection<? extends BasicGroup> basicGroups)Returns a list of currencies visible to the given groups, or an empty list if null/empty collection is passed.List<Currency>listAccessible(User user)Returns a list of currencies visible to the given user, or an empty list if null is passed.List<Currency>listForViewingAds(User user)Returns a list of currencies available to view ads for the given user, or an empty list if null is passed.List<Currency>listOnThisNetwork()Returns a list of currencies exactly on this network - excludes global currencies if on network, or return global currencies if on global modeCurrencynewEntity(Void params)Should be implemented in order to instantiate a new entity based on the given context parametersprotected voidonAfterSave(Currency entity, Currency currentCopy, Object dataFromOnBeforeSave)May be overridden in order to perform custom logic after saving an entityprotected voidregisterNetworkMappings(NetworkPathRegistry networkPathRegistry)Needs to be overridden by subclasses to register the path up to the networkprotected ValidatorresolveValidator(CurrencyDTO dto)CurrencyDTOtoDTO(Currency currency)Converts the given entity in a DTO, handling theCRUDServiceImpl.subClassMappings()mappings for subclassesCurrencytoEntity(CurrencyDTO 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, onBeforeRemove, onBeforeSave, preProcessCurrentCopy, remove, remove, removeAll, removeAll, removeAllWithConfirmationPassword, removeWithConfirmationPassword, resolveDTOType, resolveEntityType, resolveExtensionPointAccessor, save, saveOrder, saveSkippingEntityLog, saveWithConfirmationPassword, shouldCheckConfirmationPassword, subClassMappings, 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, validate
-
-
-
-
Method Detail
-
list
public List<CurrencyVO> list()
Description copied from interface:CurrencyServiceList all available currencies- Specified by:
listin interfaceCurrencyService
-
listAccessible
public List<Currency> listAccessible(Collection<? extends BasicGroup> basicGroups)
Description copied from interface:CurrencyServiceLocalReturns a list of currencies visible to the given groups, or an empty list if null/empty collection is passed.- Specified by:
listAccessiblein interfaceCurrencyServiceLocal
-
listAccessible
public List<Currency> listAccessible(User user)
Description copied from interface:CurrencyServiceLocalReturns a list of currencies visible to the given user, or an empty list if null is passed.- Specified by:
listAccessiblein interfaceCurrencyServiceLocal
-
listForViewingAds
public List<Currency> listForViewingAds(User user)
Description copied from interface:CurrencyServiceLocalReturns a list of currencies available to view ads for the given user, or an empty list if null is passed.- Specified by:
listForViewingAdsin interfaceCurrencyServiceLocal
-
listOnThisNetwork
public List<Currency> listOnThisNetwork() throws FrameworkException
Description copied from interface:CurrencyServiceLocalReturns a list of currencies exactly on this network - excludes global currencies if on network, or return global currencies if on global mode- Specified by:
listOnThisNetworkin interfaceCurrencyServiceLocal- Throws:
FrameworkException
-
newEntity
public Currency newEntity(Void 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<Currency,CurrencyDTO,CurrencyData,Void>- Specified by:
newEntityin classCRUDServiceImpl<Currency,QCurrency,CurrencyDTO,CurrencyData,Void>
-
toDTO
public CurrencyDTO toDTO(Currency currency)
Description copied from class:CRUDServiceImplConverts the given entity in a DTO, handling theCRUDServiceImpl.subClassMappings()mappings for subclasses- Specified by:
toDTOin interfaceCRUDServiceLocal<Currency,CurrencyDTO,CurrencyData,Void>- Overrides:
toDTOin classCRUDServiceImpl<Currency,QCurrency,CurrencyDTO,CurrencyData,Void>
-
toEntity
public Currency toEntity(CurrencyDTO dto)
Description copied from class:CRUDServiceImplConverts the given DTO in an entity, handling theCRUDServiceImpl.subClassMappings()mappings for subclasses- Specified by:
toEntityin interfaceCRUDServiceLocal<Currency,CurrencyDTO,CurrencyData,Void>- Overrides:
toEntityin classCRUDServiceImpl<Currency,QCurrency,CurrencyDTO,CurrencyData,Void>
-
getData
protected CurrencyData getData(Currency currency)
Description copied from class:CRUDServiceImplReturns details data for the given entity- Specified by:
getDatain classCRUDServiceImpl<Currency,QCurrency,CurrencyDTO,CurrencyData,Void>
-
onAfterSave
protected void onAfterSave(Currency entity, Currency currentCopy, Object dataFromOnBeforeSave)
Description copied from class:CRUDServiceImplMay be overridden in order to perform custom logic after saving an entity- Overrides:
onAfterSavein classCRUDServiceImpl<Currency,QCurrency,CurrencyDTO,CurrencyData,Void>
-
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(CurrencyDTO dto)
- Specified by:
resolveValidatorin classCRUDServiceImpl<Currency,QCurrency,CurrencyDTO,CurrencyData,Void>
-
-