Search in sources :

Example 1 with ProjectRequestBuilder

use of com.blackducksoftware.integration.hub.service.model.ProjectRequestBuilder in project hub-detect by blackducksoftware.

the class HubManager method ensureProjectVersionExists.

public ProjectVersionView ensureProjectVersionExists(final DetectProject detectProject, final ProjectService projectService) throws IntegrationException {
    final ProjectRequestBuilder builder = new ProjectRequestBuilder();
    builder.setProjectName(detectProject.getProjectName());
    builder.setVersionName(detectProject.getProjectVersionName());
    builder.setProjectLevelAdjustments(detectConfiguration.getProjectLevelMatchAdjustments());
    builder.setPhase(detectConfiguration.getProjectVersionPhase());
    builder.setDistribution(detectConfiguration.getProjectVersionDistribution());
    builder.setProjectTier(detectConfiguration.getProjectTier());
    builder.setReleaseComments(detectConfiguration.getProjectVersionNotes());
    final ProjectRequest projectRequest = builder.build();
    final ProjectVersionWrapper projectVersionWrapper = projectService.getProjectVersionAndCreateIfNeeded(projectRequest);
    return projectVersionWrapper.getProjectVersionView();
}
Also used : ProjectRequestBuilder(com.blackducksoftware.integration.hub.service.model.ProjectRequestBuilder) ProjectRequest(com.blackducksoftware.integration.hub.api.generated.component.ProjectRequest) ProjectVersionWrapper(com.blackducksoftware.integration.hub.service.model.ProjectVersionWrapper)

Example 2 with ProjectRequestBuilder

use of com.blackducksoftware.integration.hub.service.model.ProjectRequestBuilder in project hub-detect by blackducksoftware.

the class DetectProject method createDefaultProjectRequestBuilder.

public ProjectRequestBuilder createDefaultProjectRequestBuilder(final DetectConfiguration detectConfiguration) {
    final ProjectRequestBuilder builder = new ProjectRequestBuilder();
    builder.setProjectName(getProjectName());
    builder.setVersionName(getProjectVersionName());
    builder.setProjectLevelAdjustments(detectConfiguration.getProjectLevelMatchAdjustments());
    builder.setPhase(detectConfiguration.getProjectVersionPhase());
    builder.setDistribution(detectConfiguration.getProjectVersionDistribution());
    builder.setProjectTier(detectConfiguration.getProjectTier());
    builder.setReleaseComments(detectConfiguration.getProjectVersionNotes());
    return builder;
}
Also used : ProjectRequestBuilder(com.blackducksoftware.integration.hub.service.model.ProjectRequestBuilder)

Aggregations

ProjectRequestBuilder (com.blackducksoftware.integration.hub.service.model.ProjectRequestBuilder)2 ProjectRequest (com.blackducksoftware.integration.hub.api.generated.component.ProjectRequest)1 ProjectVersionWrapper (com.blackducksoftware.integration.hub.service.model.ProjectVersionWrapper)1