Search in sources :

Example 1 with FilterDeletedEvent

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.");
}
Also used : FilterDeletedEvent(com.epam.ta.reportportal.core.events.activity.FilterDeletedEvent) UserFilter(com.epam.ta.reportportal.entity.filter.UserFilter) OperationCompletionRS(com.epam.ta.reportportal.ws.model.OperationCompletionRS)

Aggregations

FilterDeletedEvent (com.epam.ta.reportportal.core.events.activity.FilterDeletedEvent)1 UserFilter (com.epam.ta.reportportal.entity.filter.UserFilter)1 OperationCompletionRS (com.epam.ta.reportportal.ws.model.OperationCompletionRS)1