@DELETE @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) public UpdateResultBean deleteProfiles(List<String> profileIds, @Context HttpServletRequest servletRequest) { if (log.isDebugEnabled()) { log.debug(String.format("processing DELETE on /profiler for %s", profileIds)); } checkPrivilege(servletRequest, JetspeedActions.VIEW); if (profileIds == null || profileIds.size() == 0) { throw new WebApplicationException(Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity( new UpdateResultBean(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), "Profile ids to delete not specified")).build()); } try { //profileIds = PathSegmentUtils.parseNames(profileIdsString); for (String id : profileIds) { ProfilingRule rule = profiler.getRule(id); if (rule != null) { profiler.deleteProfilingRule(rule); } } return new UpdateResultBean(Response.Status.OK.getStatusCode(), "OK"); } catch (Exception e) { String message = String.format("Error converting profiler ids [%s]", profileIds); log.debug(message); throw new WebApplicationException(Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity( new UpdateResultBean(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), message)).build()); } }
protected void deleteData(Map<String,Object> settings, Logger log) throws SerializerException { if (isSettingSet(settings, JetspeedSerializer.KEY_PROCESS_PROFILER)) { log.info("deleting profiling rules and user profiling rules"); try { String anonymousUser = userManager.getAnonymousUser(); for (User _user : userManager.getUsers("")) { for (PrincipalRule rule : pm.getRulesForPrincipal(_user)) { pm.deletePrincipalRule(rule); } } Iterator<ProfilingRule> _itRules = pm.getRules().iterator(); while ( _itRules.hasNext() ) { pm.deleteProfilingRule(_itRules.next()); } } catch (Exception e) { throw new SerializerException(e); } } }