|
|
@ -1894,16 +1894,23 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
DeviceManagementProviderService deviceManagementProviderService = DataHolder.getInstance()
|
|
|
|
DeviceManagementProviderService deviceManagementProviderService = DataHolder.getInstance()
|
|
|
|
.getDeviceManagementService();
|
|
|
|
.getDeviceManagementService();
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
|
|
|
|
int deviceTypeId;
|
|
|
|
|
|
|
|
if (!deviceTypeName.equals(Constants.ALL)) {
|
|
|
|
DeviceType deviceType = deviceManagementProviderService.getDeviceType(deviceTypeName);
|
|
|
|
DeviceType deviceType = deviceManagementProviderService.getDeviceType(deviceTypeName);
|
|
|
|
|
|
|
|
deviceTypeId = deviceType.getId();
|
|
|
|
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 doesn't 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);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
//For web-clips device type = 'ALL'
|
|
|
|
|
|
|
|
deviceTypeId = 0;
|
|
|
|
|
|
|
|
}
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
ConnectionManagerUtil.openDBConnection();
|
|
|
|
ConnectionManagerUtil.openDBConnection();
|
|
|
|
if (applicationDAO.isExistingAppName(appName, deviceType.getId(), tenantId)) {
|
|
|
|
if (applicationDAO.isExistingAppName(appName, deviceTypeId, tenantId)) {
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} catch (DBConnectionException e) {
|
|
|
|
} catch (DBConnectionException e) {
|
|
|
|