Search in sources :

Example 1 with SamlProvidersReloadEvent

use of com.epam.reportportal.auth.event.SamlProvidersReloadEvent in project service-authorization by reportportal.

the class SamlIntegrationStrategy method save.

@Override
protected Integration save(Integration integration) {
    populateProviderDetails(integration);
    final Integration result = super.save(integration);
    eventPublisher.publishEvent(new SamlProvidersReloadEvent(result.getType()));
    return result;
}
Also used : Integration(com.epam.ta.reportportal.entity.integration.Integration) SamlProvidersReloadEvent(com.epam.reportportal.auth.event.SamlProvidersReloadEvent)

Example 2 with SamlProvidersReloadEvent

use of com.epam.reportportal.auth.event.SamlProvidersReloadEvent in project service-authorization by reportportal.

the class DeleteAuthIntegrationHandlerImpl method deleteAuthIntegrationById.

@Override
public OperationCompletionRS deleteAuthIntegrationById(Long integrationId) {
    Integration integration = integrationRepository.findById(integrationId).orElseThrow(() -> new ReportPortalException(ErrorType.INTEGRATION_NOT_FOUND, integrationId));
    BusinessRule.expect(integration.getType().getIntegrationGroup(), equalTo(IntegrationGroupEnum.AUTH)).verify(ErrorType.BAD_REQUEST_ERROR, "Integration should have an 'AUTH' integration group type.");
    integrationRepository.deleteById(integrationId);
    if (AuthIntegrationType.SAML.getName().equals(integration.getType().getName())) {
        eventPublisher.publishEvent(new SamlProvidersReloadEvent(integration.getType()));
    }
    return new OperationCompletionRS("Auth integration with id= " + integrationId + " has been successfully removed.");
}
Also used : Integration(com.epam.ta.reportportal.entity.integration.Integration) ReportPortalException(com.epam.ta.reportportal.exception.ReportPortalException) SamlProvidersReloadEvent(com.epam.reportportal.auth.event.SamlProvidersReloadEvent) OperationCompletionRS(com.epam.ta.reportportal.ws.model.OperationCompletionRS)

Aggregations

SamlProvidersReloadEvent (com.epam.reportportal.auth.event.SamlProvidersReloadEvent)2 Integration (com.epam.ta.reportportal.entity.integration.Integration)2 ReportPortalException (com.epam.ta.reportportal.exception.ReportPortalException)1 OperationCompletionRS (com.epam.ta.reportportal.ws.model.OperationCompletionRS)1