@Override public final OtfGroup getGroupById(final String idIn) { for (OtfDirectory mDirectory : getLocalModel().getDirs().getDirectories().values()) { if (mDirectory != null) { for (OtfGroup grp : mDirectory.getGroups().getGroups().values()) { if (grp.getIdIfSet().equals(idIn)) { return grp; } } } } return null; }
public final Collection<String> getDirNamesForUser(final String username) { ArrayList<String> dirs = new ArrayList<String>(); for (OtfDirectory dir : getLocalModel().getDirs().getDirectories().values()) { if (!dir.getAccounts().getAccounts().isEmpty()) { for (OtfAccount user : dir.getAccounts().getAccounts().values()) { if (user.getName().equals(username)) { dirs.add(dir.getName()); } } } } return dirs; }
@Override public final Map<String, OtfAccount> getAllAccounts() { Map<String, OtfAccount> allAccounts = OtfCachedListsDTO.getAllAccountsMap(); if (allAccounts == null || allAccounts.size() == 0) { allAccounts = new HashMap<String, OtfAccount>(); for (OtfDirectory dir : getModel().getDirs().getDirectories().values()) { if (!dir.getAccounts().getAccounts().isEmpty()) { for (OtfAccount user : dir.getAccounts().getAccounts().values()) { allAccounts.put(user.getName(), user); } } } setAllAccounts(allAccounts); } return allAccounts; }