use of org.eclipse.sw360.datahandler.thrift.AddDocumentRequestSummary in project sw360portal by sw360.
the class Sw360ReleaseService method createRelease.
public Release createRelease(Release release, User sw360User) throws TException {
ComponentService.Iface sw360ComponentClient = getThriftComponentClient();
AddDocumentRequestSummary documentRequestSummary = sw360ComponentClient.addRelease(release, sw360User);
if (documentRequestSummary.getRequestStatus() == AddDocumentRequestStatus.SUCCESS) {
release.setId(documentRequestSummary.getId());
return release;
} else if (documentRequestSummary.getRequestStatus() == AddDocumentRequestStatus.DUPLICATE) {
throw new DataIntegrityViolationException("sw360 release with name '" + release.getName() + "' already exists.");
}
return null;
}
Aggregations