public final List<OtfGroup> getGroupsByApp(final OtfApplication app) { List<OtfGroup> groups = new ArrayList<OtfGroup>(); for (OtfAccountStore acs : app.getAccountStores().values()) { if (acs.isDir()) { String dirName = acs.getName(); groups.addAll(getGroupsByDirName(dirName)); } } return groups; }
public final List<String> getOtfAppNamesForUser(final String username) { ArrayList<String> appsList = new ArrayList<String>(); Collection<String> dirsforUser = getDirNamesForUser(username); for (OtfApplication app : getLocalModel().getApps().getApplications().values()) { for (String key : app.getAccountStores().keySet()) { if (dirsforUser.contains(key)) { appsList.add(app.getName()); } } } return appsList; }
@Override public final List<String> getDirsByAppName(final String appnameIn) { List<String> dirs = new ArrayList<String>(); OtfApplication oapp = getLocalModel().getApps().getAppByName(appnameIn); if (oapp != null) { Map<String, OtfAccountStore> acsmap = oapp.getAccountStores(); if (acsmap != null && acsmap.size() > 0) { for (OtfAccountStore acs : acsmap.values()) { if (acs.isDir()) { dirs.add(acs.getName()); } } } } return dirs; }