@Override public SContactInfo createUserContactInfo(final SContactInfo contactInfo) throws SUserCreationException { final String methodName = "createUserContactInfo"; final String message = "Adding a new user contact information for user with id " + contactInfo.getUserId(); final SContactInfoLogBuilder logBuilder = getUserContactInfoLog(ActionType.CREATED, message, contactInfo); try { recorder.recordInsert(new InsertRecord(contactInfo), USER_CONTACT_INFO); log(contactInfo.getId(), SQueriableLog.STATUS_OK, logBuilder, methodName); return contactInfo; } catch (final SRecorderException re) { log(contactInfo.getId(), SQueriableLog.STATUS_FAIL, logBuilder, methodName); throw new SUserCreationException(re); } }
@Override public SContactInfo createUserContactInfo(final SContactInfo contactInfo) throws SUserCreationException { final String methodName = "createUserContactInfo"; final String message = "Adding a new user contact information for user with id " + contactInfo.getUserId(); final SContactInfoLogBuilder logBuilder = getUserContactInfoLog(ActionType.CREATED, message, contactInfo); try { recorder.recordInsert(new InsertRecord(contactInfo), USER_CONTACT_INFO); log(contactInfo.getId(), SQueriableLog.STATUS_OK, logBuilder, methodName); return contactInfo; } catch (final SRecorderException re) { log(contactInfo.getId(), SQueriableLog.STATUS_FAIL, logBuilder, methodName); throw new SUserCreationException(re); } }
@Override public void updateUserContactInfo(final SContactInfo contactInfo, final EntityUpdateDescriptor descriptor) throws SIdentityException { final String methodName = "updateUserContactInfo"; final SContactInfoLogBuilder logBuilder = getUserContactInfoLog(ActionType.UPDATED, "Updating " + (contactInfo.isPersonal() ? "personal" : "professional") + " user contact Info for user with Id " + contactInfo.getUserId(), contactInfo); try { recorder.recordUpdate(UpdateRecord.buildSetFields(contactInfo, descriptor), USER_CONTACT_INFO); log(contactInfo.getId(), SQueriableLog.STATUS_OK, logBuilder, methodName); } catch (final SRecorderException re) { log(contactInfo.getId(), SQueriableLog.STATUS_FAIL, logBuilder, methodName); throw new SUserUpdateException(re); } }
@Override public void updateUserContactInfo(final SContactInfo contactInfo, final EntityUpdateDescriptor descriptor) throws SIdentityException { final String methodName = "updateUserContactInfo"; final SContactInfoLogBuilder logBuilder = getUserContactInfoLog(ActionType.UPDATED, "Updating " + (contactInfo.isPersonal() ? "personal" : "professional") + " user contact Info for user with Id " + contactInfo.getUserId(), contactInfo); try { recorder.recordUpdate(UpdateRecord.buildSetFields(contactInfo, descriptor), USER_CONTACT_INFO); log(contactInfo.getId(), SQueriableLog.STATUS_OK, logBuilder, methodName); } catch (final SRecorderException re) { log(contactInfo.getId(), SQueriableLog.STATUS_FAIL, logBuilder, methodName); throw new SUserUpdateException(re); } }