|
|
|
@ -497,7 +497,7 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
|
.getReleaseByPackages(Collections.singletonList(packageName), tenantId);
|
|
|
|
|
if (!exitingPubAppReleases.isEmpty()){
|
|
|
|
|
String msg = "Public app release exists for package name " + packageName
|
|
|
|
|
+ ". Hence you can't add new public app for package name "
|
|
|
|
|
+ ". Hence you cannot add new public app for package name "
|
|
|
|
|
+ packageName;
|
|
|
|
|
log.error(msg);
|
|
|
|
|
throw new BadRequestException(msg);
|
|
|
|
@ -669,7 +669,7 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
|
String extension = windowsInstallerName.substring(windowsInstallerName.lastIndexOf(".") + 1);
|
|
|
|
|
if (!extension.equalsIgnoreCase(Constants.MSI) &&
|
|
|
|
|
!extension.equalsIgnoreCase(Constants.APPX)) {
|
|
|
|
|
String msg = "Application Type doesn't match with supporting application types of " +
|
|
|
|
|
String msg = "Application Type does not match with supporting application types of " +
|
|
|
|
|
deviceType + "platform which are APPX and MSI";
|
|
|
|
|
log.error(msg);
|
|
|
|
|
throw new BadRequestException(msg);
|
|
|
|
@ -771,7 +771,7 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
|
try {
|
|
|
|
|
ConnectionManagerUtil.getDBConnection();
|
|
|
|
|
if (this.applicationReleaseDAO.verifyReleaseExistenceByHash(md5OfApp, tenantId)) {
|
|
|
|
|
String msg = "Same binary file is in the server. Hence you can't add same file into the "
|
|
|
|
|
String msg = "Same binary file is in the server. Hence you cannot add same file into the "
|
|
|
|
|
+ "server. Device Type: " + deviceType + " and package name: " + packageName;
|
|
|
|
|
log.error(msg);
|
|
|
|
|
throw new BadRequestException(msg);
|
|
|
|
@ -1175,7 +1175,7 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
|
if (!hasUserRole(filteringUnrestrictedRoles, userName)) {
|
|
|
|
|
String msg =
|
|
|
|
|
"At least one filtering role is not assigned for the user: " + userName + ". Hence user " + userName
|
|
|
|
|
+ " Can't filter applications by giving these unrestricted role list";
|
|
|
|
|
+ " Cannot filter applications by giving these unrestricted role list";
|
|
|
|
|
log.error(msg);
|
|
|
|
|
throw new BadRequestException(msg);
|
|
|
|
|
}
|
|
|
|
@ -1382,7 +1382,7 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
|
ConnectionManagerUtil.openDBConnection();
|
|
|
|
|
ApplicationDTO applicationDTO = this.applicationDAO.getApplication(applicationId, tenantId);
|
|
|
|
|
if (applicationDTO == null) {
|
|
|
|
|
String msg = "Couldn't find application for the application Id: " + applicationId;
|
|
|
|
|
String msg = "Could not find application for the application Id: " + applicationId;
|
|
|
|
|
log.error(msg);
|
|
|
|
|
throw new NotFoundException(msg);
|
|
|
|
|
}
|
|
|
|
@ -1494,7 +1494,7 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
|
log.error(msg, e);
|
|
|
|
|
throw new ApplicationManagementException(msg, e);
|
|
|
|
|
} catch (ApplicationManagementDAOException e) {
|
|
|
|
|
String msg = "Error occured when getting, either application tags or application categories";
|
|
|
|
|
String msg = "Error occurred when getting, either application tags or application categories";
|
|
|
|
|
log.error(msg, e);
|
|
|
|
|
throw new ApplicationManagementException(msg, e);
|
|
|
|
|
} finally {
|
|
|
|
@ -1768,7 +1768,7 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
|
throw new ApplicationManagementException(msg, e);
|
|
|
|
|
} catch (LifeCycleManagementDAOException e) {
|
|
|
|
|
ConnectionManagerUtil.rollbackDBTransaction();
|
|
|
|
|
String msg = "Error occured while deleting life-cycle state data of application releases of the application"
|
|
|
|
|
String msg = "Error occurred while deleting life-cycle state data of application releases of the application"
|
|
|
|
|
+ " which has application ID: " + applicationDTO.getId();
|
|
|
|
|
log.error(msg, e);
|
|
|
|
|
throw new ApplicationManagementException(msg, e);
|
|
|
|
@ -1885,7 +1885,7 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
|
throw new ApplicationManagementException(msg, e);
|
|
|
|
|
} catch (ApplicationManagementDAOException e) {
|
|
|
|
|
ConnectionManagerUtil.rollbackDBTransaction();
|
|
|
|
|
String msg = "Error occurred while verifying whether application relase has an subscription or "
|
|
|
|
|
String msg = "Error occurred while verifying whether application release has an subscription or "
|
|
|
|
|
+ "not. Application release UUID: " + releaseUuid;
|
|
|
|
|
log.error(msg, e);
|
|
|
|
|
throw new ApplicationManagementException(msg, e);
|
|
|
|
@ -1934,7 +1934,7 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
|
ConnectionManagerUtil.commitDBTransaction();
|
|
|
|
|
} catch (DBConnectionException e) {
|
|
|
|
|
String msg =
|
|
|
|
|
"Error occured when getting DB connection to update image artifacts of the application release "
|
|
|
|
|
"Error occurred when getting DB connection to update image artifacts of the application release "
|
|
|
|
|
+ "which has uuid " + uuid;
|
|
|
|
|
log.error(msg, e);
|
|
|
|
|
throw new ApplicationManagementException(msg, e);
|
|
|
|
@ -1946,13 +1946,13 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
|
} catch (ApplicationManagementDAOException e) {
|
|
|
|
|
ConnectionManagerUtil.rollbackDBTransaction();
|
|
|
|
|
String msg =
|
|
|
|
|
"Error occured while getting application release data for updating image artifacts of the application release uuid "
|
|
|
|
|
"Error occurred while getting application release data for updating image artifacts of the application release uuid "
|
|
|
|
|
+ uuid + ".";
|
|
|
|
|
log.error(msg, e);
|
|
|
|
|
throw new ApplicationManagementException(msg, e);
|
|
|
|
|
} catch (ResourceManagementException e) {
|
|
|
|
|
ConnectionManagerUtil.rollbackDBTransaction();
|
|
|
|
|
String msg = "Error occured while updating image artifacts of the application release uuid " + uuid + ".";
|
|
|
|
|
String msg = "Error occurred while updating image artifacts of the application release uuid " + uuid + ".";
|
|
|
|
|
log.error(msg, e);
|
|
|
|
|
throw new ApplicationManagementException(msg , e);
|
|
|
|
|
} finally {
|
|
|
|
@ -1981,7 +1981,7 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
|
throw new BadRequestException(msg);
|
|
|
|
|
}
|
|
|
|
|
} catch (DeviceManagementException e) {
|
|
|
|
|
String msg = "Error occured while getting supported device types in IoTS";
|
|
|
|
|
String msg = "Error occurred while getting supported device types in IoTS";
|
|
|
|
|
log.error(msg, e);
|
|
|
|
|
throw new ApplicationManagementException(msg, e);
|
|
|
|
|
}
|
|
|
|
@ -2023,16 +2023,16 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
|
ConnectionManagerUtil.commitDBTransaction();
|
|
|
|
|
} catch (ApplicationManagementDAOException e) {
|
|
|
|
|
ConnectionManagerUtil.rollbackDBTransaction();
|
|
|
|
|
String msg = "Error occured while getting/updating APPM DB for updating application Installer.";
|
|
|
|
|
String msg = "Error occurred while getting/updating APPM DB for updating application Installer.";
|
|
|
|
|
log.error(msg, e);
|
|
|
|
|
throw new ApplicationManagementException(msg, e);
|
|
|
|
|
} catch (TransactionManagementException e) {
|
|
|
|
|
String msg = "Error occured while starting the transaction to update application release artifact which has "
|
|
|
|
|
String msg = "Error occurred while starting the transaction to update application release artifact which has "
|
|
|
|
|
+ "application uuid " + releaseUuid + ".";
|
|
|
|
|
log.error(msg, e);
|
|
|
|
|
throw new ApplicationManagementException(msg, e);
|
|
|
|
|
} catch (DBConnectionException e) {
|
|
|
|
|
String msg = "Error occured when getting DB connection to update application release artifact of the "
|
|
|
|
|
String msg = "Error occurred when getting DB connection to update application release artifact of the "
|
|
|
|
|
+ "application release uuid " + releaseUuid + ".";
|
|
|
|
|
log.error(msg, e);
|
|
|
|
|
throw new ApplicationManagementException(msg, e);
|
|
|
|
@ -2043,7 +2043,7 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
|
throw new ApplicationManagementException(msg, e);
|
|
|
|
|
} catch (ResourceManagementException e) {
|
|
|
|
|
ConnectionManagerUtil.rollbackDBTransaction();
|
|
|
|
|
String msg = "Error occured when updating application installer.";
|
|
|
|
|
String msg = "Error occurred when updating application installer.";
|
|
|
|
|
log.error(msg, e);
|
|
|
|
|
throw new ApplicationManagementException(msg, e);
|
|
|
|
|
} finally {
|
|
|
|
@ -2241,7 +2241,7 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
|
throw new ApplicationManagementException(msg, e);
|
|
|
|
|
} catch (ApplicationManagementDAOException e) {
|
|
|
|
|
ConnectionManagerUtil.rollbackDBTransaction();
|
|
|
|
|
String msg = "Error occured when getting existing categories or when inserting new application categories.";
|
|
|
|
|
String msg = "Error occurred when getting existing categories or when inserting new application categories.";
|
|
|
|
|
log.error(msg, e);
|
|
|
|
|
throw new ApplicationManagementException(msg, e);
|
|
|
|
|
} finally {
|
|
|
|
@ -2259,7 +2259,7 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
|
if (!deviceTypeName.equals(Constants.ALL)) {
|
|
|
|
|
DeviceType deviceType = deviceManagementProviderService.getDeviceType(deviceTypeName);
|
|
|
|
|
if (deviceType == null) {
|
|
|
|
|
String msg = "Device type doesn't exist. Hence check the application name existence with valid "
|
|
|
|
|
String msg = "Device type does not exist. Hence check the application name existence with valid "
|
|
|
|
|
+ "device type name.";
|
|
|
|
|
log.error(msg);
|
|
|
|
|
throw new BadRequestException(msg);
|
|
|
|
@ -2310,7 +2310,7 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
|
.isExistingAppName(applicationUpdateWrapper.getName().trim(), applicationDTO.getDeviceTypeId(),
|
|
|
|
|
tenantId)) {
|
|
|
|
|
String msg = "Already an application registered with same name " + applicationUpdateWrapper.getName()
|
|
|
|
|
+ ". Hence you can't update the application name from " + applicationDTO.getName() + " to "
|
|
|
|
|
+ ". Hence you cannot update the application name from " + applicationDTO.getName() + " to "
|
|
|
|
|
+ applicationUpdateWrapper.getName();
|
|
|
|
|
log.error(msg);
|
|
|
|
|
throw new BadRequestException(msg);
|
|
|
|
@ -2563,7 +2563,7 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
|
applicationDAO.deleteApplicationTag(tag.getId(), applicationDTO.getId(), tenantId);
|
|
|
|
|
ConnectionManagerUtil.commitDBTransaction();
|
|
|
|
|
} else {
|
|
|
|
|
String msg = "Tag " + tagName + " is not an application tag. Application ID: " + appId;
|
|
|
|
|
String msg = "Tag " + tagName + " is not an application tag. Application name: " + applicationDTO.getName();
|
|
|
|
|
log.error(msg);
|
|
|
|
|
throw new BadRequestException(msg);
|
|
|
|
|
}
|
|
|
|
@ -2667,7 +2667,7 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
|
ConnectionManagerUtil.beginDBTransaction();
|
|
|
|
|
if (applicationDAO.getTagForTagName(newTagName, tenantId) != null){
|
|
|
|
|
String msg =
|
|
|
|
|
"You are trying to modify tag name into existing tag. Therefore you can't modify tag name from "
|
|
|
|
|
"You are trying to modify tag name into existing tag. Therefore you cannot modify tag name from "
|
|
|
|
|
+ oldTagName + " to new tag name " + newTagName;
|
|
|
|
|
log.error(msg);
|
|
|
|
|
throw new BadRequestException(msg);
|
|
|
|
@ -2771,7 +2771,7 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
} else {
|
|
|
|
|
String msg = "Tag list is either null or empty. In order to add new tags for application which has "
|
|
|
|
|
+ "application ID: " + appId +", tag list should be a list of Stings. Therefore please "
|
|
|
|
|
+ "application name: " + applicationDTO.getName() +", tag list should be a list of Stings. Therefore please "
|
|
|
|
|
+ "verify the payload.";
|
|
|
|
|
log.error(msg);
|
|
|
|
|
throw new BadRequestException(msg);
|
|
|
|
@ -2877,11 +2877,17 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
|
@Override
|
|
|
|
|
public void updateCategory(String oldCategoryName, String newCategoryName) throws ApplicationManagementException {
|
|
|
|
|
int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(true);
|
|
|
|
|
if (StringUtils.isEmpty(oldCategoryName) || StringUtils.isEmpty(newCategoryName)) {
|
|
|
|
|
String msg = "Either old category name or new category name contains empty/null value. Hence please verify the "
|
|
|
|
|
+ "request.";
|
|
|
|
|
log.error(msg);
|
|
|
|
|
throw new BadRequestException(msg);
|
|
|
|
|
}
|
|
|
|
|
try {
|
|
|
|
|
ConnectionManagerUtil.beginDBTransaction();
|
|
|
|
|
CategoryDTO category = applicationDAO.getCategoryForCategoryName(oldCategoryName, tenantId);
|
|
|
|
|
if (category == null){
|
|
|
|
|
String msg = "Couldn't found a category for tag name " + oldCategoryName + ".";
|
|
|
|
|
String msg = "Couldn't found a category for category name " + oldCategoryName + ".";
|
|
|
|
|
log.error(msg);
|
|
|
|
|
throw new NotFoundException(msg);
|
|
|
|
|
}
|
|
|
|
@ -2893,7 +2899,7 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
|
log.error(msg, e);
|
|
|
|
|
throw new ApplicationManagementException(msg, e);
|
|
|
|
|
} catch (TransactionManagementException e) {
|
|
|
|
|
String msg = "Database access error is occurred when updating categiry.";
|
|
|
|
|
String msg = "Database access error is occurred when updating category.";
|
|
|
|
|
log.error(msg, e);
|
|
|
|
|
throw new ApplicationManagementException(msg, e);
|
|
|
|
|
} catch (ApplicationManagementDAOException e) {
|
|
|
|
@ -2923,7 +2929,7 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
|
*/
|
|
|
|
|
private void validateFilter(Filter filter) throws BadRequestException {
|
|
|
|
|
if (filter == null) {
|
|
|
|
|
String msg = "Filter validation is failed, Filter shouldn't be null, hence please verify the request payload";
|
|
|
|
|
String msg = "Filter validation is failed, Filter should not be null, hence please verify the request payload";
|
|
|
|
|
log.error(msg);
|
|
|
|
|
throw new BadRequestException(msg);
|
|
|
|
|
}
|
|
|
|
@ -3068,11 +3074,11 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
|
throw new ApplicationManagementException(msg, e);
|
|
|
|
|
} catch (ApplicationManagementDAOException e) {
|
|
|
|
|
ConnectionManagerUtil.rollbackDBTransaction();
|
|
|
|
|
String msg = "Error occured when updating Ent Application release of UUID: " + releaseUuid;
|
|
|
|
|
String msg = "Error occurred when updating Ent Application release of UUID: " + releaseUuid;
|
|
|
|
|
log.error(msg, e);
|
|
|
|
|
throw new ApplicationManagementException(msg, e);
|
|
|
|
|
} catch (ResourceManagementException e) {
|
|
|
|
|
String msg = "Error occured when updating application release artifact in the file system. Ent App release "
|
|
|
|
|
String msg = "Error occurred when updating application release artifact in the file system. Ent App release "
|
|
|
|
|
+ "UUID:" + releaseUuid;
|
|
|
|
|
log.error(msg, e);
|
|
|
|
|
throw new ApplicationManagementException(msg, e);
|
|
|
|
@ -3137,11 +3143,11 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
|
throw new ApplicationManagementException(msg, e);
|
|
|
|
|
} catch (ApplicationManagementDAOException e) {
|
|
|
|
|
ConnectionManagerUtil.rollbackDBTransaction();
|
|
|
|
|
String msg = "Error occured when updating public app release of UUID: " + releaseUuid;
|
|
|
|
|
String msg = "Error occurred when updating public app release of UUID: " + releaseUuid;
|
|
|
|
|
log.error(msg, e);
|
|
|
|
|
throw new ApplicationManagementException(msg, e);
|
|
|
|
|
} catch (ResourceManagementException e) {
|
|
|
|
|
String msg = "Error occured when updating public app release artifact in the file system. Public app "
|
|
|
|
|
String msg = "Error occurred when updating public app release artifact in the file system. Public app "
|
|
|
|
|
+ "release UUID:" + releaseUuid;
|
|
|
|
|
log.error(msg, e);
|
|
|
|
|
throw new ApplicationManagementException(msg, e);
|
|
|
|
@ -3202,11 +3208,11 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
|
throw new ApplicationManagementException(msg, e);
|
|
|
|
|
} catch (ApplicationManagementDAOException e) {
|
|
|
|
|
ConnectionManagerUtil.rollbackDBTransaction();
|
|
|
|
|
String msg = "Error occured when updating web app release for web app Release UUID: " + releaseUuid;
|
|
|
|
|
String msg = "Error occurred when updating web app release for web app Release UUID: " + releaseUuid;
|
|
|
|
|
log.error(msg, e);
|
|
|
|
|
throw new ApplicationManagementException(msg, e);
|
|
|
|
|
} catch (ResourceManagementException e) {
|
|
|
|
|
String msg = "Error occured when updating web app release artifact in the file system. Web app "
|
|
|
|
|
String msg = "Error occurred when updating web app release artifact in the file system. Web app "
|
|
|
|
|
+ "release UUID:" + releaseUuid;
|
|
|
|
|
log.error(msg, e);
|
|
|
|
|
throw new ApplicationManagementException(msg, e);
|
|
|
|
@ -3266,7 +3272,7 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
|
ConnectionManagerUtil.getDBConnection();
|
|
|
|
|
if (this.applicationReleaseDAO.verifyReleaseExistenceByHash(md5OfApp, tenantId)) {
|
|
|
|
|
String msg =
|
|
|
|
|
"Same binary file is in the server. Hence you can't add same file into the "
|
|
|
|
|
"Same binary file is in the server. Hence you cannot add same file into the "
|
|
|
|
|
+ "server. Device Type: " + deviceTypeObj.getName()
|
|
|
|
|
+ " and package name: " + applicationDTO.getApplicationReleaseDTOs()
|
|
|
|
|
.get(0).getPackageName();
|
|
|
|
@ -3327,11 +3333,11 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
|
throw new ApplicationManagementException(msg, e);
|
|
|
|
|
} catch (ApplicationManagementDAOException e) {
|
|
|
|
|
ConnectionManagerUtil.rollbackDBTransaction();
|
|
|
|
|
String msg = "Error occured when updating Ent Application release of UUID: " + releaseUuid;
|
|
|
|
|
String msg = "Error occurred when updating Ent Application release of UUID: " + releaseUuid;
|
|
|
|
|
log.error(msg, e);
|
|
|
|
|
throw new ApplicationManagementException(msg, e);
|
|
|
|
|
} catch (ResourceManagementException e) {
|
|
|
|
|
String msg = "Error occured when updating application release artifact in the file system. Ent App release "
|
|
|
|
|
String msg = "Error occurred when updating application release artifact in the file system. Ent App release "
|
|
|
|
|
+ "UUID:" + releaseUuid;
|
|
|
|
|
log.error(msg, e);
|
|
|
|
|
throw new ApplicationManagementException(msg, e);
|
|
|
|
@ -3447,17 +3453,17 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
|
}
|
|
|
|
|
appCategories = applicationWrapper.getCategories();
|
|
|
|
|
if (appCategories == null) {
|
|
|
|
|
String msg = "Application category can't be null.";
|
|
|
|
|
String msg = "Application category cannot be null.";
|
|
|
|
|
log.error(msg);
|
|
|
|
|
throw new BadRequestException(msg);
|
|
|
|
|
}
|
|
|
|
|
if (appCategories.isEmpty()) {
|
|
|
|
|
String msg = "Application category can't be empty.";
|
|
|
|
|
String msg = "Application category cannot be empty.";
|
|
|
|
|
log.error(msg);
|
|
|
|
|
throw new BadRequestException(msg);
|
|
|
|
|
}
|
|
|
|
|
if (StringUtils.isEmpty(applicationWrapper.getDeviceType())) {
|
|
|
|
|
String msg = "Device type can't be empty for the application.";
|
|
|
|
|
String msg = "Device type cannot be empty for the application.";
|
|
|
|
|
log.error(msg);
|
|
|
|
|
throw new BadRequestException(msg);
|
|
|
|
|
}
|
|
|
|
@ -3479,12 +3485,12 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
|
}
|
|
|
|
|
appCategories = webAppWrapper.getCategories();
|
|
|
|
|
if (appCategories == null) {
|
|
|
|
|
String msg = "Web Clip category can't be null.";
|
|
|
|
|
String msg = "Web Clip category cannot be null.";
|
|
|
|
|
log.error(msg);
|
|
|
|
|
throw new BadRequestException(msg);
|
|
|
|
|
}
|
|
|
|
|
if (appCategories.isEmpty()) {
|
|
|
|
|
String msg = "Web clip category can't be empty.";
|
|
|
|
|
String msg = "Web clip category cannot be empty.";
|
|
|
|
|
log.error(msg);
|
|
|
|
|
throw new BadRequestException(msg);
|
|
|
|
|
}
|
|
|
|
@ -3512,17 +3518,17 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
|
}
|
|
|
|
|
appCategories = publicAppWrapper.getCategories();
|
|
|
|
|
if (appCategories == null) {
|
|
|
|
|
String msg = "Application category can't be null.";
|
|
|
|
|
String msg = "Application category cannot be null.";
|
|
|
|
|
log.error(msg);
|
|
|
|
|
throw new BadRequestException(msg);
|
|
|
|
|
}
|
|
|
|
|
if (appCategories.isEmpty()) {
|
|
|
|
|
String msg = "Application category can't be empty.";
|
|
|
|
|
String msg = "Application category cannot be empty.";
|
|
|
|
|
log.error(msg);
|
|
|
|
|
throw new BadRequestException(msg);
|
|
|
|
|
}
|
|
|
|
|
if (StringUtils.isEmpty(publicAppWrapper.getDeviceType())) {
|
|
|
|
|
String msg = "Device type can't be empty for the public application.";
|
|
|
|
|
String msg = "Device type cannot be empty for the public application.";
|
|
|
|
|
log.error(msg);
|
|
|
|
|
throw new BadRequestException(msg);
|
|
|
|
|
}
|
|
|
|
@ -3544,17 +3550,17 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
|
}
|
|
|
|
|
appCategories = customAppWrapper.getCategories();
|
|
|
|
|
if (appCategories == null) {
|
|
|
|
|
String msg = "Application category can't be null.";
|
|
|
|
|
String msg = "Application category cannot be null.";
|
|
|
|
|
log.error(msg);
|
|
|
|
|
throw new BadRequestException(msg);
|
|
|
|
|
}
|
|
|
|
|
if (appCategories.isEmpty()) {
|
|
|
|
|
String msg = "Application category can't be empty.";
|
|
|
|
|
String msg = "Application category cannot be empty.";
|
|
|
|
|
log.error(msg);
|
|
|
|
|
throw new BadRequestException(msg);
|
|
|
|
|
}
|
|
|
|
|
if (StringUtils.isEmpty(customAppWrapper.getDeviceType())) {
|
|
|
|
|
String msg = "Device type can't be empty for the application.";
|
|
|
|
|
String msg = "Device type cannot be empty for the application.";
|
|
|
|
|
log.error(msg);
|
|
|
|
|
throw new BadRequestException(msg);
|
|
|
|
|
}
|
|
|
|
@ -3646,7 +3652,7 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
|
@Override
|
|
|
|
|
public <T> void validateReleaseCreatingRequest(T param, String deviceType) throws ApplicationManagementException {
|
|
|
|
|
if (param == null) {
|
|
|
|
|
String msg = "In order to validate release creating request param shouldn't be null.";
|
|
|
|
|
String msg = "In order to validate release creating request param should not be null.";
|
|
|
|
|
log.error(msg);
|
|
|
|
|
throw new BadRequestException(msg);
|
|
|
|
|
}
|
|
|
|
@ -3655,7 +3661,7 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
|
AtomicReference<EntAppReleaseWrapper> entAppReleaseWrapper = new AtomicReference<>(
|
|
|
|
|
(EntAppReleaseWrapper) param);
|
|
|
|
|
if (StringUtils.isEmpty(entAppReleaseWrapper.get().getSupportedOsVersions())) {
|
|
|
|
|
String msg = "Supported OS Version shouldn't be null or empty.";
|
|
|
|
|
String msg = "Supported OS Version should not be null or empty.";
|
|
|
|
|
log.error(msg);
|
|
|
|
|
throw new BadRequestException(msg);
|
|
|
|
|
}
|
|
|
|
@ -3679,12 +3685,12 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
|
WebAppReleaseWrapper webAppReleaseWrapper = (WebAppReleaseWrapper) param;
|
|
|
|
|
UrlValidator urlValidator = new UrlValidator();
|
|
|
|
|
if (StringUtils.isEmpty(webAppReleaseWrapper.getVersion())) {
|
|
|
|
|
String msg = "Version shouldn't be empty or null for the WEB CLIP release creating request.";
|
|
|
|
|
String msg = "Version should not be empty or null for the WEB CLIP release creating request.";
|
|
|
|
|
log.error(msg);
|
|
|
|
|
throw new BadRequestException(msg);
|
|
|
|
|
}
|
|
|
|
|
if (StringUtils.isEmpty(webAppReleaseWrapper.getUrl())) {
|
|
|
|
|
String msg = "URL should't be null for the application release creating request for application type "
|
|
|
|
|
String msg = "URL should not be null for the application release creating request for application type "
|
|
|
|
|
+ "WEB_CLIP";
|
|
|
|
|
log.error(msg);
|
|
|
|
|
throw new BadRequestException(msg);
|
|
|
|
@ -3697,17 +3703,17 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
|
} else if (param instanceof PublicAppReleaseWrapper) {
|
|
|
|
|
PublicAppReleaseWrapper publicAppReleaseWrapper = (PublicAppReleaseWrapper) param;
|
|
|
|
|
if (StringUtils.isEmpty(publicAppReleaseWrapper.getSupportedOsVersions())) {
|
|
|
|
|
String msg = "Supported OS Version shouldn't be null or empty for public app release creating request.";
|
|
|
|
|
String msg = "Supported OS Version should not be null or empty for public app release creating request.";
|
|
|
|
|
log.error(msg);
|
|
|
|
|
throw new BadRequestException(msg);
|
|
|
|
|
}
|
|
|
|
|
if (StringUtils.isEmpty(publicAppReleaseWrapper.getVersion())) {
|
|
|
|
|
String msg = "Version shouldn't be empty or null for the Public App release creating request.";
|
|
|
|
|
String msg = "Version should not be empty or null for the Public App release creating request.";
|
|
|
|
|
log.error(msg);
|
|
|
|
|
throw new BadRequestException(msg);
|
|
|
|
|
}
|
|
|
|
|
if (StringUtils.isEmpty(publicAppReleaseWrapper.getPackageName())) {
|
|
|
|
|
String msg = "Package name shouldn't be empty or null for the Public App release creating request.";
|
|
|
|
|
String msg = "Package name should not be empty or null for the Public App release creating request.";
|
|
|
|
|
log.error(msg);
|
|
|
|
|
throw new BadRequestException(msg);
|
|
|
|
|
}
|
|
|
|
@ -3721,12 +3727,12 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
|
} else if (param instanceof CustomAppReleaseWrapper) {
|
|
|
|
|
CustomAppReleaseWrapper customAppReleaseWrapper = (CustomAppReleaseWrapper) param;
|
|
|
|
|
if (StringUtils.isEmpty(customAppReleaseWrapper.getVersion())) {
|
|
|
|
|
String msg = "Version shouldn't be empty or null for the custom App release creating request.";
|
|
|
|
|
String msg = "Version should not be empty or null for the custom App release creating request.";
|
|
|
|
|
log.error(msg);
|
|
|
|
|
throw new BadRequestException(msg);
|
|
|
|
|
}
|
|
|
|
|
if (StringUtils.isEmpty(customAppReleaseWrapper.getPackageName())) {
|
|
|
|
|
String msg = "Package name shouldn't be empty or null for the custom App release creating request.";
|
|
|
|
|
String msg = "Package name should not be empty or null for the custom App release creating request.";
|
|
|
|
|
log.error(msg);
|
|
|
|
|
throw new BadRequestException(msg);
|
|
|
|
|
}
|
|
|
|
@ -3864,11 +3870,11 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
|
}
|
|
|
|
|
ConnectionManagerUtil.commitDBTransaction();
|
|
|
|
|
} catch (ApplicationManagementDAOException e) {
|
|
|
|
|
String msg = "Error occured while updating app subscription status of the device.";
|
|
|
|
|
String msg = "Error occurred while updating app subscription status of the device.";
|
|
|
|
|
log.error(msg, e);
|
|
|
|
|
throw new ApplicationManagementException(msg, e);
|
|
|
|
|
} catch (DBConnectionException e) {
|
|
|
|
|
String msg = "Error occurred while obersving the database connection to update aoo subscription status of "
|
|
|
|
|
String msg = "Error occurred while observing the database connection to update aoo subscription status of "
|
|
|
|
|
+ "device.";
|
|
|
|
|
log.error(msg, e);
|
|
|
|
|
throw new ApplicationManagementException(msg, e);
|
|
|
|
@ -3895,11 +3901,11 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
|
}
|
|
|
|
|
ConnectionManagerUtil.commitDBTransaction();
|
|
|
|
|
} catch (ApplicationManagementDAOException e) {
|
|
|
|
|
String msg = "Error occured while updating app subscription status of the device.";
|
|
|
|
|
String msg = "Error occurred while updating app subscription status of the device.";
|
|
|
|
|
log.error(msg, e);
|
|
|
|
|
throw new ApplicationManagementException(msg, e);
|
|
|
|
|
} catch (DBConnectionException e) {
|
|
|
|
|
String msg = "Error occurred while obersving the database connection to update aoo subscription status of "
|
|
|
|
|
String msg = "Error occurred while observing the database connection to update aoo subscription status of "
|
|
|
|
|
+ "device.";
|
|
|
|
|
log.error(msg, e);
|
|
|
|
|
throw new ApplicationManagementException(msg, e);
|
|
|
|
|