delete pac

This commit is contained in:
Peter Hormanns 2011-07-28 17:45:17 +00:00
parent 468a6f1be5
commit 65f11f1ad1

View File

@ -44,7 +44,7 @@ public class PacProcessorFactory implements EntityProcessorFactory {
UnixUser unixUser = getPacAdminUser(pac); UnixUser unixUser = getPacAdminUser(pac);
String password = PwGenerator.generatePassword(7, flagBuilder.build(), 100, random); String password = PwGenerator.generatePassword(7, flagBuilder.build(), 100, random);
Map<String, String> hiveValues = fillHiveValues(hive); Map<String, String> hiveValues = fillHiveValues(hive);
List<Map<String, String>> pacValuesList = fillPacValuesList(hive); List<Map<String, String>> pacValuesList = fillPacValuesList(hive, null);
Map<String, String> emailVars = fillEMailValues(pacName, customerEMail, password); Map<String, String> emailVars = fillEMailValues(pacName, customerEMail, password);
Processor priProcessor = new CompoundProcessor( Processor priProcessor = new CompoundProcessor(
createAddUserProc(pacName, unixUser, password), createAddUserProc(pacName, unixUser, password),
@ -70,7 +70,7 @@ public class PacProcessorFactory implements EntityProcessorFactory {
Pac pac = (Pac) entity; Pac pac = (Pac) entity;
Hive hive = pac.getHive(); Hive hive = pac.getHive();
Map<String, String> hiveValues = fillHiveValues(hive); Map<String, String> hiveValues = fillHiveValues(hive);
List<Map<String, String>> pacValuesList = fillPacValuesList(hive); List<Map<String, String>> pacValuesList = fillPacValuesList(hive, pac);
WaitingTasksProcessor waitingProcessor = new WaitingTasksProcessor(new CompoundProcessor( WaitingTasksProcessor waitingProcessor = new WaitingTasksProcessor(new CompoundProcessor(
createEtcHostsProc(hiveValues, pacValuesList), createEtcHostsProc(hiveValues, pacValuesList),
createNetworkInterfacesProc(hiveValues, pacValuesList), createNetworkInterfacesProc(hiveValues, pacValuesList),
@ -163,15 +163,17 @@ public class PacProcessorFactory implements EntityProcessorFactory {
return hiveValues; return hiveValues;
} }
private List<Map<String, String>> fillPacValuesList(Hive hive) { private List<Map<String, String>> fillPacValuesList(Hive hive, Pac pac) {
List<Map<String, String>> pacValuesList = new ArrayList<Map<String, String>>(); List<Map<String, String>> pacValuesList = new ArrayList<Map<String, String>>();
Set<Pac> pacsSet = hive.getPacs(); Set<Pac> pacsSet = hive.getPacs();
for (Pac p : pacsSet) { for (Pac p : pacsSet) {
HashMap<String, String> pacValues = new HashMap<String, String>(); HashMap<String, String> pacValues = new HashMap<String, String>();
pacValues.put("PAC", p.getName()); pacValues.put("PAC", p.getName());
pacValues.put("PAC_IP", p.getCurINetAddr().getInetAddr()); pacValues.put("PAC_IP", p.getCurINetAddr().getInetAddr());
if (pac == null || pac.getId() != p.getId()) {
pacValuesList.add(pacValues); pacValuesList.add(pacValues);
} }
}
return pacValuesList; return pacValuesList;
} }