public void setPanelList(int armID, Set <String> panels) throws ClipsServerException {
checkCommandAccessibility(COMMAND_HANDLE_ARM);
Iterator i = getArmList(armID).iterator();
while(i.hasNext()) {
ArmPanel armPanel = (ArmPanel) i.next();
String panel = armPanel.getKey().getPanel();
if(!panels.contains(panel)) {
manager.remove(armPanel);
} else {
panels.remove(panel);
}
}
Iterator<String> newPS = panels.iterator();
while(newPS.hasNext()) {
ArmPanel panel = new ArmPanel();
panel.setKey(new ArmPanelPK(newPS.next(), armID));
manager.persist(panel);
}
}