public Map<String, MinigEmail> getEmails() { Map<String, MinigEmail> ret = new HashMap<String, MinigEmail>(); for (String lbl : obm.getEmails().keySet()) { Email e = obm.getEmails().get(lbl); ret.put(lbl, new MinigEmail(e.getEmail())); } return ret; }
public MinigContact( String lastName, String firstName, String email, String function, String homeVoice, String cellVoice, String street, String zip, String location) { obm = new Contact(); obm.setLastname(lastName); obm.setFirstname(firstName); obm.addEmail("INTERNET;X-OBM-Ref1", new Email(email)); obm.setTitle(function); // TODO add missing fields }
@Override public int compareTo(MinigContact o) { if (obm.getUid() == o.obm.getUid()) { return 0; } else { return getLastname().compareToIgnoreCase(o.getLastname()); } }
public void addAddress(String lbl, MinigAddress p) { obm.addAddress( lbl, new Address( p.getStreet(), p.getZipCode(), p.getExpressPostal(), p.getTown(), p.getCountry(), p.getState())); }
public String getDisplayName() { StringBuilder ret = new StringBuilder(); // last filled & maybe first if (!empty(getLastname())) { ret.append(getLastname()); if (!empty(getFirstname())) { ret.append(' '); ret.append(getFirstname()); } } else if (!empty(getFirstname())) { // last empty, first filled ret.append(getFirstname()); } else { // both are empty logger.warn( "contact with both first & last empty: obm.id: " + obm.getUid() + " mails: " + getEmails().size()); ret.append("[John Doe] (obm.id: " + obm.getUid() + ")"); } return ret.toString(); }
public String toString() { return obm.toString(); }
public void setBirthdayId(Integer birthdayId) { obm.setBirthdayId(birthdayId); }
public void setAssistant(String assistant) { obm.setAssistant(assistant); }
public void setUid(Integer uid) { obm.setUid(uid); }
public void setComment(String comment) { obm.setComment(comment); }
public void createOrUpdate(Contact c) { logger.info("[contact " + c.getUid() + "] scheduled for solr indexing"); ContactIndexer ci = contactIndexerFactory.createIndexer(sContact, c); executor.execute(ci); }
public void addEmail(String lbl, MinigEmail email) { obm.addEmail(lbl, new Email(email.getEmail())); }
public void addPhone(String lbl, MinigPhone p) { obm.addPhone(lbl, new Phone(p.getNumber())); }
public void setLastname(String lastname) { obm.setLastname(lastname); }
public void setManager(String manager) { obm.setManager(manager); }
public void setFirstname(String firstname) { obm.setFirstname(firstname); }
public void setEntityId(Integer entityId) { obm.setEntityId(entityId); }
public void setCompany(String company) { obm.setCompany(company); }
public void setBirthday(Date birthday) { obm.setBirthday(birthday); }
public boolean equals(Object obj) { return obm.equals(obj); }
public void setMiddlename(String middlename) { obm.setMiddlename(middlename); }
public void setCollected(boolean collected) { obm.setCollected(collected); }
public void addIMIdentifier(String lbl, MinigIM imid) { obm.addIMIdentifier(lbl, new InstantMessagingId(imid.getProtocol(), imid.getId())); }
public void setService(String service) { obm.setService(service); }
public void addWebsite(String lbl, MinigWebsite p) { obm.addWebsite(lbl, new Website(p.getUrl())); }
public void setSpouse(String spouse) { obm.setSpouse(spouse); }
public String getAka() { return obm.getAka(); }
public void setSuffix(String suffix) { obm.setSuffix(suffix); }
public void delete(Contact c) { logger.info("[contact " + c.getUid() + "] scheduled for solr removal"); Remover rm = new Remover(sContact, c.getUid().toString()); executor.execute(rm); }
public void setTitle(String title) { obm.setTitle(title); }