|
|
|
@ -373,11 +373,16 @@ public class ApplicationManagementPublisherAPIImpl implements ApplicationManagem
|
|
|
|
|
log.error(msg);
|
|
|
|
|
return Response.status(Response.Status.BAD_REQUEST).build();
|
|
|
|
|
}
|
|
|
|
|
if(appName.length()>20){
|
|
|
|
|
String msg = "Invalid app name, maximum length of the application name should be 20 characters.";
|
|
|
|
|
log.error(msg);
|
|
|
|
|
return Response.status(Response.Status.LENGTH_REQUIRED).build();
|
|
|
|
|
}
|
|
|
|
|
ApplicationManager applicationManager = APIUtil.getApplicationManager();
|
|
|
|
|
if (applicationManager.isExistingAppName(appName, deviceType)) {
|
|
|
|
|
return Response.status(Response.Status.CONFLICT).build();
|
|
|
|
|
}
|
|
|
|
|
return Response.status(Response.Status.OK).build();
|
|
|
|
|
return Response.status(Response.Status.OK).build();
|
|
|
|
|
} catch (BadRequestException e) {
|
|
|
|
|
log.error("Found invalid device type to check application existence.", e);
|
|
|
|
|
return Response.status(Response.Status.BAD_REQUEST).build();
|
|
|
|
|