|
|
@ -147,7 +147,7 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
applicationDTO.getApplicationReleaseDTOs().clear();
|
|
|
|
applicationDTO.getApplicationReleaseDTOs().clear();
|
|
|
|
|
|
|
|
|
|
|
|
ApplicationReleaseDTO applicationReleaseDTO = addApplicationReleaseArtifacts(applicationDTO.getType(),
|
|
|
|
ApplicationReleaseDTO applicationReleaseDTO = addApplicationReleaseArtifacts(applicationDTO.getType(),
|
|
|
|
applicationWrapper.getDeviceType(), initialApplicationReleaseDTO, applicationArtifact);
|
|
|
|
applicationWrapper.getDeviceType(), initialApplicationReleaseDTO, applicationArtifact, false);
|
|
|
|
applicationDTO.getApplicationReleaseDTOs().add(addImageArtifacts(applicationReleaseDTO, applicationArtifact));
|
|
|
|
applicationDTO.getApplicationReleaseDTOs().add(addImageArtifacts(applicationReleaseDTO, applicationArtifact));
|
|
|
|
} catch (UnexpectedServerErrorException e) {
|
|
|
|
} catch (UnexpectedServerErrorException e) {
|
|
|
|
String msg = "Error occurred when getting Device Type data.";
|
|
|
|
String msg = "Error occurred when getting Device Type data.";
|
|
|
@ -243,7 +243,6 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
categoryIds.add(category.get().getId());
|
|
|
|
categoryIds.add(category.get().getId());
|
|
|
|
this.applicationDAO.addCategoryMapping(categoryIds,appId,tenantId);
|
|
|
|
this.applicationDAO.addCategoryMapping(categoryIds,appId,tenantId);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//adding application tags
|
|
|
|
//adding application tags
|
|
|
|
List<String> tags = applicationWrapper.getTags();
|
|
|
|
List<String> tags = applicationWrapper.getTags();
|
|
|
|
if (!tags.isEmpty()) {
|
|
|
|
if (!tags.isEmpty()) {
|
|
|
@ -334,7 +333,7 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private ApplicationReleaseDTO addApplicationReleaseArtifacts(String applicationType, String deviceType,
|
|
|
|
private ApplicationReleaseDTO addApplicationReleaseArtifacts(String applicationType, String deviceType,
|
|
|
|
ApplicationReleaseDTO applicationReleaseDTO, ApplicationArtifact applicationArtifact)
|
|
|
|
ApplicationReleaseDTO applicationReleaseDTO, ApplicationArtifact applicationArtifact, boolean isNewRelease)
|
|
|
|
throws ResourceManagementException, ApplicationManagementException {
|
|
|
|
throws ResourceManagementException, ApplicationManagementException {
|
|
|
|
int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(true);
|
|
|
|
int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(true);
|
|
|
|
ApplicationStorageManager applicationStorageManager = Util.getApplicationStorageManager();
|
|
|
|
ApplicationStorageManager applicationStorageManager = Util.getApplicationStorageManager();
|
|
|
@ -355,7 +354,7 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
String packagename = applicationInstaller.getPackageName();
|
|
|
|
String packagename = applicationInstaller.getPackageName();
|
|
|
|
|
|
|
|
|
|
|
|
ConnectionManagerUtil.getDBConnection();
|
|
|
|
ConnectionManagerUtil.getDBConnection();
|
|
|
|
if (applicationReleaseDAO.isActiveReleaseExisitForPackageName(packagename, tenantId,
|
|
|
|
if (!isNewRelease && applicationReleaseDAO.isActiveReleaseExisitForPackageName(packagename, tenantId,
|
|
|
|
lifecycleStateManager.getEndState())) {
|
|
|
|
lifecycleStateManager.getEndState())) {
|
|
|
|
String msg = "Application release is already exist for the package name: " + packagename +
|
|
|
|
String msg = "Application release is already exist for the package name: " + packagename +
|
|
|
|
". Either you can delete all application releases for package " + packagename + " or "
|
|
|
|
". Either you can delete all application releases for package " + packagename + " or "
|
|
|
@ -378,7 +377,7 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
.verifyReleaseExistenceByHash(md5OfApp, tenantId)) {
|
|
|
|
.verifyReleaseExistenceByHash(md5OfApp, tenantId)) {
|
|
|
|
throw new BadRequestException(
|
|
|
|
throw new BadRequestException(
|
|
|
|
"Application release exists for the uploaded binary file. Application Type: "
|
|
|
|
"Application release exists for the uploaded binary file. Application Type: "
|
|
|
|
+ applicationType + " Device Tyep: " + deviceType);
|
|
|
|
+ applicationType + " Device Type: " + deviceType);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
applicationReleaseDTO.setAppHashValue(md5OfApp);
|
|
|
|
applicationReleaseDTO.setAppHashValue(md5OfApp);
|
|
|
@ -416,6 +415,94 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
return applicationReleaseDTO;
|
|
|
|
return applicationReleaseDTO;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private ApplicationReleaseDTO updateApplicationReleaseArtifacts(String applicationType, String deviceType,
|
|
|
|
|
|
|
|
ApplicationReleaseDTO applicationReleaseDTO, ApplicationArtifact applicationArtifact)
|
|
|
|
|
|
|
|
throws ResourceManagementException, ApplicationManagementException {
|
|
|
|
|
|
|
|
int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(true);
|
|
|
|
|
|
|
|
ApplicationStorageManager applicationStorageManager = Util.getApplicationStorageManager();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// The application executable artifacts such as apks are uploaded.
|
|
|
|
|
|
|
|
if (ApplicationType.ENTERPRISE.toString().equals(applicationType)) {
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
byte[] content = IOUtils.toByteArray(applicationArtifact.getInstallerStream());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try(ByteArrayInputStream binaryClone = new ByteArrayInputStream(content)){
|
|
|
|
|
|
|
|
String md5OfApp = StorageManagementUtil.getMD5(binaryClone);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (md5OfApp == null) {
|
|
|
|
|
|
|
|
String msg = "Error occurred while md5sum value retrieving process: application UUID "
|
|
|
|
|
|
|
|
+ applicationReleaseDTO.getUuid();
|
|
|
|
|
|
|
|
log.error(msg);
|
|
|
|
|
|
|
|
throw new ApplicationStorageManagementException(msg);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!applicationReleaseDTO.getAppHashValue().equals(md5OfApp)){
|
|
|
|
|
|
|
|
applicationReleaseDTO.setInstallerName(applicationArtifact.getInstallerName());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try (ByteArrayInputStream binary = new ByteArrayInputStream(content)) {
|
|
|
|
|
|
|
|
ApplicationInstaller applicationInstaller = applicationStorageManager
|
|
|
|
|
|
|
|
.getAppInstallerData(binary, deviceType);
|
|
|
|
|
|
|
|
String packagename = applicationInstaller.getPackageName();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ConnectionManagerUtil.getDBConnection();
|
|
|
|
|
|
|
|
if (applicationReleaseDAO.isActiveReleaseExisitForPackageName(packagename, tenantId,
|
|
|
|
|
|
|
|
lifecycleStateManager.getEndState())) {
|
|
|
|
|
|
|
|
String msg = "Application release is already exist for the package name: " + packagename +
|
|
|
|
|
|
|
|
". Either you can delete all application releases for package " + packagename + " or "
|
|
|
|
|
|
|
|
+ "you can add this app release as an new application release, under the existing "
|
|
|
|
|
|
|
|
+ "application.";
|
|
|
|
|
|
|
|
log.error(msg);
|
|
|
|
|
|
|
|
throw new ApplicationManagementException(msg);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
applicationReleaseDTO.setVersion(applicationInstaller.getVersion());
|
|
|
|
|
|
|
|
applicationReleaseDTO.setPackageName(packagename);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (this.applicationReleaseDAO
|
|
|
|
|
|
|
|
.verifyReleaseExistenceByHash(md5OfApp, tenantId)) {
|
|
|
|
|
|
|
|
throw new BadRequestException(
|
|
|
|
|
|
|
|
"Application release exists for the uploaded binary file. Application Type: "
|
|
|
|
|
|
|
|
+ applicationType + " Device Tyep: " + deviceType);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
applicationReleaseDTO.setAppHashValue(md5OfApp);
|
|
|
|
|
|
|
|
String deletingAppHashValue = applicationReleaseDTO.getAppHashValue();
|
|
|
|
|
|
|
|
try (ByteArrayInputStream binaryDuplicate = new ByteArrayInputStream(content)) {
|
|
|
|
|
|
|
|
applicationReleaseDTO = applicationStorageManager
|
|
|
|
|
|
|
|
.uploadReleaseArtifact(applicationReleaseDTO,applicationType,
|
|
|
|
|
|
|
|
deviceType, binaryDuplicate);
|
|
|
|
|
|
|
|
applicationStorageManager.copyImageArtifactsAndDeleteInstaller(deletingAppHashValue,
|
|
|
|
|
|
|
|
applicationReleaseDTO);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} catch (IOException e) {
|
|
|
|
|
|
|
|
String msg =
|
|
|
|
|
|
|
|
"Error occurred when getting byte array of binary file. Installer name: " + applicationArtifact
|
|
|
|
|
|
|
|
.getInstallerName();
|
|
|
|
|
|
|
|
log.error(msg);
|
|
|
|
|
|
|
|
throw new ApplicationStorageManagementException(msg);
|
|
|
|
|
|
|
|
} catch (DBConnectionException e) {
|
|
|
|
|
|
|
|
String msg = "Error occurred when getting database connection for verifying application package existence.";
|
|
|
|
|
|
|
|
log.error(msg);
|
|
|
|
|
|
|
|
throw new ApplicationManagementException(msg, e);
|
|
|
|
|
|
|
|
} catch (ApplicationManagementDAOException e) {
|
|
|
|
|
|
|
|
String msg = "Error occurred when executing the query for verifying application release existence for "
|
|
|
|
|
|
|
|
+ "the package.";
|
|
|
|
|
|
|
|
log.error(msg);
|
|
|
|
|
|
|
|
throw new ApplicationManagementException(msg, e);
|
|
|
|
|
|
|
|
} finally {
|
|
|
|
|
|
|
|
ConnectionManagerUtil.closeDBConnection();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else if (ApplicationType.WEB_CLIP.toString().equals(applicationType)) {
|
|
|
|
|
|
|
|
applicationReleaseDTO.setVersion(Constants.DEFAULT_VERSION);
|
|
|
|
|
|
|
|
applicationReleaseDTO.setInstallerName(applicationReleaseDTO.getUrl());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return applicationReleaseDTO;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private ApplicationReleaseDTO addImageArtifacts(ApplicationReleaseDTO applicationReleaseDTO,
|
|
|
|
private ApplicationReleaseDTO addImageArtifacts(ApplicationReleaseDTO applicationReleaseDTO,
|
|
|
|
ApplicationArtifact applicationArtifact) throws ResourceManagementException {
|
|
|
|
ApplicationArtifact applicationArtifact) throws ResourceManagementException {
|
|
|
|
ApplicationStorageManager applicationStorageManager = Util.getApplicationStorageManager();
|
|
|
|
ApplicationStorageManager applicationStorageManager = Util.getApplicationStorageManager();
|
|
|
@ -432,7 +519,40 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
applicationReleaseDTO.setScreenshotName1(scName);
|
|
|
|
applicationReleaseDTO.setScreenshotName1(scName);
|
|
|
|
} else if (counter == 2) {
|
|
|
|
} else if (counter == 2) {
|
|
|
|
applicationReleaseDTO.setScreenshotName2(scName);
|
|
|
|
applicationReleaseDTO.setScreenshotName2(scName);
|
|
|
|
|
|
|
|
} else if (counter == 3) {
|
|
|
|
|
|
|
|
applicationReleaseDTO.setScreenshotName3(scName);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
counter++;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Upload images
|
|
|
|
|
|
|
|
applicationReleaseDTO = applicationStorageManager
|
|
|
|
|
|
|
|
.uploadImageArtifacts(applicationReleaseDTO, applicationArtifact.getIconStream(),
|
|
|
|
|
|
|
|
applicationArtifact.getBannerStream(), new ArrayList<>(screenshots.values()));
|
|
|
|
|
|
|
|
return applicationReleaseDTO;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private ApplicationReleaseDTO updateImageArtifacts(ApplicationReleaseDTO applicationReleaseDTO,
|
|
|
|
|
|
|
|
ApplicationArtifact applicationArtifact) throws ResourceManagementException{
|
|
|
|
|
|
|
|
ApplicationStorageManager applicationStorageManager = Util.getApplicationStorageManager();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
applicationStorageManager.deleteImageArtifacts(applicationReleaseDTO);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
applicationReleaseDTO.setIconName(applicationArtifact.getIconName());
|
|
|
|
|
|
|
|
applicationReleaseDTO.setBannerName(applicationArtifact.getBannerName());
|
|
|
|
|
|
|
|
applicationReleaseDTO.setScreenshotName1(null);
|
|
|
|
|
|
|
|
applicationReleaseDTO.setScreenshotName2(null);
|
|
|
|
|
|
|
|
applicationReleaseDTO.setScreenshotName3(null);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Map<String, InputStream> screenshots = applicationArtifact.getScreenshots();
|
|
|
|
|
|
|
|
List<String> screenshotNames = new ArrayList<>(screenshots.keySet());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int counter = 1;
|
|
|
|
|
|
|
|
for (String scName : screenshotNames) {
|
|
|
|
|
|
|
|
if (counter == 1) {
|
|
|
|
|
|
|
|
applicationReleaseDTO.setScreenshotName1(scName);
|
|
|
|
|
|
|
|
} else if (counter == 2) {
|
|
|
|
|
|
|
|
applicationReleaseDTO.setScreenshotName2(scName);
|
|
|
|
} else if (counter == 3) {
|
|
|
|
} else if (counter == 3) {
|
|
|
|
applicationReleaseDTO.setScreenshotName3(scName);
|
|
|
|
applicationReleaseDTO.setScreenshotName3(scName);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -566,36 +686,25 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public ApplicationRelease createRelease(int applicationId,
|
|
|
|
public ApplicationRelease createRelease(int applicationId, ApplicationReleaseWrapper applicationReleaseWrapper,
|
|
|
|
ApplicationReleaseWrapper applicationReleaseWrapper, ApplicationArtifact applicationArtifact)
|
|
|
|
ApplicationArtifact applicationArtifact) throws ApplicationManagementException {
|
|
|
|
throws ApplicationManagementException {
|
|
|
|
|
|
|
|
int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(true);
|
|
|
|
int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(true);
|
|
|
|
ApplicationRelease applicationRelease;
|
|
|
|
ApplicationRelease applicationRelease;
|
|
|
|
if (log.isDebugEnabled()) {
|
|
|
|
if (log.isDebugEnabled()) {
|
|
|
|
log.debug("ApplicationDTO release request is received for the application id: " + applicationId);
|
|
|
|
log.debug("ApplicationDTO release request is received for the application id: " + applicationId);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
|
|
|
|
ApplicationDTO applicationDTO = getApplication(applicationId);
|
|
|
|
|
|
|
|
ApplicationReleaseDTO applicationReleaseDTO = uploadReleaseArtifacts(applicationReleaseWrapper,
|
|
|
|
|
|
|
|
applicationDTO, applicationArtifact);
|
|
|
|
ConnectionManagerUtil.beginDBTransaction();
|
|
|
|
ConnectionManagerUtil.beginDBTransaction();
|
|
|
|
ApplicationDTO applicationDTO = this.applicationDAO.getApplicationById(applicationId, tenantId);
|
|
|
|
|
|
|
|
if (applicationDTO == null) {
|
|
|
|
|
|
|
|
String msg = "Couldn't find application for the application Id: " + applicationId;
|
|
|
|
|
|
|
|
log.error(msg);
|
|
|
|
|
|
|
|
throw new NotFoundException(msg);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
DeviceType deviceType = getDeviceTypeData(applicationDTO.getDeviceTypeId());
|
|
|
|
|
|
|
|
ApplicationReleaseDTO applicationReleaseDTO = addApplicationReleaseArtifacts(applicationDTO.getType(),
|
|
|
|
|
|
|
|
deviceType.getName(), releaseWrapperToReleaseDTO(applicationReleaseWrapper),
|
|
|
|
|
|
|
|
applicationArtifact);
|
|
|
|
|
|
|
|
applicationReleaseDTO = addImageArtifacts(applicationReleaseDTO, applicationArtifact);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String initialstate = lifecycleStateManager.getInitialState();
|
|
|
|
String initialstate = lifecycleStateManager.getInitialState();
|
|
|
|
applicationReleaseDTO.setCurrentState(initialstate);
|
|
|
|
applicationReleaseDTO.setCurrentState(initialstate);
|
|
|
|
LifecycleStateDTO lifecycleState = getLifecycleStateInstance(initialstate, initialstate);
|
|
|
|
LifecycleStateDTO lifecycleState = getLifecycleStateInstance(initialstate, initialstate);
|
|
|
|
this.lifecycleStateDAO
|
|
|
|
|
|
|
|
.addLifecycleState(lifecycleState, applicationId, applicationReleaseDTO.getUuid(), tenantId);
|
|
|
|
|
|
|
|
applicationReleaseDTO = this.applicationReleaseDAO
|
|
|
|
applicationReleaseDTO = this.applicationReleaseDAO
|
|
|
|
.createRelease(applicationReleaseDTO, applicationDTO.getId(), tenantId);
|
|
|
|
.createRelease(applicationReleaseDTO, applicationDTO.getId(), tenantId);
|
|
|
|
|
|
|
|
this.lifecycleStateDAO
|
|
|
|
|
|
|
|
.addLifecycleState(lifecycleState, applicationId, applicationReleaseDTO.getUuid(), tenantId);
|
|
|
|
applicationRelease = releaseDtoToRelease(applicationReleaseDTO);
|
|
|
|
applicationRelease = releaseDtoToRelease(applicationReleaseDTO);
|
|
|
|
ConnectionManagerUtil.commitDBTransaction();
|
|
|
|
ConnectionManagerUtil.commitDBTransaction();
|
|
|
|
return applicationRelease;
|
|
|
|
return applicationRelease;
|
|
|
@ -617,13 +726,48 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
ConnectionManagerUtil.rollbackDBTransaction();
|
|
|
|
ConnectionManagerUtil.rollbackDBTransaction();
|
|
|
|
throw new ApplicationManagementException(
|
|
|
|
throw new ApplicationManagementException(
|
|
|
|
"Error occurred while adding new application release for application " + applicationId, e);
|
|
|
|
"Error occurred while adding new application release for application " + applicationId, e);
|
|
|
|
|
|
|
|
} finally {
|
|
|
|
|
|
|
|
ConnectionManagerUtil.closeDBConnection();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private ApplicationDTO getApplication(int applicationId) throws ApplicationManagementException {
|
|
|
|
|
|
|
|
int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(true);
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
ConnectionManagerUtil.openDBConnection();
|
|
|
|
|
|
|
|
ApplicationDTO applicationDTO = this.applicationDAO.getApplicationById(applicationId, tenantId);
|
|
|
|
|
|
|
|
if (applicationDTO == null) {
|
|
|
|
|
|
|
|
String msg = "Couldn't find application for the application Id: " + applicationId;
|
|
|
|
|
|
|
|
log.error(msg);
|
|
|
|
|
|
|
|
throw new NotFoundException(msg);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return applicationDTO;
|
|
|
|
|
|
|
|
} catch (DBConnectionException e) {
|
|
|
|
|
|
|
|
throw new ApplicationManagementException(
|
|
|
|
|
|
|
|
"Error occurred while obtaining the database connection for getting application for the application ID: "
|
|
|
|
|
|
|
|
+ applicationId, e);
|
|
|
|
|
|
|
|
} catch (ApplicationManagementDAOException e) {
|
|
|
|
|
|
|
|
throw new ApplicationManagementException(
|
|
|
|
|
|
|
|
"Error occurred while getting application data for application ID: " + applicationId, e);
|
|
|
|
|
|
|
|
} finally {
|
|
|
|
|
|
|
|
ConnectionManagerUtil.closeDBConnection();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private ApplicationReleaseDTO uploadReleaseArtifacts(ApplicationReleaseWrapper applicationReleaseWrapper,
|
|
|
|
|
|
|
|
ApplicationDTO applicationDTO, ApplicationArtifact applicationArtifact)
|
|
|
|
|
|
|
|
throws ApplicationManagementException {
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
DeviceType deviceType = getDeviceTypeData(applicationDTO.getDeviceTypeId());
|
|
|
|
|
|
|
|
ApplicationReleaseDTO applicationReleaseDTO = addApplicationReleaseArtifacts(applicationDTO.getType(),
|
|
|
|
|
|
|
|
deviceType.getName(), releaseWrapperToReleaseDTO(applicationReleaseWrapper), applicationArtifact,
|
|
|
|
|
|
|
|
true);
|
|
|
|
|
|
|
|
return addImageArtifacts(applicationReleaseDTO, applicationArtifact);
|
|
|
|
} catch (ResourceManagementException e) {
|
|
|
|
} catch (ResourceManagementException e) {
|
|
|
|
ConnectionManagerUtil.rollbackDBTransaction();
|
|
|
|
|
|
|
|
String msg =
|
|
|
|
String msg =
|
|
|
|
"Error occurred while uploading application release artifacts. Application ID: " + applicationId;
|
|
|
|
"Error occurred while uploading application release artifacts. Application ID: " + applicationDTO
|
|
|
|
|
|
|
|
.getId();
|
|
|
|
throw new ApplicationManagementException(msg, e);
|
|
|
|
throw new ApplicationManagementException(msg, e);
|
|
|
|
} finally {
|
|
|
|
|
|
|
|
ConnectionManagerUtil.closeDBConnection();
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -634,14 +778,9 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
ApplicationDTO applicationDTO;
|
|
|
|
ApplicationDTO applicationDTO;
|
|
|
|
boolean isVisibleApp = false;
|
|
|
|
boolean isVisibleApp = false;
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
ConnectionManagerUtil.openDBConnection();
|
|
|
|
applicationDTO = getApplication(appId);
|
|
|
|
applicationDTO = this.applicationDAO.getApplicationById(appId, tenantId);
|
|
|
|
|
|
|
|
if (applicationDTO == null) {
|
|
|
|
|
|
|
|
String msg = "Couldn't find an application for application Id: " + appId;
|
|
|
|
|
|
|
|
log.error(msg);
|
|
|
|
|
|
|
|
throw new NotFoundException(msg);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ConnectionManagerUtil.openDBConnection();
|
|
|
|
List<ApplicationReleaseDTO> filteredApplicationReleaseDTOs = new ArrayList<>();
|
|
|
|
List<ApplicationReleaseDTO> filteredApplicationReleaseDTOs = new ArrayList<>();
|
|
|
|
for (ApplicationReleaseDTO applicationReleaseDTO : applicationDTO.getApplicationReleaseDTOs()) {
|
|
|
|
for (ApplicationReleaseDTO applicationReleaseDTO : applicationDTO.getApplicationReleaseDTOs()) {
|
|
|
|
if (!applicationReleaseDTO.getCurrentState().equals(lifecycleStateManager.getEndState()) && (
|
|
|
|
if (!applicationReleaseDTO.getCurrentState().equals(lifecycleStateManager.getEndState()) && (
|
|
|
@ -1149,12 +1288,9 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
//todo with this implementation user has to provide all image artifacts in order to update one image artifact as
|
|
|
|
|
|
|
|
// well. Therefore enhance this later.
|
|
|
|
|
|
|
|
public void updateApplicationImageArtifact(String uuid, ApplicationArtifact applicationArtifact)
|
|
|
|
public void updateApplicationImageArtifact(String uuid, ApplicationArtifact applicationArtifact)
|
|
|
|
throws ApplicationManagementException {
|
|
|
|
throws ApplicationManagementException {
|
|
|
|
int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(true);
|
|
|
|
int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(true);
|
|
|
|
ApplicationStorageManager applicationStorageManager = Util.getApplicationStorageManager();
|
|
|
|
|
|
|
|
ApplicationReleaseDTO applicationReleaseDTO;
|
|
|
|
ApplicationReleaseDTO applicationReleaseDTO;
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
|
|
|
|
|
|
|
@ -1174,8 +1310,6 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
+ " and it is not an release updatable state. Hence please move the application release"
|
|
|
|
+ " and it is not an release updatable state. Hence please move the application release"
|
|
|
|
+ " into updatable state and retry the operation.");
|
|
|
|
+ " into updatable state and retry the operation.");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
applicationStorageManager.deleteImageArtifacts(applicationReleaseDTO);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
applicationReleaseDTO = this.applicationReleaseDAO
|
|
|
|
applicationReleaseDTO = this.applicationReleaseDAO
|
|
|
|
.updateRelease(addImageArtifacts(applicationReleaseDTO, applicationArtifact), tenantId);
|
|
|
|
.updateRelease(addImageArtifacts(applicationReleaseDTO, applicationArtifact), tenantId);
|
|
|
|
if (applicationReleaseDTO == null) {
|
|
|
|
if (applicationReleaseDTO == null) {
|
|
|
@ -1212,7 +1346,6 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
public void updateApplicationArtifact(String deviceType, String appType, String uuid,
|
|
|
|
public void updateApplicationArtifact(String deviceType, String appType, String uuid,
|
|
|
|
ApplicationArtifact applicationArtifact) throws ApplicationManagementException {
|
|
|
|
ApplicationArtifact applicationArtifact) throws ApplicationManagementException {
|
|
|
|
int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(true);
|
|
|
|
int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(true);
|
|
|
|
ApplicationStorageManager applicationStorageManager = Util.getApplicationStorageManager();
|
|
|
|
|
|
|
|
boolean isValidDeviceType = false;
|
|
|
|
boolean isValidDeviceType = false;
|
|
|
|
List<DeviceType> deviceTypes;
|
|
|
|
List<DeviceType> deviceTypes;
|
|
|
|
try {
|
|
|
|
try {
|
|
|
@ -1245,10 +1378,8 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
throw new NotFoundException(msg);
|
|
|
|
throw new NotFoundException(msg);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
String deletingAppHashValue = applicationReleaseDTO.getAppHashValue();
|
|
|
|
applicationReleaseDTO = updateApplicationReleaseArtifacts(appType, deviceType, applicationReleaseDTO,
|
|
|
|
applicationReleaseDTO = addApplicationReleaseArtifacts(appType, deviceType, applicationReleaseDTO,
|
|
|
|
|
|
|
|
applicationArtifact);
|
|
|
|
applicationArtifact);
|
|
|
|
applicationStorageManager.copyImageArtifactsAndDeleteInstaller(deletingAppHashValue, applicationReleaseDTO);
|
|
|
|
|
|
|
|
applicationReleaseDTO = this.applicationReleaseDAO.updateRelease(applicationReleaseDTO, tenantId);
|
|
|
|
applicationReleaseDTO = this.applicationReleaseDAO.updateRelease(applicationReleaseDTO, tenantId);
|
|
|
|
if (applicationReleaseDTO == null) {
|
|
|
|
if (applicationReleaseDTO == null) {
|
|
|
|
ConnectionManagerUtil.rollbackDBTransaction();
|
|
|
|
ConnectionManagerUtil.rollbackDBTransaction();
|
|
|
@ -1579,6 +1710,7 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
log.error(msg);
|
|
|
|
log.error(msg);
|
|
|
|
throw new ApplicationManagementException(msg);
|
|
|
|
throw new ApplicationManagementException(msg);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ConnectionManagerUtil.commitDBTransaction();
|
|
|
|
} catch (UserStoreException e) {
|
|
|
|
} catch (UserStoreException e) {
|
|
|
|
ConnectionManagerUtil.rollbackDBTransaction();
|
|
|
|
ConnectionManagerUtil.rollbackDBTransaction();
|
|
|
|
throw new ApplicationManagementException(
|
|
|
|
throw new ApplicationManagementException(
|
|
|
@ -1682,132 +1814,91 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
return lifecycleState;
|
|
|
|
return lifecycleState;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//todo check whether package names are same
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public boolean updateRelease(int applicationId, String releaseUuid, String deviceType,
|
|
|
|
public boolean updateRelease(String deviceType, String applicationType, String releaseUuid,
|
|
|
|
ApplicationReleaseDTO updateRelease, InputStream binaryFileStram, InputStream iconFileStream,
|
|
|
|
ApplicationReleaseWrapper applicationReleaseWrapper, ApplicationArtifact applicationArtifact)
|
|
|
|
InputStream bannerFileStream, List<InputStream> attachments) throws ApplicationManagementException {
|
|
|
|
throws ApplicationManagementException {
|
|
|
|
|
|
|
|
|
|
|
|
int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(true);
|
|
|
|
int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(true);
|
|
|
|
String userName = PrivilegedCarbonContext.getThreadLocalCarbonContext().getUsername();
|
|
|
|
|
|
|
|
ApplicationReleaseDTO release;
|
|
|
|
|
|
|
|
ApplicationDTO app = null;
|
|
|
|
|
|
|
|
ApplicationStorageManager applicationStorageManager = Util.getApplicationStorageManager();
|
|
|
|
|
|
|
|
DeviceType deviceTypeObj;
|
|
|
|
|
|
|
|
boolean isAdminUser;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
// Getting the device type details to get device type ID for internal mappings
|
|
|
|
|
|
|
|
deviceTypeObj = Util.getDeviceManagementService().getDeviceType(deviceType);
|
|
|
|
|
|
|
|
isAdminUser = isAdminUser(userName, tenantId, CarbonConstants.UI_ADMIN_PERMISSION_COLLECTION);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ConnectionManagerUtil.beginDBTransaction();
|
|
|
|
ConnectionManagerUtil.beginDBTransaction();
|
|
|
|
app = this.applicationDAO.getApplicationById(applicationId, tenantId);
|
|
|
|
ApplicationReleaseDTO applicationReleaseDTO = this.applicationReleaseDAO
|
|
|
|
release = this.applicationReleaseDAO.getReleaseByIds(applicationId, releaseUuid, tenantId);
|
|
|
|
.getReleaseByUUID(releaseUuid, tenantId);
|
|
|
|
|
|
|
|
|
|
|
|
if (app == null) {
|
|
|
|
if (applicationReleaseDTO == null) {
|
|
|
|
ConnectionManagerUtil.rollbackDBTransaction();
|
|
|
|
String msg = "Couldn't found an application release for updating. Application release UUID: " + releaseUuid;
|
|
|
|
throw new NotFoundException(
|
|
|
|
log.error(msg);
|
|
|
|
"Couldn't found an application for updating. ApplicationDTO id: " + applicationId);
|
|
|
|
throw new NotFoundException(msg);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (deviceTypeObj == null || deviceTypeObj.getId() != app.getDeviceTypeId()) {
|
|
|
|
if (!lifecycleStateManager.isUpdatableState(applicationReleaseDTO.getCurrentState())) {
|
|
|
|
ConnectionManagerUtil.rollbackDBTransaction();
|
|
|
|
String msg = "Application release in " + applicationReleaseDTO.getCurrentState()
|
|
|
|
throw new BadRequestException(
|
|
|
|
+ " state. Therefore you are not allowed to update the application release. Hence, "
|
|
|
|
"Request to update application release for Invalid device type. Device type: " + deviceType
|
|
|
|
+ "please move application release from " + applicationReleaseDTO.getCurrentState()
|
|
|
|
+ " application ID " + applicationId + " ApplicationDTO Release UUID " + releaseUuid);
|
|
|
|
+ " to updatable state.";
|
|
|
|
}
|
|
|
|
log.error(msg);
|
|
|
|
if (release == null) {
|
|
|
|
throw new ForbiddenException(msg);
|
|
|
|
ConnectionManagerUtil.rollbackDBTransaction();
|
|
|
|
|
|
|
|
throw new NotFoundException(
|
|
|
|
|
|
|
|
"Couldn't found an application realise for updating. ApplicationDTO id: " + applicationId
|
|
|
|
|
|
|
|
+ " and application release UUID: " + releaseUuid);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
String releaseType = updateRelease.getReleaseType();
|
|
|
|
DeviceType deviceTypeObj = getDeviceTypeData(deviceType);
|
|
|
|
Double price = updateRelease.getPrice();
|
|
|
|
Double price = applicationReleaseWrapper.getPrice();
|
|
|
|
String metaData = updateRelease.getMetaData();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (price < 0.0 || (price == 0.0 && ApplicationSubscriptionType.PAID.toString().equals(app.getSubType()))
|
|
|
|
String applicationSubType = this.applicationDAO.getApplicationSubTypeByUUID(releaseUuid, tenantId);
|
|
|
|
|| (price > 0.0 && ApplicationSubscriptionType.FREE.toString().equals(app.getSubType()))) {
|
|
|
|
if (applicationSubType == null) {
|
|
|
|
ConnectionManagerUtil.rollbackDBTransaction();
|
|
|
|
String msg = "Couldn't find an application subscription type for the application release UUID: " + releaseUuid;
|
|
|
|
|
|
|
|
log.error(msg);
|
|
|
|
|
|
|
|
throw new ApplicationManagementException(msg);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (price < 0.0 || (price == 0.0 && ApplicationSubscriptionType.PAID.toString().equals(applicationSubType))
|
|
|
|
|
|
|
|
|| (price > 0.0 && ApplicationSubscriptionType.FREE.toString().equals(applicationSubType))) {
|
|
|
|
throw new BadRequestException(
|
|
|
|
throw new BadRequestException(
|
|
|
|
"Invalid app release payload for updating application release. ApplicationDTO price is " + price
|
|
|
|
"Invalid app release payload for updating application release. ApplicationDTO price is " + price
|
|
|
|
+ " for " + app.getSubType() + " application. ApplicationDTO ID: " + applicationId
|
|
|
|
+ " for " + applicationSubType + " application., Application Release UUID "
|
|
|
|
+ ", ApplicationDTO Release UUID " + releaseUuid + " and supported device type is "
|
|
|
|
+ releaseUuid + " and supported device type is " + deviceType);
|
|
|
|
+ deviceType);
|
|
|
|
}
|
|
|
|
|
|
|
|
applicationReleaseDTO.setPrice(price);
|
|
|
|
|
|
|
|
applicationReleaseDTO.setIsSharedWithAllTenants(applicationReleaseDTO.getIsSharedWithAllTenants());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String supportedOSVersions = applicationReleaseWrapper.getSupportedOsVersions();
|
|
|
|
|
|
|
|
if (!StringUtils.isEmpty(supportedOSVersions)) {
|
|
|
|
|
|
|
|
//todo check OS versions are supported or not
|
|
|
|
|
|
|
|
applicationReleaseDTO.setSupportedOsVersions(supportedOSVersions);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
release.setPrice(price);
|
|
|
|
if (!StringUtils.isEmpty(applicationReleaseWrapper.getDescription())) {
|
|
|
|
if (releaseType != null) {
|
|
|
|
applicationReleaseDTO.setDescription(applicationReleaseWrapper.getDescription());
|
|
|
|
release.setReleaseType(releaseType);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (metaData != null) {
|
|
|
|
if (!StringUtils.isEmpty(applicationReleaseWrapper.getReleaseType())) {
|
|
|
|
release.setMetaData(metaData);
|
|
|
|
applicationReleaseDTO.setReleaseType(applicationReleaseWrapper.getReleaseType());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!StringUtils.isEmpty(applicationReleaseWrapper.getMetaData())) {
|
|
|
|
List<String> unrestrictedRoles = app.getUnrestrictedRoles();
|
|
|
|
applicationReleaseDTO.setMetaData(applicationReleaseWrapper.getMetaData());
|
|
|
|
|
|
|
|
|
|
|
|
String applicationReleaseCreatedUser = lifecycleStateDAO
|
|
|
|
|
|
|
|
.getAppReleaseCreatedUsername(applicationId, releaseUuid, tenantId);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!isAdminUser && !(!unrestrictedRoles.isEmpty() && hasUserRole(unrestrictedRoles, userName))
|
|
|
|
|
|
|
|
&& !userName.equals(applicationReleaseCreatedUser)) {
|
|
|
|
|
|
|
|
ConnectionManagerUtil.rollbackDBTransaction();
|
|
|
|
|
|
|
|
throw new ForbiddenException("You are not authorized user to update application");
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//todo try to remove this DB call and get it when getting application release
|
|
|
|
applicationReleaseDTO = updateApplicationReleaseArtifacts(applicationType, deviceTypeObj.getName(),
|
|
|
|
LifecycleStateDTO lifecycleState = this.lifecycleStateDAO.getLatestLifeCycleState(applicationId, releaseUuid);
|
|
|
|
applicationReleaseDTO, applicationArtifact);
|
|
|
|
if (!AppLifecycleState.CREATED.toString().equals(lifecycleState.getCurrentState())
|
|
|
|
applicationReleaseDTO = updateImageArtifacts(applicationReleaseDTO, applicationArtifact);
|
|
|
|
&& !AppLifecycleState.IN_REVIEW.toString().equals(lifecycleState.getCurrentState())
|
|
|
|
|
|
|
|
&& !AppLifecycleState.REJECTED.toString().equals(lifecycleState.getCurrentState())) {
|
|
|
|
|
|
|
|
ConnectionManagerUtil.rollbackDBTransaction();
|
|
|
|
|
|
|
|
throw new ForbiddenException(
|
|
|
|
|
|
|
|
"You can't update application release which is in " + lifecycleState.getCurrentState()
|
|
|
|
|
|
|
|
+ " State");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// release = applicationStorageManager
|
|
|
|
boolean updateStatus = applicationReleaseDAO.updateRelease(applicationReleaseDTO, tenantId) != null;
|
|
|
|
// .deleteImageArtifacts(release, iconFileStream, bannerFileStream, attachments);
|
|
|
|
if (!updateStatus) {
|
|
|
|
// release = applicationStorageManager
|
|
|
|
|
|
|
|
// .copyImageArtifactsAndDeleteInstaller(release, app.getType(), deviceType, binaryFileStram);
|
|
|
|
|
|
|
|
return applicationReleaseDAO.updateRelease(release, tenantId) != null;
|
|
|
|
|
|
|
|
} catch (DeviceManagementException e) {
|
|
|
|
|
|
|
|
throw new ApplicationManagementException("Error occured when validating the device type " + deviceType, e);
|
|
|
|
|
|
|
|
} catch (UserStoreException e) {
|
|
|
|
|
|
|
|
throw new ApplicationManagementException(
|
|
|
|
|
|
|
|
"Error occured while verifying whether user is admin user or not. Username " + userName
|
|
|
|
|
|
|
|
+ " tenant id " + tenantId, e);
|
|
|
|
|
|
|
|
} catch (LifeCycleManagementDAOException e) {
|
|
|
|
|
|
|
|
ConnectionManagerUtil.rollbackDBTransaction();
|
|
|
|
ConnectionManagerUtil.rollbackDBTransaction();
|
|
|
|
throw new ApplicationManagementException(
|
|
|
|
}
|
|
|
|
"Error Occured when getting lifecycle state of the application release of application UUID: "
|
|
|
|
ConnectionManagerUtil.commitDBTransaction();
|
|
|
|
+ releaseUuid, e);
|
|
|
|
return updateStatus;
|
|
|
|
} catch (ApplicationManagementDAOException e) {
|
|
|
|
} catch (ApplicationManagementDAOException e) {
|
|
|
|
ConnectionManagerUtil.rollbackDBTransaction();
|
|
|
|
ConnectionManagerUtil.rollbackDBTransaction();
|
|
|
|
throw new ApplicationManagementException(
|
|
|
|
String msg = "Error occured when updating Application release. ApplicationDTO ID ApplicationDTO Release "
|
|
|
|
"Error occured when updating ApplicationDTO release. ApplicationDTO ID " + applicationId
|
|
|
|
+ "UUID: " + releaseUuid;
|
|
|
|
+ " ApplicationDTO Release UUID: " + releaseUuid, e);
|
|
|
|
log.error(msg);
|
|
|
|
}
|
|
|
|
throw new ApplicationManagementException(msg, e);
|
|
|
|
// catch (ApplicationStorageManagementException e) {
|
|
|
|
} catch (ResourceManagementException e) {
|
|
|
|
// ConnectionManagerUtil.rollbackDBTransaction();
|
|
|
|
String msg = "Error occured when updating application release artifact in the file system. Application "
|
|
|
|
// throw new ApplicationManagementException(
|
|
|
|
+ "release UUID:" + releaseUuid;
|
|
|
|
// "Error occured when updating application release artifact. ApplicationDTO ID " + applicationId
|
|
|
|
log.error(msg);
|
|
|
|
// + " ApplicationDTO release UUID: " + releaseUuid, e);
|
|
|
|
throw new ApplicationManagementException(msg, e);
|
|
|
|
// }
|
|
|
|
} finally {
|
|
|
|
// catch (ResourceManagementException e) {
|
|
|
|
ConnectionManagerUtil.closeDBConnection();
|
|
|
|
// // updating images
|
|
|
|
}
|
|
|
|
// ConnectionManagerUtil.rollbackDBTransaction();
|
|
|
|
|
|
|
|
// throw new ApplicationManagementException(
|
|
|
|
|
|
|
|
// "Error occured when updating image artifact of the application release. ApplicationDTO ID: "
|
|
|
|
|
|
|
|
// + applicationId + " ApplicationDTO release UUID: " + releaseUuid, e);
|
|
|
|
|
|
|
|
// } catch (RequestValidatingException e) {
|
|
|
|
|
|
|
|
// ConnectionManagerUtil.rollbackDBTransaction();
|
|
|
|
|
|
|
|
// throw new ApplicationManagementException(
|
|
|
|
|
|
|
|
// "Error occured when validating application release artifact for device type " + deviceType
|
|
|
|
|
|
|
|
// + " And application type " + app.getType() + ". Applicationn ID: " + applicationId
|
|
|
|
|
|
|
|
// + " ApplicationDTO release UUID: " + releaseUuid);
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -1985,6 +2076,7 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
String basePath = artifactDownloadEndpoint + Constants.FORWARD_SLASH + applicationReleaseDTO.getUuid();
|
|
|
|
String basePath = artifactDownloadEndpoint + Constants.FORWARD_SLASH + applicationReleaseDTO.getUuid();
|
|
|
|
ApplicationRelease applicationRelease = new ApplicationRelease();
|
|
|
|
ApplicationRelease applicationRelease = new ApplicationRelease();
|
|
|
|
applicationRelease.setDescription(applicationReleaseDTO.getDescription());
|
|
|
|
applicationRelease.setDescription(applicationReleaseDTO.getDescription());
|
|
|
|
|
|
|
|
applicationRelease.setVersion(applicationReleaseDTO.getVersion());
|
|
|
|
applicationRelease.setUuid(applicationReleaseDTO.getUuid());
|
|
|
|
applicationRelease.setUuid(applicationReleaseDTO.getUuid());
|
|
|
|
applicationRelease.setReleaseType(applicationReleaseDTO.getReleaseType());
|
|
|
|
applicationRelease.setReleaseType(applicationReleaseDTO.getReleaseType());
|
|
|
|
applicationRelease.setPrice(applicationReleaseDTO.getPrice());
|
|
|
|
applicationRelease.setPrice(applicationReleaseDTO.getPrice());
|
|
|
|