Package org.cyclos.impl.users
Class UserServiceImpl
- java.lang.Object
-
- org.cyclos.impl.AbstractServerComponent
-
- org.cyclos.impl.AbstractNetworkedServerComponent
-
- org.cyclos.impl.BaseServiceImpl
-
- org.cyclos.impl.CRUDServiceImpl<User,QUser,UserDTO,UserData,UserDataParams>
-
- org.cyclos.impl.users.UserServiceImpl
-
- All Implemented Interfaces:
CRUDServiceLocal<User,UserDTO,UserData,UserDataParams>,UserServiceLocal,CRUDService<UserDTO,UserData,UserDataParams>,CRUDWithConfirmationPasswordService<UserDTO,UserData,UserDataParams>,Service,UserService
@Service public class UserServiceImpl extends CRUDServiceImpl<User,QUser,UserDTO,UserData,UserDataParams> implements UserServiceLocal
implementation forUserService
-
-
Field Summary
-
Fields inherited from class org.cyclos.impl.CRUDServiceImpl
$, ATTR_CURRENT_COPY, cacheHandler, dtoClass, entityClass, 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
-
Fields inherited from interface org.cyclos.services.users.UserService
ANY_PRINCIPAL_TYPE, PIN_PRINCIPAL_TYPE, SELF
-
Fields inherited from interface org.cyclos.impl.users.UserServiceLocal
LANDLINE_PHONE_FIELD, MOBILE_PHONE_FIELD
-
-
Constructor Summary
Constructors Constructor Description UserServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactivateUserIfNeeded(User user)Activates the given user if not yet active.protected voidaddCustomNameValidations(Property name, UserDTO dto)This method may be overridden to add custom validations for the NAME property.booleancanViewActiveConfiguration(User user)Returns true if the logged user can view the active configuration of the given user.booleancanViewProfile(User user)Returns true if the logged user can view the profile of the given userintcountTotalUsers()Returns the total number of users (not admins) which are not removedintcountUsersInGroups(Collection<? extends Group> groups, UserStatus... statuses)Return the count of users in the given groups with the given statuses, if no status is passed, ACTIVE, BLOCKED and DISABLED are used by default.protected voiddoRemove(User user, boolean flush)May be overridden in order to perform logical removing, instead of physical removing, or to remove some extra relationships as wellbooleanexistsUserWithEmail(String email)Returns true if there exists a user with the given email.booleanexistsUserWithMobilePhone(String normalizedMobilePhone)Returns true if there exists a user with the given normalized mobile phone.FileInfoexportUsers(@NotNull ExportFormatVO formatVO, @NotNull UserQuery params)Exports the user search results to a filevoidfill(AbstractUserSearchData data, boolean searchOverBrokeredUsers)Fills-in the common fields of anAbstractUserSearchDataprotected voidfillExternalPaymentInfo(UserDataParams params, User user)An external payment id could be provided to fill the user registration email and phoneprotected voidfillFirstMobilePhone(User user, MobilePhoneData mobilePhoneData)This is a special case in which an external payment has been provided to be automatically fill the registration form with some information like the mobile phone associated to the external payment.ActiveConfigurationDatagetActiveConfiguration(UserLocatorVO locator)Returns theActiveConfigurationData, containing all the actual configuration for the user matching the given locatorUserWithRolesVOgetCurrentUser()Returns the current user logged inprotected UserDatagetData(User user)Returns details data for the given entityprotected CreateDeviceConfirmationParamsgetDeviceConfirmationParams(UserDTO dto, User user, CRUDOperation operation)If the confirmation password must be checked then subclasses must overwrite this method to return a no-nullCreateDeviceConfirmationParamsobject.Object[]getExcludedPropertiesToEntity()Same as thegetExcludedPropertiesToEntity()method from theCRUDServiceImplbut for all dto's instances.protected Object[]getExcludedPropertiesToEntity(UserDTO dto)May be overridden in order to exclude properties when converting the given DTO to entityprotected StringgetNameLabel(UserDTO dto)ProfileTransactionActionsDatagetProfileTransactionActionsData(User user)Returns profile transactions data for the given userPublicRegistrationDatagetPublicRegistrationData(InitialGroupVO groupVO, String inviteToken)Returns data for registering a user from the public registrationList<InitialGroupVO>getPublicRegistrationGroups()Return the list of groups guests user can registerUserSearchDatagetSearchData(UserSearchContext context, UserLocatorVO brokerVO)Gets data used on the search page, according to the given search typeprotected Pair<DBQuery<?>,String>getUniqueNameQuery(UserDTO dto)This method may be overridden to customize the default global unique validation for the name property.List<InitialGroupVO>getUserRegistrationGroups(boolean asMember)Return the list of groups the logged user can register new users.ViewProfileDatagetViewProfileData(UserLocatorVO locator)Return aViewProfileDatafor the user matching the given locatorUserimportUser(UserRegistrationDTO dto)Imports a userbooleanisBuiltinRegistrationEnabled()Returns whether, for the current configuration, the built-in registraton form is enabled.protected booleanisNameRequired(UserDTO dto)By default, the name is always requiredcom.mysema.commons.lang.CloseableIterator<Long>iterateIds(UserQuery params)Iterates users according to the specified query parametersUserVOlocate(UserLocatorVO locator)Locates a user by a customizable key.UsernewEntity(UserDataParams params)Should be implemented in order to instantiate a new entity based on the given context parametersprotected voidonAfterSave(User user, User currentCopy, Object dataFromOnBeforeSave)May be overridden in order to perform custom logic after saving an entityprotected voidonBeforeRemove(User user)May be overridden in order to perform custom logic before removing an entityprotected ObjectonBeforeSave(User user, User currentCopy)May be overridden in order to perform custom logic before saving an entity.voidonRegistrationValidation(User user)Performs additional actions when a user registration is validatedprotected voidpreProcessCurrentCopy(UserDTO dto, User currentCopy)This method is invoked before saving the entity and also, if the log is enabled, before removing.UserRegistrationResultpublicRegister(PublicRegistrationDTO dto)Registers a user from a public registrationUserRegistrationResultregister(UserRegistrationDTO dto)Registers a userUserRegistrationResultregisterByMember(UserRegistrationByMemberDTO dto)Registers a user by a regular member.UserregisterByPopulator(UserRegistrationDTO dto)Registers a user via a populator, like setup or network with dataRegisterUserBySmsResultregisterBySms(RegisterUserBySmsParams params)Registers a user via SMSUserRegistrationResultregisterByWizard(PublicRegistrationDTO dto)Registers a user using a registration wizardprotected voidregisterNetworkMappings(NetworkPathRegistry networkPathRegistry)Needs to be overridden by subclasses to register the path up to the networkprotected Class<? extends UserDTO>resolveDTOType(User user)Uses theCRUDServiceImpl.subClassMappings()mappings to find a suitable class for anEntityDTOfor the given entity.protected ExtensionPointAccessorresolveExtensionPointAccessor(CRUDOperation operation, User user)Should be overridden by subclasses which have extension pointsprotected ValidatorresolveValidator(UserDTO dto)Page<UserWithFieldsVO>search(UserQuery params)Search users according to the specified query parameters.protected booleanshouldCheckConfirmationPassword(User user, CRUDOperation operation)Controls whether confirmation password should be checked for the given entity and operation.UserDTOtoDTO(User user)Converts the given entity in a DTO, handling theCRUDServiceImpl.subClassMappings()mappings for subclasses<VO extends UserVO>
VOtoUserVO(Class<VO> type, SessionData sessionData, Long id, String displayForManagers, String displayForOthers, String brokerIds, ImageVO image)Returns a subclass ofUserVOfilled up with the given fields.UserVOtoUserVO(SessionData sessionData, Long id, String displayForManagers, String displayForOthers, String brokerIds, ImageVO image)Returns anUserVOfilled up with the given fields.voidvalidate(UserDTO dto, UserRegistration registration, UserValidationFields fields)Validates the user information according to the registration contextStringvalidateRegistrationField(ValidateRegistrationFieldParams params)Validates a field for user registration.-
Methods inherited from class org.cyclos.impl.CRUDServiceImpl
addCustomInternalNameValidations, checkConfirmationPassword, find, findAll, from, getConfirmationPasswordInput, getConfirmationPasswordInputForRemove, getData, getDataForNew, getEntityClass, getEntityInternalNameKey, getExcludedPropertiesToDTO, getUniqueInternalNameQuery, isEntityInternalNameRequired, load, logEntity, onAfterRemove, remove, remove, removeAll, removeAll, removeAllWithConfirmationPassword, removeWithConfirmationPassword, resolveEntityType, save, saveOrder, saveSkippingEntityLog, saveWithConfirmationPassword, subClassMappings, toEntity, 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, toEntity, validate
-
Methods inherited from interface org.cyclos.services.CRUDWithConfirmationPasswordService
getConfirmationPasswordInputForRemove, removeAllWithConfirmationPassword, removeWithConfirmationPassword, saveWithConfirmationPassword
-
-
-
-
Method Detail
-
activateUserIfNeeded
public void activateUserIfNeeded(User user)
Activates the given user if not yet active.- Specified by:
activateUserIfNeededin interfaceUserServiceLocal
-
canViewActiveConfiguration
public boolean canViewActiveConfiguration(User user)
Description copied from interface:UserServiceLocalReturns true if the logged user can view the active configuration of the given user.- Specified by:
canViewActiveConfigurationin interfaceUserServiceLocal
-
canViewProfile
public boolean canViewProfile(User user)
Description copied from interface:UserServiceLocalReturns true if the logged user can view the profile of the given user- Specified by:
canViewProfilein interfaceUserServiceLocal
-
countTotalUsers
public int countTotalUsers()
Description copied from interface:UserServiceLocalReturns the total number of users (not admins) which are not removed- Specified by:
countTotalUsersin interfaceUserServiceLocal
-
countUsersInGroups
public int countUsersInGroups(Collection<? extends Group> groups, UserStatus... statuses)
Description copied from interface:UserServiceLocalReturn the count of users in the given groups with the given statuses, if no status is passed, ACTIVE, BLOCKED and DISABLED are used by default.- Specified by:
countUsersInGroupsin interfaceUserServiceLocal
-
existsUserWithEmail
public boolean existsUserWithEmail(String email)
Description copied from interface:UserServiceLocalReturns true if there exists a user with the given email.- Specified by:
existsUserWithEmailin interfaceUserServiceLocal
-
existsUserWithMobilePhone
public boolean existsUserWithMobilePhone(String normalizedMobilePhone)
Description copied from interface:UserServiceLocalReturns true if there exists a user with the given normalized mobile phone.- Specified by:
existsUserWithMobilePhonein interfaceUserServiceLocal
-
exportUsers
public FileInfo exportUsers(@NotNull @NotNull ExportFormatVO formatVO, @NotNull @NotNull UserQuery params) throws FrameworkException
Description copied from interface:UserServiceExports the user search results to a file- Specified by:
exportUsersin interfaceUserService- Throws:
FrameworkException
-
fill
public void fill(AbstractUserSearchData data, boolean searchOverBrokeredUsers) throws FrameworkException
Description copied from interface:UserServiceLocalFills-in the common fields of anAbstractUserSearchData- Specified by:
fillin interfaceUserServiceLocal- Throws:
FrameworkException
-
getActiveConfiguration
public ActiveConfigurationData getActiveConfiguration(UserLocatorVO locator) throws EntityNotFoundException
Description copied from interface:UserServiceReturns theActiveConfigurationData, containing all the actual configuration for the user matching the given locator- Specified by:
getActiveConfigurationin interfaceUserService- Throws:
EntityNotFoundException
-
getCurrentUser
public UserWithRolesVO getCurrentUser() throws FrameworkException
Description copied from interface:UserServiceReturns the current user logged in- Specified by:
getCurrentUserin interfaceUserService- Throws:
FrameworkException
-
getExcludedPropertiesToEntity
public Object[] getExcludedPropertiesToEntity()
Description copied from interface:UserServiceLocalSame as thegetExcludedPropertiesToEntity()method from theCRUDServiceImplbut for all dto's instances.- Specified by:
getExcludedPropertiesToEntityin interfaceUserServiceLocal
-
getProfileTransactionActionsData
public ProfileTransactionActionsData getProfileTransactionActionsData(User user)
Description copied from interface:UserServiceLocalReturns profile transactions data for the given user- Specified by:
getProfileTransactionActionsDatain interfaceUserServiceLocal
-
getPublicRegistrationData
public PublicRegistrationData getPublicRegistrationData(InitialGroupVO groupVO, String inviteToken) throws FrameworkException
Description copied from interface:UserServiceReturns data for registering a user from the public registration- Specified by:
getPublicRegistrationDatain interfaceUserService- Throws:
FrameworkException
-
getPublicRegistrationGroups
public List<InitialGroupVO> getPublicRegistrationGroups() throws FrameworkException
Description copied from interface:UserServiceReturn the list of groups guests user can register- Specified by:
getPublicRegistrationGroupsin interfaceUserService- Throws:
FrameworkException
-
getSearchData
public UserSearchData getSearchData(UserSearchContext context, UserLocatorVO brokerVO) throws FrameworkException
Description copied from interface:UserServiceGets data used on the search page, according to the given search type- Specified by:
getSearchDatain interfaceUserService- Throws:
FrameworkException
-
getUserRegistrationGroups
public List<InitialGroupVO> getUserRegistrationGroups(boolean asMember)
Description copied from interface:UserServiceReturn the list of groups the logged user can register new users.- Specified by:
getUserRegistrationGroupsin interfaceUserService- Parameters:
asMember- flag used only in case the logged user is a broker to distinguish between registering as member/broker.
-
getViewProfileData
public ViewProfileData getViewProfileData(UserLocatorVO locator)
Description copied from interface:UserServiceReturn aViewProfileDatafor the user matching the given locator- Specified by:
getViewProfileDatain interfaceUserService
-
importUser
public User importUser(UserRegistrationDTO dto)
Description copied from interface:UserServiceLocalImports a user- Specified by:
importUserin interfaceUserServiceLocal
-
isBuiltinRegistrationEnabled
public boolean isBuiltinRegistrationEnabled()
Description copied from interface:UserServiceLocalReturns whether, for the current configuration, the built-in registraton form is enabled. It is true if any ofConfigurationAccessor.getLargeScreenRegistrationWizard(),ConfigurationAccessor.getMediumScreenRegistrationWizard()orConfigurationAccessor.getSmallScreenRegistrationWizard()is null. If they are all set to a wizard, the built-in registration form is disabled.- Specified by:
isBuiltinRegistrationEnabledin interfaceUserServiceLocal
-
iterateIds
public com.mysema.commons.lang.CloseableIterator<Long> iterateIds(UserQuery params) throws QueryParseException
Description copied from interface:UserServiceLocalIterates users according to the specified query parameters- Specified by:
iterateIdsin interfaceUserServiceLocal- Throws:
QueryParseException
-
locate
public UserVO locate(UserLocatorVO locator) throws FrameworkException
Description copied from interface:UserServiceLocates a user by a customizable key. Fields are attempted in the following order (only the first non-blank field will be used for the search):- Id
- Username
- Field value with field's id
- Field value with field's internal name
- Mobile phone
- Specified by:
locatein interfaceUserService- Throws:
ValidationException- if the locator is invalid (there is no fields non null).EntityNotFoundException- if the user was not found or more than one user was found with the specified locator.FrameworkException
-
newEntity
public User newEntity(UserDataParams 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<User,UserDTO,UserData,UserDataParams>- Specified by:
newEntityin classCRUDServiceImpl<User,QUser,UserDTO,UserData,UserDataParams>
-
onRegistrationValidation
public void onRegistrationValidation(User user) throws FrameworkException
Description copied from interface:UserServiceLocalPerforms additional actions when a user registration is validated- Specified by:
onRegistrationValidationin interfaceUserServiceLocal- Throws:
FrameworkException
-
publicRegister
public UserRegistrationResult publicRegister(PublicRegistrationDTO dto) throws FrameworkException
Description copied from interface:UserServiceRegisters a user from a public registration- Specified by:
publicRegisterin interfaceUserService- Throws:
FrameworkException
-
register
public UserRegistrationResult register(UserRegistrationDTO dto) throws PasswordException
Description copied from interface:UserServiceRegisters a user- Specified by:
registerin interfaceUserService- Throws:
PasswordException
-
registerByMember
public UserRegistrationResult registerByMember(UserRegistrationByMemberDTO dto) throws FrameworkException
Description copied from interface:UserServiceRegisters a user by a regular member.- Specified by:
registerByMemberin interfaceUserService- Throws:
FrameworkException
-
registerByPopulator
public User registerByPopulator(UserRegistrationDTO dto) throws FrameworkException
Description copied from interface:UserServiceLocalRegisters a user via a populator, like setup or network with data- Specified by:
registerByPopulatorin interfaceUserServiceLocal- Throws:
FrameworkException
-
registerBySms
public RegisterUserBySmsResult registerBySms(RegisterUserBySmsParams params) throws FrameworkException
Description copied from interface:UserServiceLocalRegisters a user via SMS- Specified by:
registerBySmsin interfaceUserServiceLocal- Throws:
FrameworkException
-
registerByWizard
public UserRegistrationResult registerByWizard(PublicRegistrationDTO dto)
Description copied from interface:UserServiceLocalRegisters a user using a registration wizard- Specified by:
registerByWizardin interfaceUserServiceLocal
-
search
public Page<UserWithFieldsVO> search(UserQuery params)
Description copied from interface:UserServiceSearch users according to the specified query parameters. The returned objects will either contain theBasicUserVO.DISPLAYandBasicUserVO#SHORT_DISPLAYproperties filled in or specific profile fields, depending on the products (permissions) of the viewing user. If there are profile fields marked to be returned, display and short display are not returned, as in most cases it would mean repeated information.- Specified by:
searchin interfaceUserService
-
toDTO
public UserDTO toDTO(User user)
Description copied from class:CRUDServiceImplConverts the given entity in a DTO, handling theCRUDServiceImpl.subClassMappings()mappings for subclasses- Specified by:
toDTOin interfaceCRUDServiceLocal<User,UserDTO,UserData,UserDataParams>- Overrides:
toDTOin classCRUDServiceImpl<User,QUser,UserDTO,UserData,UserDataParams>
-
toUserVO
public <VO extends UserVO> VO toUserVO(Class<VO> type, SessionData sessionData, Long id, String displayForManagers, String displayForOthers, String brokerIds, ImageVO image)
Description copied from interface:UserServiceLocalReturns a subclass ofUserVOfilled up with the given fields. UsesQueryHelper.getUserDisplay(org.cyclos.impl.access.SessionData, Long, String, String, String)- Specified by:
toUserVOin interfaceUserServiceLocal
-
toUserVO
public UserVO toUserVO(SessionData sessionData, Long id, String displayForManagers, String displayForOthers, String brokerIds, ImageVO image)
Description copied from interface:UserServiceLocalReturns anUserVOfilled up with the given fields. UsesQueryHelper.getUserDisplay(org.cyclos.impl.access.SessionData, Long, String, String, String)- Specified by:
toUserVOin interfaceUserServiceLocal
-
validate
public void validate(UserDTO dto, UserRegistration registration, UserValidationFields fields)
Description copied from interface:UserServiceLocalValidates the user information according to the registration context- Specified by:
validatein interfaceUserServiceLocal
-
validateRegistrationField
public String validateRegistrationField(ValidateRegistrationFieldParams params) throws FrameworkException
Description copied from interface:UserServiceValidates a field for user registration. The group must be a group allowed for registration. The field should be either an alias of aBasicProfileField.getByAlias(String)or the internal name of a custom field, and must be valid for the given group. The value should be a valid reference value, just as accepted byCustomFieldValueDTO.setReferenceValue(String)- Specified by:
validateRegistrationFieldin interfaceUserService- Throws:
FrameworkException
-
addCustomNameValidations
protected void addCustomNameValidations(Property name, UserDTO dto)
Description copied from class:CRUDServiceImplThis method may be overridden to add custom validations for the NAME property.- Overrides:
addCustomNameValidationsin classCRUDServiceImpl<User,QUser,UserDTO,UserData,UserDataParams>
-
doRemove
protected void doRemove(User user, boolean flush)
Description copied from class:CRUDServiceImplMay be overridden in order to perform logical removing, instead of physical removing, or to remove some extra relationships as well- Overrides:
doRemovein classCRUDServiceImpl<User,QUser,UserDTO,UserData,UserDataParams>
-
fillExternalPaymentInfo
protected void fillExternalPaymentInfo(UserDataParams params, User user)
An external payment id could be provided to fill the user registration email and phone
-
fillFirstMobilePhone
protected void fillFirstMobilePhone(User user, MobilePhoneData mobilePhoneData)
This is a special case in which an external payment has been provided to be automatically fill the registration form with some information like the mobile phone associated to the external payment.
-
getData
protected UserData getData(User user)
Description copied from class:CRUDServiceImplReturns details data for the given entity- Specified by:
getDatain classCRUDServiceImpl<User,QUser,UserDTO,UserData,UserDataParams>
-
getDeviceConfirmationParams
protected CreateDeviceConfirmationParams getDeviceConfirmationParams(UserDTO dto, User user, CRUDOperation operation)
Description copied from class:CRUDServiceImplIf the confirmation password must be checked then subclasses must overwrite this method to return a no-nullCreateDeviceConfirmationParamsobject. This object is required to validate the confirmation when the operation was confirmed with a device.- Overrides:
getDeviceConfirmationParamsin classCRUDServiceImpl<User,QUser,UserDTO,UserData,UserDataParams>- Parameters:
dto- , it can be null, subclasses must take it into account. E.g: to disable a mobile phone for SMS, the confirmation password must be check and for this case there is no DTO instance.user- never null, represents the current value (i.e before apply the dto).
-
getExcludedPropertiesToEntity
protected Object[] getExcludedPropertiesToEntity(UserDTO dto)
Description copied from class:CRUDServiceImplMay be overridden in order to exclude properties when converting the given DTO to entity- Overrides:
getExcludedPropertiesToEntityin classCRUDServiceImpl<User,QUser,UserDTO,UserData,UserDataParams>
-
getNameLabel
protected String getNameLabel(UserDTO dto)
- Overrides:
getNameLabelin classCRUDServiceImpl<User,QUser,UserDTO,UserData,UserDataParams>
-
getUniqueNameQuery
protected Pair<DBQuery<?>,String> getUniqueNameQuery(UserDTO dto)
Description copied from class:CRUDServiceImplThis method may be overridden to customize the default global unique validation for the name property. Also it must return a string with the context to be included in the key used for the lock (LockKey#LockType)- Overrides:
getUniqueNameQueryin classCRUDServiceImpl<User,QUser,UserDTO,UserData,UserDataParams>
-
isNameRequired
protected boolean isNameRequired(UserDTO dto)
Description copied from class:CRUDServiceImplBy default, the name is always required- Overrides:
isNameRequiredin classCRUDServiceImpl<User,QUser,UserDTO,UserData,UserDataParams>
-
onAfterSave
protected void onAfterSave(User user, User currentCopy, Object dataFromOnBeforeSave)
Description copied from class:CRUDServiceImplMay be overridden in order to perform custom logic after saving an entity- Overrides:
onAfterSavein classCRUDServiceImpl<User,QUser,UserDTO,UserData,UserDataParams>
-
onBeforeRemove
protected void onBeforeRemove(User user)
Description copied from class:CRUDServiceImplMay be overridden in order to perform custom logic before removing an entity- Overrides:
onBeforeRemovein classCRUDServiceImpl<User,QUser,UserDTO,UserData,UserDataParams>
-
onBeforeSave
protected Object onBeforeSave(User user, User 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<User,QUser,UserDTO,UserData,UserDataParams>
-
preProcessCurrentCopy
protected void preProcessCurrentCopy(UserDTO dto, User 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<User,QUser,UserDTO,UserData,UserDataParams>
-
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
-
resolveDTOType
protected Class<? extends UserDTO> resolveDTOType(User user)
Description copied from class:CRUDServiceImplUses theCRUDServiceImpl.subClassMappings()mappings to find a suitable class for anEntityDTOfor the given entity. When not found defaults toCRUDServiceImpl.dtoClass.- Overrides:
resolveDTOTypein classCRUDServiceImpl<User,QUser,UserDTO,UserData,UserDataParams>
-
resolveExtensionPointAccessor
protected ExtensionPointAccessor resolveExtensionPointAccessor(CRUDOperation operation, User user)
Description copied from class:CRUDServiceImplShould be overridden by subclasses which have extension points- Overrides:
resolveExtensionPointAccessorin classCRUDServiceImpl<User,QUser,UserDTO,UserData,UserDataParams>
-
resolveValidator
protected Validator resolveValidator(UserDTO dto)
- Specified by:
resolveValidatorin classCRUDServiceImpl<User,QUser,UserDTO,UserData,UserDataParams>
-
shouldCheckConfirmationPassword
protected boolean shouldCheckConfirmationPassword(User user, CRUDOperation operation)
Description copied from class:CRUDServiceImplControls whether confirmation password should be checked for the given entity and operation. By default returns true if this service indirectly implementsCRUDWithConfirmationPasswordService(for example, if the remote service interface extends it).- Overrides:
shouldCheckConfirmationPasswordin classCRUDServiceImpl<User,QUser,UserDTO,UserData,UserDataParams>
-
-