Search in sources :

Example 1 with BlackDuckRequest

use of com.synopsys.integration.blackduck.service.request.BlackDuckRequest in project hub-alert by blackducksoftware.

the class BlackDuckSSOConfigRetriever method retrieve.

public BlackDuckSSOConfigView retrieve() throws AlertException {
    BlackDuckRequestBuilder requestBuilder = new BlackDuckRequestBuilder().acceptMimeType(SSO_CONFIGURATION_MIME_TYPE);
    UrlSingleResponse<BlackDuckSSOConfigView> ssoConfigurationSingleResponse = apiDiscovery.metaSingleResponse(SSO_CONFIGURATION_PATH);
    BlackDuckRequest<BlackDuckSSOConfigView, UrlSingleResponse<BlackDuckSSOConfigView>> ssoConfigurationRequest = new BlackDuckRequest<>(requestBuilder, ssoConfigurationSingleResponse);
    try {
        return blackDuckApiClient.getResponse(ssoConfigurationRequest);
    } catch (IntegrationException e) {
        String errorMessage = String.format("Unable to retrieve SSO configuration from Black Duck: %s", e.getMessage());
        throw new AlertException(errorMessage, e);
    }
}
Also used : UrlSingleResponse(com.synopsys.integration.blackduck.api.core.response.UrlSingleResponse) IntegrationException(com.synopsys.integration.exception.IntegrationException) BlackDuckRequestBuilder(com.synopsys.integration.blackduck.http.BlackDuckRequestBuilder) BlackDuckRequest(com.synopsys.integration.blackduck.service.request.BlackDuckRequest) AlertException(com.synopsys.integration.alert.api.common.model.exception.AlertException)

Aggregations

AlertException (com.synopsys.integration.alert.api.common.model.exception.AlertException)1 UrlSingleResponse (com.synopsys.integration.blackduck.api.core.response.UrlSingleResponse)1 BlackDuckRequestBuilder (com.synopsys.integration.blackduck.http.BlackDuckRequestBuilder)1 BlackDuckRequest (com.synopsys.integration.blackduck.service.request.BlackDuckRequest)1 IntegrationException (com.synopsys.integration.exception.IntegrationException)1