|
|
@ -497,7 +497,7 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
.getReleaseByPackages(Collections.singletonList(packageName), tenantId);
|
|
|
|
.getReleaseByPackages(Collections.singletonList(packageName), tenantId);
|
|
|
|
if (!exitingPubAppReleases.isEmpty()){
|
|
|
|
if (!exitingPubAppReleases.isEmpty()){
|
|
|
|
String msg = "Public app release exists for package name " + packageName
|
|
|
|
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;
|
|
|
|
+ packageName;
|
|
|
|
log.error(msg);
|
|
|
|
log.error(msg);
|
|
|
|
throw new BadRequestException(msg);
|
|
|
|
throw new BadRequestException(msg);
|
|
|
@ -669,7 +669,7 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
String extension = windowsInstallerName.substring(windowsInstallerName.lastIndexOf(".") + 1);
|
|
|
|
String extension = windowsInstallerName.substring(windowsInstallerName.lastIndexOf(".") + 1);
|
|
|
|
if (!extension.equalsIgnoreCase(Constants.MSI) &&
|
|
|
|
if (!extension.equalsIgnoreCase(Constants.MSI) &&
|
|
|
|
!extension.equalsIgnoreCase(Constants.APPX)) {
|
|
|
|
!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";
|
|
|
|
deviceType + "platform which are APPX and MSI";
|
|
|
|
log.error(msg);
|
|
|
|
log.error(msg);
|
|
|
|
throw new BadRequestException(msg);
|
|
|
|
throw new BadRequestException(msg);
|
|
|
@ -771,7 +771,7 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
ConnectionManagerUtil.getDBConnection();
|
|
|
|
ConnectionManagerUtil.getDBConnection();
|
|
|
|
if (this.applicationReleaseDAO.verifyReleaseExistenceByHash(md5OfApp, tenantId)) {
|
|
|
|
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;
|
|
|
|
+ "server. Device Type: " + deviceType + " and package name: " + packageName;
|
|
|
|
log.error(msg);
|
|
|
|
log.error(msg);
|
|
|
|
throw new BadRequestException(msg);
|
|
|
|
throw new BadRequestException(msg);
|
|
|
@ -1175,7 +1175,7 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
if (!hasUserRole(filteringUnrestrictedRoles, userName)) {
|
|
|
|
if (!hasUserRole(filteringUnrestrictedRoles, userName)) {
|
|
|
|
String msg =
|
|
|
|
String msg =
|
|
|
|
"At least one filtering role is not assigned for the user: " + userName + ". Hence user " + userName
|
|
|
|
"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);
|
|
|
|
log.error(msg);
|
|
|
|
throw new BadRequestException(msg);
|
|
|
|
throw new BadRequestException(msg);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1382,7 +1382,7 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
ConnectionManagerUtil.openDBConnection();
|
|
|
|
ConnectionManagerUtil.openDBConnection();
|
|
|
|
ApplicationDTO applicationDTO = this.applicationDAO.getApplication(applicationId, tenantId);
|
|
|
|
ApplicationDTO applicationDTO = this.applicationDAO.getApplication(applicationId, tenantId);
|
|
|
|
if (applicationDTO == null) {
|
|
|
|
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);
|
|
|
|
log.error(msg);
|
|
|
|
throw new NotFoundException(msg);
|
|
|
|
throw new NotFoundException(msg);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -2259,7 +2259,7 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
if (!deviceTypeName.equals(Constants.ALL)) {
|
|
|
|
if (!deviceTypeName.equals(Constants.ALL)) {
|
|
|
|
DeviceType deviceType = deviceManagementProviderService.getDeviceType(deviceTypeName);
|
|
|
|
DeviceType deviceType = deviceManagementProviderService.getDeviceType(deviceTypeName);
|
|
|
|
if (deviceType == null) {
|
|
|
|
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.";
|
|
|
|
+ "device type name.";
|
|
|
|
log.error(msg);
|
|
|
|
log.error(msg);
|
|
|
|
throw new BadRequestException(msg);
|
|
|
|
throw new BadRequestException(msg);
|
|
|
@ -2310,7 +2310,7 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
.isExistingAppName(applicationUpdateWrapper.getName().trim(), applicationDTO.getDeviceTypeId(),
|
|
|
|
.isExistingAppName(applicationUpdateWrapper.getName().trim(), applicationDTO.getDeviceTypeId(),
|
|
|
|
tenantId)) {
|
|
|
|
tenantId)) {
|
|
|
|
String msg = "Already an application registered with same name " + applicationUpdateWrapper.getName()
|
|
|
|
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();
|
|
|
|
+ applicationUpdateWrapper.getName();
|
|
|
|
log.error(msg);
|
|
|
|
log.error(msg);
|
|
|
|
throw new BadRequestException(msg);
|
|
|
|
throw new BadRequestException(msg);
|
|
|
@ -2667,7 +2667,7 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
ConnectionManagerUtil.beginDBTransaction();
|
|
|
|
ConnectionManagerUtil.beginDBTransaction();
|
|
|
|
if (applicationDAO.getTagForTagName(newTagName, tenantId) != null){
|
|
|
|
if (applicationDAO.getTagForTagName(newTagName, tenantId) != null){
|
|
|
|
String msg =
|
|
|
|
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;
|
|
|
|
+ oldTagName + " to new tag name " + newTagName;
|
|
|
|
log.error(msg);
|
|
|
|
log.error(msg);
|
|
|
|
throw new BadRequestException(msg);
|
|
|
|
throw new BadRequestException(msg);
|
|
|
@ -2929,7 +2929,7 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
private void validateFilter(Filter filter) throws BadRequestException {
|
|
|
|
private void validateFilter(Filter filter) throws BadRequestException {
|
|
|
|
if (filter == null) {
|
|
|
|
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);
|
|
|
|
log.error(msg);
|
|
|
|
throw new BadRequestException(msg);
|
|
|
|
throw new BadRequestException(msg);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -3272,7 +3272,7 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
ConnectionManagerUtil.getDBConnection();
|
|
|
|
ConnectionManagerUtil.getDBConnection();
|
|
|
|
if (this.applicationReleaseDAO.verifyReleaseExistenceByHash(md5OfApp, tenantId)) {
|
|
|
|
if (this.applicationReleaseDAO.verifyReleaseExistenceByHash(md5OfApp, tenantId)) {
|
|
|
|
String msg =
|
|
|
|
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()
|
|
|
|
+ "server. Device Type: " + deviceTypeObj.getName()
|
|
|
|
+ " and package name: " + applicationDTO.getApplicationReleaseDTOs()
|
|
|
|
+ " and package name: " + applicationDTO.getApplicationReleaseDTOs()
|
|
|
|
.get(0).getPackageName();
|
|
|
|
.get(0).getPackageName();
|
|
|
@ -3459,17 +3459,17 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
appCategories = applicationWrapper.getCategories();
|
|
|
|
appCategories = applicationWrapper.getCategories();
|
|
|
|
if (appCategories == null) {
|
|
|
|
if (appCategories == null) {
|
|
|
|
String msg = "Application category can't be null.";
|
|
|
|
String msg = "Application category cannot be null.";
|
|
|
|
log.error(msg);
|
|
|
|
log.error(msg);
|
|
|
|
throw new BadRequestException(msg);
|
|
|
|
throw new BadRequestException(msg);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (appCategories.isEmpty()) {
|
|
|
|
if (appCategories.isEmpty()) {
|
|
|
|
String msg = "Application category can't be empty.";
|
|
|
|
String msg = "Application category cannot be empty.";
|
|
|
|
log.error(msg);
|
|
|
|
log.error(msg);
|
|
|
|
throw new BadRequestException(msg);
|
|
|
|
throw new BadRequestException(msg);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (StringUtils.isEmpty(applicationWrapper.getDeviceType())) {
|
|
|
|
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);
|
|
|
|
log.error(msg);
|
|
|
|
throw new BadRequestException(msg);
|
|
|
|
throw new BadRequestException(msg);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -3496,12 +3496,12 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
appCategories = webAppWrapper.getCategories();
|
|
|
|
appCategories = webAppWrapper.getCategories();
|
|
|
|
if (appCategories == null) {
|
|
|
|
if (appCategories == null) {
|
|
|
|
String msg = "Web Clip category can't be null.";
|
|
|
|
String msg = "Web Clip category cannot be null.";
|
|
|
|
log.error(msg);
|
|
|
|
log.error(msg);
|
|
|
|
throw new BadRequestException(msg);
|
|
|
|
throw new BadRequestException(msg);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (appCategories.isEmpty()) {
|
|
|
|
if (appCategories.isEmpty()) {
|
|
|
|
String msg = "Web clip category can't be empty.";
|
|
|
|
String msg = "Web clip category cannot be empty.";
|
|
|
|
log.error(msg);
|
|
|
|
log.error(msg);
|
|
|
|
throw new BadRequestException(msg);
|
|
|
|
throw new BadRequestException(msg);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -3534,17 +3534,17 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
appCategories = publicAppWrapper.getCategories();
|
|
|
|
appCategories = publicAppWrapper.getCategories();
|
|
|
|
if (appCategories == null) {
|
|
|
|
if (appCategories == null) {
|
|
|
|
String msg = "Application category can't be null.";
|
|
|
|
String msg = "Application category cannot be null.";
|
|
|
|
log.error(msg);
|
|
|
|
log.error(msg);
|
|
|
|
throw new BadRequestException(msg);
|
|
|
|
throw new BadRequestException(msg);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (appCategories.isEmpty()) {
|
|
|
|
if (appCategories.isEmpty()) {
|
|
|
|
String msg = "Application category can't be empty.";
|
|
|
|
String msg = "Application category cannot be empty.";
|
|
|
|
log.error(msg);
|
|
|
|
log.error(msg);
|
|
|
|
throw new BadRequestException(msg);
|
|
|
|
throw new BadRequestException(msg);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (StringUtils.isEmpty(publicAppWrapper.getDeviceType())) {
|
|
|
|
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);
|
|
|
|
log.error(msg);
|
|
|
|
throw new BadRequestException(msg);
|
|
|
|
throw new BadRequestException(msg);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -3571,17 +3571,17 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
appCategories = customAppWrapper.getCategories();
|
|
|
|
appCategories = customAppWrapper.getCategories();
|
|
|
|
if (appCategories == null) {
|
|
|
|
if (appCategories == null) {
|
|
|
|
String msg = "Application category can't be null.";
|
|
|
|
String msg = "Application category cannot be null.";
|
|
|
|
log.error(msg);
|
|
|
|
log.error(msg);
|
|
|
|
throw new BadRequestException(msg);
|
|
|
|
throw new BadRequestException(msg);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (appCategories.isEmpty()) {
|
|
|
|
if (appCategories.isEmpty()) {
|
|
|
|
String msg = "Application category can't be empty.";
|
|
|
|
String msg = "Application category cannot be empty.";
|
|
|
|
log.error(msg);
|
|
|
|
log.error(msg);
|
|
|
|
throw new BadRequestException(msg);
|
|
|
|
throw new BadRequestException(msg);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (StringUtils.isEmpty(customAppWrapper.getDeviceType())) {
|
|
|
|
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);
|
|
|
|
log.error(msg);
|
|
|
|
throw new BadRequestException(msg);
|
|
|
|
throw new BadRequestException(msg);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -3673,7 +3673,7 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public <T> void validateReleaseCreatingRequest(T param, String deviceType) throws ApplicationManagementException {
|
|
|
|
public <T> void validateReleaseCreatingRequest(T param, String deviceType) throws ApplicationManagementException {
|
|
|
|
if (param == null) {
|
|
|
|
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);
|
|
|
|
log.error(msg);
|
|
|
|
throw new BadRequestException(msg);
|
|
|
|
throw new BadRequestException(msg);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -3682,7 +3682,7 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
AtomicReference<EntAppReleaseWrapper> entAppReleaseWrapper = new AtomicReference<>(
|
|
|
|
AtomicReference<EntAppReleaseWrapper> entAppReleaseWrapper = new AtomicReference<>(
|
|
|
|
(EntAppReleaseWrapper) param);
|
|
|
|
(EntAppReleaseWrapper) param);
|
|
|
|
if (StringUtils.isEmpty(entAppReleaseWrapper.get().getSupportedOsVersions())) {
|
|
|
|
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);
|
|
|
|
log.error(msg);
|
|
|
|
throw new BadRequestException(msg);
|
|
|
|
throw new BadRequestException(msg);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -3706,12 +3706,12 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
WebAppReleaseWrapper webAppReleaseWrapper = (WebAppReleaseWrapper) param;
|
|
|
|
WebAppReleaseWrapper webAppReleaseWrapper = (WebAppReleaseWrapper) param;
|
|
|
|
UrlValidator urlValidator = new UrlValidator();
|
|
|
|
UrlValidator urlValidator = new UrlValidator();
|
|
|
|
if (StringUtils.isEmpty(webAppReleaseWrapper.getVersion())) {
|
|
|
|
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);
|
|
|
|
log.error(msg);
|
|
|
|
throw new BadRequestException(msg);
|
|
|
|
throw new BadRequestException(msg);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (StringUtils.isEmpty(webAppReleaseWrapper.getUrl())) {
|
|
|
|
if (StringUtils.isEmpty(webAppReleaseWrapper.getUrl())) {
|
|
|
|
String msg = "URL shouldn'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";
|
|
|
|
+ "WEB_CLIP";
|
|
|
|
log.error(msg);
|
|
|
|
log.error(msg);
|
|
|
|
throw new BadRequestException(msg);
|
|
|
|
throw new BadRequestException(msg);
|
|
|
@ -3724,17 +3724,17 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
} else if (param instanceof PublicAppReleaseWrapper) {
|
|
|
|
} else if (param instanceof PublicAppReleaseWrapper) {
|
|
|
|
PublicAppReleaseWrapper publicAppReleaseWrapper = (PublicAppReleaseWrapper) param;
|
|
|
|
PublicAppReleaseWrapper publicAppReleaseWrapper = (PublicAppReleaseWrapper) param;
|
|
|
|
if (StringUtils.isEmpty(publicAppReleaseWrapper.getSupportedOsVersions())) {
|
|
|
|
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);
|
|
|
|
log.error(msg);
|
|
|
|
throw new BadRequestException(msg);
|
|
|
|
throw new BadRequestException(msg);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (StringUtils.isEmpty(publicAppReleaseWrapper.getVersion())) {
|
|
|
|
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);
|
|
|
|
log.error(msg);
|
|
|
|
throw new BadRequestException(msg);
|
|
|
|
throw new BadRequestException(msg);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (StringUtils.isEmpty(publicAppReleaseWrapper.getPackageName())) {
|
|
|
|
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);
|
|
|
|
log.error(msg);
|
|
|
|
throw new BadRequestException(msg);
|
|
|
|
throw new BadRequestException(msg);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -3748,12 +3748,12 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
} else if (param instanceof CustomAppReleaseWrapper) {
|
|
|
|
} else if (param instanceof CustomAppReleaseWrapper) {
|
|
|
|
CustomAppReleaseWrapper customAppReleaseWrapper = (CustomAppReleaseWrapper) param;
|
|
|
|
CustomAppReleaseWrapper customAppReleaseWrapper = (CustomAppReleaseWrapper) param;
|
|
|
|
if (StringUtils.isEmpty(customAppReleaseWrapper.getVersion())) {
|
|
|
|
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);
|
|
|
|
log.error(msg);
|
|
|
|
throw new BadRequestException(msg);
|
|
|
|
throw new BadRequestException(msg);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (StringUtils.isEmpty(customAppReleaseWrapper.getPackageName())) {
|
|
|
|
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);
|
|
|
|
log.error(msg);
|
|
|
|
throw new BadRequestException(msg);
|
|
|
|
throw new BadRequestException(msg);
|
|
|
|
}
|
|
|
|
}
|
|
|
|