Package org.cyclos.impl.users
Class ContactInfoServiceImpl
- java.lang.Object
-
- org.cyclos.impl.AbstractServerComponent
-
- org.cyclos.impl.AbstractNetworkedServerComponent
-
- org.cyclos.impl.BaseServiceImpl
-
- org.cyclos.impl.CRUDServiceImpl<ContactInfo,QContactInfo,ContactInfoDTO,ContactInfoData,UserLocatorVO>
-
- org.cyclos.impl.users.ContactInfoServiceImpl
-
- All Implemented Interfaces:
CRUDServiceLocal<ContactInfo,ContactInfoDTO,ContactInfoData,UserLocatorVO>,ContactInfoServiceLocal,CRUDService<ContactInfoDTO,ContactInfoData,UserLocatorVO>,CRUDWithConfirmationPasswordService<ContactInfoDTO,ContactInfoData,UserLocatorVO>,Service,ContactInfoService
@Service public class ContactInfoServiceImpl extends CRUDServiceImpl<ContactInfo,QContactInfo,ContactInfoDTO,ContactInfoData,UserLocatorVO> implements ContactInfoServiceLocal
Implementation forContactInfoService
-
-
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 ContactInfoServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanHaveContactInfos(User user)Returns whether the given user can have additional contactsprotected voiddoRemove(ContactInfo contactInfo, boolean flush)May be overridden in order to perform logical removing, instead of physical removing, or to remove some extra relationships as wellContactInfoListDatagetContactInfoListData(UserLocatorVO locator, boolean includeCustomOperations)Returns information for listing additional contact info, together with the list itselfprotected ContactInfoDatagetData(ContactInfo contactInfo)Returns details data for the given entityContactInfoDatagetDataForNew(Group group)Returns data for creating an additional contact for a new user registered in the given groupprotected CreateDeviceConfirmationParamsgetDeviceConfirmationParams(ContactInfoDTO dto, ContactInfo entity, CRUDOperation operation)If the confirmation password must be checked then subclasses must overwrite this method to return a no-nullCreateDeviceConfirmationParamsobject.protected Object[]getExcludedPropertiesToDTO(ContactInfo entity)May be overridden in order to exclude properties when converting the given entity to DTOprotected Object[]getExcludedPropertiesToEntity(ContactInfoDTO dto)May be overridden in order to exclude properties when converting the given DTO to entityList<ContactInfo>list(User user)Returns all additional contact information for the given userContactInfonewEntity(UserLocatorVO locator)Should be implemented in order to instantiate a new entity based on the given context parametersprotected voidonAfterSave(ContactInfo contactInfo, ContactInfo currentCopy, Object dataFromOnBeforeSave)May be overridden in order to perform custom logic after saving an entityprotected voidonBeforeRemove(ContactInfo contactInfo)May be overridden in order to perform custom logic before removing an entityprotected ObjectonBeforeSave(ContactInfo contactInfo, ContactInfo currentCopy)May be overridden in order to perform custom logic before saving an entity.protected voidregisterNetworkMappings(NetworkPathRegistry networkPathRegistry)Needs to be overridden by subclasses to register the path up to the networkvoidremoveAll(User user)Removes all additional contact information from the given userprotected ValidatorresolveValidator(ContactInfoDTO dto)protected booleanshouldCheckConfirmationPassword(ContactInfo entity, CRUDOperation operation)Controls whether confirmation password should be checked for the given entity and operation.ContactInfoDTOtoDTO(ContactInfo contactInfo)Converts the given entity in a DTO, handling theCRUDServiceImpl.subClassMappings()mappings for subclassesContactInfotoEntity(ContactInfoDTO 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, find, findAll, from, getConfirmationPasswordInput, getConfirmationPasswordInputForRemove, getData, getDataForNew, getEntityClass, getEntityInternalNameKey, getNameLabel, getUniqueInternalNameQuery, getUniqueNameQuery, isEntityInternalNameRequired, isNameRequired, load, logEntity, onAfterRemove, preProcessCurrentCopy, remove, remove, removeAll, removeAll, removeAllWithConfirmationPassword, removeWithConfirmationPassword, resolveDTOType, resolveEntityType, resolveExtensionPointAccessor, save, saveOrder, saveSkippingEntityLog, saveWithConfirmationPassword, 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
-
Methods inherited from interface org.cyclos.services.CRUDWithConfirmationPasswordService
getConfirmationPasswordInputForRemove, removeAllWithConfirmationPassword, removeWithConfirmationPassword, saveWithConfirmationPassword
-
-
-
-
Method Detail
-
canHaveContactInfos
public boolean canHaveContactInfos(User user)
Description copied from interface:ContactInfoServiceLocalReturns whether the given user can have additional contacts- Specified by:
canHaveContactInfosin interfaceContactInfoServiceLocal
-
getContactInfoListData
public ContactInfoListData getContactInfoListData(UserLocatorVO locator, boolean includeCustomOperations) throws FrameworkException
Description copied from interface:ContactInfoServiceReturns information for listing additional contact info, together with the list itself- Specified by:
getContactInfoListDatain interfaceContactInfoService- Throws:
FrameworkException
-
getDataForNew
public ContactInfoData getDataForNew(Group group)
Description copied from interface:ContactInfoServiceLocalReturns data for creating an additional contact for a new user registered in the given group- Specified by:
getDataForNewin interfaceContactInfoServiceLocal
-
list
public List<ContactInfo> list(User user)
Description copied from interface:ContactInfoServiceLocalReturns all additional contact information for the given user- Specified by:
listin interfaceContactInfoServiceLocal
-
newEntity
public ContactInfo newEntity(UserLocatorVO locator)
Description copied from class:CRUDServiceImplShould be implemented in order to instantiate a new entity based on the given context parameters- Specified by:
newEntityin interfaceCRUDServiceLocal<ContactInfo,ContactInfoDTO,ContactInfoData,UserLocatorVO>- Specified by:
newEntityin classCRUDServiceImpl<ContactInfo,QContactInfo,ContactInfoDTO,ContactInfoData,UserLocatorVO>
-
removeAll
public void removeAll(User user)
Description copied from interface:ContactInfoServiceLocalRemoves all additional contact information from the given user- Specified by:
removeAllin interfaceContactInfoServiceLocal
-
toDTO
public ContactInfoDTO toDTO(ContactInfo contactInfo)
Description copied from class:CRUDServiceImplConverts the given entity in a DTO, handling theCRUDServiceImpl.subClassMappings()mappings for subclasses- Specified by:
toDTOin interfaceCRUDServiceLocal<ContactInfo,ContactInfoDTO,ContactInfoData,UserLocatorVO>- Overrides:
toDTOin classCRUDServiceImpl<ContactInfo,QContactInfo,ContactInfoDTO,ContactInfoData,UserLocatorVO>
-
toEntity
public ContactInfo toEntity(ContactInfoDTO dto)
Description copied from class:CRUDServiceImplConverts the given DTO in an entity, handling theCRUDServiceImpl.subClassMappings()mappings for subclasses- Specified by:
toEntityin interfaceCRUDServiceLocal<ContactInfo,ContactInfoDTO,ContactInfoData,UserLocatorVO>- Overrides:
toEntityin classCRUDServiceImpl<ContactInfo,QContactInfo,ContactInfoDTO,ContactInfoData,UserLocatorVO>
-
doRemove
protected void doRemove(ContactInfo contactInfo, 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<ContactInfo,QContactInfo,ContactInfoDTO,ContactInfoData,UserLocatorVO>
-
getData
protected ContactInfoData getData(ContactInfo contactInfo)
Description copied from class:CRUDServiceImplReturns details data for the given entity- Specified by:
getDatain classCRUDServiceImpl<ContactInfo,QContactInfo,ContactInfoDTO,ContactInfoData,UserLocatorVO>
-
getDeviceConfirmationParams
protected CreateDeviceConfirmationParams getDeviceConfirmationParams(ContactInfoDTO dto, ContactInfo entity, 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<ContactInfo,QContactInfo,ContactInfoDTO,ContactInfoData,UserLocatorVO>- 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.entity- never null, represents the current value (i.e before apply the dto).
-
getExcludedPropertiesToDTO
protected Object[] getExcludedPropertiesToDTO(ContactInfo entity)
Description copied from class:CRUDServiceImplMay be overridden in order to exclude properties when converting the given entity to DTO- Overrides:
getExcludedPropertiesToDTOin classCRUDServiceImpl<ContactInfo,QContactInfo,ContactInfoDTO,ContactInfoData,UserLocatorVO>
-
getExcludedPropertiesToEntity
protected Object[] getExcludedPropertiesToEntity(ContactInfoDTO dto)
Description copied from class:CRUDServiceImplMay be overridden in order to exclude properties when converting the given DTO to entity- Overrides:
getExcludedPropertiesToEntityin classCRUDServiceImpl<ContactInfo,QContactInfo,ContactInfoDTO,ContactInfoData,UserLocatorVO>
-
onAfterSave
protected void onAfterSave(ContactInfo contactInfo, ContactInfo currentCopy, Object dataFromOnBeforeSave)
Description copied from class:CRUDServiceImplMay be overridden in order to perform custom logic after saving an entity- Overrides:
onAfterSavein classCRUDServiceImpl<ContactInfo,QContactInfo,ContactInfoDTO,ContactInfoData,UserLocatorVO>
-
onBeforeRemove
protected void onBeforeRemove(ContactInfo contactInfo)
Description copied from class:CRUDServiceImplMay be overridden in order to perform custom logic before removing an entity- Overrides:
onBeforeRemovein classCRUDServiceImpl<ContactInfo,QContactInfo,ContactInfoDTO,ContactInfoData,UserLocatorVO>
-
onBeforeSave
protected Object onBeforeSave(ContactInfo contactInfo, ContactInfo 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<ContactInfo,QContactInfo,ContactInfoDTO,ContactInfoData,UserLocatorVO>
-
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(ContactInfoDTO dto)
- Specified by:
resolveValidatorin classCRUDServiceImpl<ContactInfo,QContactInfo,ContactInfoDTO,ContactInfoData,UserLocatorVO>
-
shouldCheckConfirmationPassword
protected boolean shouldCheckConfirmationPassword(ContactInfo entity, 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<ContactInfo,QContactInfo,ContactInfoDTO,ContactInfoData,UserLocatorVO>
-
-