@Test(expected = UnsupportedOperationException.class) public void testRemoveDefaultGroup() throws PAPException { when(group.isDefaultGroup()).thenReturn(true); container.removeGroup(group, newGroup); }
public void removeGroup(OnapPDPGroup group, OnapPDPGroup newGroup) throws PAPException { if (LOGGER.isTraceEnabled()) { LOGGER.trace("removeGroup: " + group + " new group for PDPs: " + newGroup); } if (group.isDefaultGroup()) { throw new UnsupportedOperationException("You can't remove the Default Group."); } try { this.papEngine.removeGroup(group, newGroup); } catch (NullPointerException | PAPException e) { LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Failed to removeGroup " + group.getId(), e); throw new PAPException("Failed to remove group '" + group.getId() + "'", e); } }
PDPGroupContainer extends PolicyItemSetChangeNotifier implements PolicyContainer.Indexed, PolicyContainer.ItemSetChangeNotifier { public void removeGroup(OnapPDPGroup group, OnapPDPGroup newGroup) throws PAPException { if (LOGGER.isTraceEnabled()) { LOGGER.trace("removeGroup: " + group + " new group for PDPs: " + newGroup); } if (group.isDefaultGroup()) { throw new UnsupportedOperationException("You can't remove the Default Group."); } try { this.papEngine.removeGroup(group, newGroup); } catch (NullPointerException | PAPException e) { LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Failed to removeGroup " + group.getId(), e); throw new PAPException("Failed to remove group '" + group.getId() + "'", e); } } }
PDPGroupContainer extends PolicyItemSetChangeNotifier implements PolicyContainer.Indexed, PolicyContainer.ItemSetChangeNotifier { public void removeGroup(OnapPDPGroup group, OnapPDPGroup newGroup) throws PAPException { if (LOGGER.isTraceEnabled()) { LOGGER.trace("removeGroup: " + group + " new group for PDPs: " + newGroup); } if (group.isDefaultGroup()) { throw new UnsupportedOperationException("You can't remove the Default Group."); } try { this.papEngine.removeGroup(group, newGroup); } catch (NullPointerException | PAPException e) { LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Failed to removeGroup " + group.getId(), e); throw new PAPException("Failed to remove group '" + group.getId() + "'", e); } } PDPGroupContainer(PAPPolicyEngine papPolicyEngine); }
PDPGroupContainer extends PolicyItemSetChangeNotifier implements PolicyContainer.Indexed, PolicyContainer.ItemSetChangeNotifier { public void removeGroup(OnapPDPGroup group, OnapPDPGroup newGroup) throws PAPException { if (LOGGER.isTraceEnabled()) { LOGGER.trace("removeGroup: " + group + " new group for PDPs: " + newGroup); } if (group.isDefaultGroup()) { throw new UnsupportedOperationException("You can't remove the Default Group."); } try { this.papEngine.removeGroup(group, newGroup); } catch (NullPointerException | PAPException e) { LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Failed to removeGroup " + group.getId(), e); throw new PAPException("Failed to remove group '" + group.getId() + "'", e); } } PDPGroupContainer(PAPPolicyEngine papPolicyEngine); boolean isSupported(Object itemId); synchronized void refreshGroups(); List<OnapPDPGroup> getGroups(); void makeDefault(OnapPDPGroup group); void removeGroup(OnapPDPGroup group, OnapPDPGroup newGroup); void removePDP(OnapPDP pdp, OnapPDPGroup group); void updatePDP(OnapPDP pdp); void updateGroup(OnapPDPGroup group); void updateGroup(OnapPDPGroup group, String userName); @Override Collection<?> getContainerPropertyIds(); @Override Collection<?> getItemIds(); @Override List<?> getItemIds(int startIndex, int numberOfItems); @Override Class<?> getType(Object propertyId); @Override int size(); @Override boolean containsId(Object itemId); @Override Object addItem(); void addNewGroup(String name, String description); void addNewPDP(String id, OnapPDPGroup group, String name, String description, int jmxport); void movePDP(OnapPDP pdp, OnapPDPGroup group); @Override boolean addContainerProperty(Object propertyId, Class<?> type, Object defaultValue); @Override boolean removeContainerProperty(Object propertyId); @Override boolean removeAllItems(); @Override void addItemSetChangeListener(ItemSetChangeListener listener); @Override Object nextItemId(Object itemId); @Override Object prevItemId(Object itemId); @Override Object firstItemId(); @Override Object lastItemId(); @Override boolean isFirstId(Object itemId); @Override boolean isLastId(Object itemId); @Override Object addItemAfter(Object previousItemId); @Override int indexOfId(Object itemId); @Override Object getIdByIndex(int index); @Override Object addItemAt(int index); @Override boolean removeItem(Object itemId); }
PDPGroupContainer extends PolicyItemSetChangeNotifier implements PolicyContainer.Indexed, PolicyContainer.ItemSetChangeNotifier { public void removeGroup(OnapPDPGroup group, OnapPDPGroup newGroup) throws PAPException { if (LOGGER.isTraceEnabled()) { LOGGER.trace("removeGroup: " + group + " new group for PDPs: " + newGroup); } if (group.isDefaultGroup()) { throw new UnsupportedOperationException("You can't remove the Default Group."); } try { this.papEngine.removeGroup(group, newGroup); } catch (NullPointerException | PAPException e) { LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Failed to removeGroup " + group.getId(), e); throw new PAPException("Failed to remove group '" + group.getId() + "'", e); } } PDPGroupContainer(PAPPolicyEngine papPolicyEngine); boolean isSupported(Object itemId); synchronized void refreshGroups(); List<OnapPDPGroup> getGroups(); void makeDefault(OnapPDPGroup group); void removeGroup(OnapPDPGroup group, OnapPDPGroup newGroup); void removePDP(OnapPDP pdp, OnapPDPGroup group); void updatePDP(OnapPDP pdp); void updateGroup(OnapPDPGroup group); void updateGroup(OnapPDPGroup group, String userName); @Override Collection<?> getContainerPropertyIds(); @Override Collection<?> getItemIds(); @Override List<?> getItemIds(int startIndex, int numberOfItems); @Override Class<?> getType(Object propertyId); @Override int size(); @Override boolean containsId(Object itemId); @Override Object addItem(); void addNewGroup(String name, String description); void addNewPDP(String id, OnapPDPGroup group, String name, String description, int jmxport); void movePDP(OnapPDP pdp, OnapPDPGroup group); @Override boolean addContainerProperty(Object propertyId, Class<?> type, Object defaultValue); @Override boolean removeContainerProperty(Object propertyId); @Override boolean removeAllItems(); @Override void addItemSetChangeListener(ItemSetChangeListener listener); @Override Object nextItemId(Object itemId); @Override Object prevItemId(Object itemId); @Override Object firstItemId(); @Override Object lastItemId(); @Override boolean isFirstId(Object itemId); @Override boolean isLastId(Object itemId); @Override Object addItemAfter(Object previousItemId); @Override int indexOfId(Object itemId); @Override Object getIdByIndex(int index); @Override Object addItemAt(int index); @Override boolean removeItem(Object itemId);  }