use of com.blackducksoftware.integration.exception.IntegrationException in project hub-fortify-ssc-integration-service by blackducksoftware.
the class MappingParser method createApplicationVersion.
/**
* Creates a new Application Version, updates the attributes and commits the application to mark it complete on the
* UI
*
* @param createRequest
* @return int - Application ID
* @throws IOException
* @throws IntegrationException
*/
private int createApplicationVersion(final CreateApplicationRequest createRequest) throws IOException, IntegrationException {
int applicationId = 0;
applicationId = fortifyApplicationVersionApi.createApplicationVersion(createRequest);
try {
final List<UpdateFortifyApplicationAttributesRequest> updateAttributerequest = addCustomAttributes();
logger.info("updateAttributerequest::" + updateAttributerequest);
fortifyApplicationVersionApi.updateApplicationAttributes(applicationId, updateAttributerequest);
final CommitFortifyApplicationRequest commitRequest = new CommitFortifyApplicationRequest(true);
fortifyApplicationVersionApi.commitApplicationVersion(applicationId, commitRequest);
} catch (final IOException e) {
fortifyApplicationVersionApi.deleteApplicationVersion(applicationId);
throw new IOException(e);
} catch (final IntegrationException e) {
fortifyApplicationVersionApi.deleteApplicationVersion(applicationId);
throw new IntegrationException(e);
}
return applicationId;
}
use of com.blackducksoftware.integration.exception.IntegrationException in project hub-fortify-ssc-integration-service by blackducksoftware.
the class HubServices method getComponentVersionRecommendations.
/**
* Get the Black Duck component version recommendations for the given component version
*
* @param componentVersionRemediatingUrl
* @return
* @throws IntegrationException
*/
public Recommendation getComponentVersionRecommendations(final String componentVersionRemediatingUrl) throws IntegrationException {
logger.debug("Getting Black Duck component version remediating");
Recommendation recommendation = null;
if (componentVersionRemediatingUrl != null) {
final HubService hubResponseService = hubServicesFactory.createHubService();
try {
recommendation = hubResponseService.getResponse(componentVersionRemediatingUrl, Recommendation.class);
} catch (final IntegrationException e) {
if (!e.getMessage().contains("Error: 404 : 404")) {
throw new IntegrationException(e);
}
}
}
return recommendation;
}
Aggregations