@Override public final Map<String, List<String>> getAppsMap() { Map<String, List<String>> appsMap = OtfCachedListsDTO.getAppsMap(); if (appsMap == null || appsMap.size() == 0) { appsMap = new HashMap<String, List<String>>(); for (OtfApplication app : getLocalModel().getApps().getApplications().values()) { List<String> grpNames = new ArrayList<String>(); List<OtfGroup> grps = getGroupsByApp(app); for (OtfGroup grp : grps) { grpNames.add(grp.getName()); } Collections.sort(grpNames); appsMap.put(app.getName(), grpNames); } // add user admin even if only dir String useradminapp = getAdminApp(); if (!appsMap.containsKey(useradminapp)) { if (getDirsMap().containsKey(useradminapp)) { appsMap.put(useradminapp, getDirsMap().get(useradminapp)); } } setAppsMap(appsMap); } return appsMap; }
@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; }
@Override public final Map<String, List<String>> getDirsMap() { Map<String, List<String>> dirsMap = OtfCachedListsDTO.getDirsMap(); if (dirsMap == null || dirsMap.isEmpty()) { dirsMap = new HashMap<String, List<String>>(); for (String dirName : getLocalModel().getDirs().getDirectories().keySet()) { List<String> grpNames = new ArrayList<String>(); List<OtfGroup> grps = getGroupsByDirName(dirName); for (OtfGroup grp : grps) { grpNames.add(grp.getName()); } Collections.sort(grpNames); dirsMap.put(dirName, grpNames); } setDirsMap(dirsMap); } return dirsMap; }