use of com.epam.ta.reportportal.core.events.activity.FilterDeletedEvent in project service-api by reportportal.
the class DeleteUserFilterHandlerImpl method deleteFilter.
@Override
public OperationCompletionRS deleteFilter(Long id, ReportPortalUser.ProjectDetails projectDetails, ReportPortalUser user) {
UserFilter userFilter = getShareableEntityHandler.getAdministrated(id, projectDetails);
expect(userFilter.getProject().getId(), Predicate.isEqual(projectDetails.getProjectId())).verify(USER_FILTER_NOT_FOUND, id, projectDetails.getProjectId(), user.getUserId());
userFilterRepository.delete(userFilter);
aclHandler.deleteAclForObject(userFilter);
messageBus.publishActivity(new FilterDeletedEvent(TO_ACTIVITY_RESOURCE.apply(userFilter), user.getUserId(), user.getUsername()));
return new OperationCompletionRS("User filter with ID = '" + id + "' successfully deleted.");
}
Aggregations