package net.sourceforge.fenixedu.domain.integration.gapps; import net.sourceforge.fenixedu.domain.Person; import net.sourceforge.fenixedu.domain.RootDomainObject; import net.sourceforge.fenixedu.domain.User; /** * This entity stores the data to synchronize Fénix users information with he's * Google Account. * * @author ISCTE\ajsco */ public class GoogleAccount extends GoogleAccount_Base { public GoogleAccount(final User user) { setRootDomainObject(RootDomainObject.getInstance()); setUser(user); setCreated(Boolean.FALSE); setActivated(Boolean.FALSE); setToSync(Boolean.FALSE); } public void initializeGmailFlag() { final Person person = getUser().getPerson(); if (person.hasStudent()) { if (!person.hasEmployee() && !person.hasCollaborator()) { setGmailBlocked(Boolean.FALSE); return; } } setGmailBlocked(Boolean.TRUE); } public void delete() { super.setUser(null); removeRootDomainObject(); super.deleteDomainObject(); } }