/** {@inheritDoc} */ @Override public void update(Observable userDao, Object object) { LogbookEntry newEntry = null; if (this.is(object, User.class)) { User user = (User) object; if (user.hasBeenAnonymized()) { newEntry = this.getEntryForUserAnonymized(user.getUsernameBeforeAnonym()); } else if (user.hasJustBeenInserted()) { // a new user was inserted newEntry = this.getEntryForUserNew(user); } else if (user.hasJustBeenDeleted()) { newEntry = this.getEntryForUserDeleted(user); } else { User old = FamDaoProxy.userDao().getUserFromUsername(user.getUsername()); newEntry = this.getEntryForUserUpdate(old, user); } } else if (this.is(object, ContactDetail.class)) { ContactDetail cd = (ContactDetail) object; newEntry = this.getEntryForContactDetails(cd); } if (newEntry != null) { newEntry.insert(); } else { FamLog.error("observed an unknown event: " + object.getClass(), 201403061006l); } }
/** @return the userSetThis */ public User getUserSetThis() { return FamDaoProxy.userDao().getUserFromUsername(this.usernameSetThis); }