Search in sources :

Example 1 with CommitFortifyApplicationRequest

use of com.blackducksoftware.integration.fortify.model.CommitFortifyApplicationRequest in project hub-fortify-ssc-integration-service by blackducksoftware.

the class FortifyApplicationVersionApiTest method commitApplicationVersion.

public void commitApplicationVersion(int applicationId) throws IOException, IntegrationException {
    System.out.println("Executing commitApplicationVersion");
    CommitFortifyApplicationRequest request = new CommitFortifyApplicationRequest(true);
    fortifyApplicationVersionApi.commitApplicationVersion(applicationId, request);
}
Also used : CommitFortifyApplicationRequest(com.blackducksoftware.integration.fortify.model.CommitFortifyApplicationRequest)

Example 2 with CommitFortifyApplicationRequest

use of com.blackducksoftware.integration.fortify.model.CommitFortifyApplicationRequest in project hub-fortify-ssc-integration-service by blackducksoftware.

the class FortifyUploadApiTest method commitApplicationVersion.

public void commitApplicationVersion(int applicationId) throws IOException, IntegrationException {
    System.out.println("Executing commitApplicationVersion");
    CommitFortifyApplicationRequest request = new CommitFortifyApplicationRequest(true);
    fortifyApplicationVersionApi.commitApplicationVersion(applicationId, request);
}
Also used : CommitFortifyApplicationRequest(com.blackducksoftware.integration.fortify.model.CommitFortifyApplicationRequest)

Example 3 with CommitFortifyApplicationRequest

use of com.blackducksoftware.integration.fortify.model.CommitFortifyApplicationRequest 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(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);
        CommitFortifyApplicationRequest commitRequest = new CommitFortifyApplicationRequest(true);
        fortifyApplicationVersionApi.commitApplicationVersion(applicationId, commitRequest);
    } catch (IOException e) {
        fortifyApplicationVersionApi.deleteApplicationVersion(applicationId);
        throw new IOException(e);
    } catch (IntegrationException e) {
        fortifyApplicationVersionApi.deleteApplicationVersion(applicationId);
        throw new IntegrationException(e);
    }
    return applicationId;
}
Also used : IntegrationException(com.blackducksoftware.integration.exception.IntegrationException) UpdateFortifyApplicationAttributesRequest(com.blackducksoftware.integration.fortify.model.UpdateFortifyApplicationAttributesRequest) CommitFortifyApplicationRequest(com.blackducksoftware.integration.fortify.model.CommitFortifyApplicationRequest) IOException(java.io.IOException) JsonIOException(com.google.gson.JsonIOException)

Aggregations

CommitFortifyApplicationRequest (com.blackducksoftware.integration.fortify.model.CommitFortifyApplicationRequest)3 IntegrationException (com.blackducksoftware.integration.exception.IntegrationException)1 UpdateFortifyApplicationAttributesRequest (com.blackducksoftware.integration.fortify.model.UpdateFortifyApplicationAttributesRequest)1 JsonIOException (com.google.gson.JsonIOException)1 IOException (java.io.IOException)1