@PreAuthorize("hasRole('" + StandardEntitlement.ANYTYPE_DELETE + "')") public AnyTypeTO delete(final String key) { AnyType anyType = anyTypeDAO.find(key); if (anyType == null) { LOG.error("Could not find anyType '" + key + "'"); throw new NotFoundException(key); } Integer anyObjects = anyObjectDAO.countByType().get(anyType); if (anyObjects != null && anyObjects > 0) { LOG.error("{} AnyObject instances found for {}, aborting", anyObjects, anyType); SyncopeClientException sce = SyncopeClientException.build(ClientExceptionType.InvalidAnyType); sce.getElements().add("AnyObject instances found for " + key); throw sce; } try { return binder.delete(anyType); } catch (IllegalArgumentException e) { SyncopeClientException sce = SyncopeClientException.build(ClientExceptionType.InvalidRequest); sce.getElements().add(e.getMessage()); throw sce; } }
numbersInfo.getGroupsByRealm().putAll(groupDAO.countByRealm()); Map<AnyType, Integer> anyObjectNumbers = anyObjectDAO.countByType(); int i = 0; for (Iterator<Map.Entry<AnyType, Integer>> itor = anyObjectNumbers.entrySet().iterator();