| .. | .. |
|---|
| 23 | 23 | import javax.ws.rs.core.Response.Status; |
|---|
| 24 | 24 | |
|---|
| 25 | 25 | import net.curisit.integrity.commons.Utils; |
|---|
| 26 | | -import net.curisit.securis.SecurisErrorHandler; |
|---|
| 26 | +import net.curisit.securis.DefaultExceptionHandler; |
|---|
| 27 | 27 | import net.curisit.securis.db.Application; |
|---|
| 28 | 28 | import net.curisit.securis.utils.TokenHelper; |
|---|
| 29 | 29 | |
|---|
| .. | .. |
|---|
| 88 | 88 | Application app = em.find(Application.class, Integer.parseInt(appid)); |
|---|
| 89 | 89 | if (app == null) { |
|---|
| 90 | 90 | log.error("Application with id {} not found in DB", appid); |
|---|
| 91 | | - return Response.status(Status.NOT_FOUND).header(SecurisErrorHandler.HEADER_ERROR_MESSAGE, "Application not found with ID: " + appid).build(); |
|---|
| 91 | + |
|---|
| 92 | + return Response.status(Status.NOT_FOUND).header(DefaultExceptionHandler.ERROR_MESSAGE_HEADER, "Application not found with ID: " + appid).build(); |
|---|
| 92 | 93 | } |
|---|
| 93 | 94 | return Response.ok(app).build(); |
|---|
| 94 | 95 | } |
|---|
| .. | .. |
|---|
| 121 | 122 | Application currentapp = em.find(Application.class, Integer.parseInt(appid)); |
|---|
| 122 | 123 | if (currentapp == null) { |
|---|
| 123 | 124 | log.error("Application with id {} not found in DB", appid); |
|---|
| 124 | | - return Response.status(Status.NOT_FOUND).header(SecurisErrorHandler.HEADER_ERROR_MESSAGE, "Application not found with ID: " + appid).build(); |
|---|
| 125 | + return Response.status(Status.NOT_FOUND).header(DefaultExceptionHandler.ERROR_MESSAGE_HEADER, "Application not found with ID: " + appid).build(); |
|---|
| 125 | 126 | } |
|---|
| 126 | 127 | currentapp.setName(app.getName()); |
|---|
| 127 | 128 | currentapp.setDescription(app.getDescription()); |
|---|
| .. | .. |
|---|
| 141 | 142 | Application app = em.find(Application.class, Integer.parseInt(appid)); |
|---|
| 142 | 143 | if (app == null) { |
|---|
| 143 | 144 | log.error("Application with id {} can not be deleted, It was not found in DB", appid); |
|---|
| 144 | | - return Response.status(Status.NOT_FOUND).header(SecurisErrorHandler.HEADER_ERROR_MESSAGE, "Application not found with ID: " + appid).build(); |
|---|
| 145 | + return Response.status(Status.NOT_FOUND).header(DefaultExceptionHandler.ERROR_MESSAGE_HEADER, "Application not found with ID: " + appid).build(); |
|---|
| 145 | 146 | } |
|---|
| 146 | 147 | |
|---|
| 147 | 148 | if (app.getLicenseTypes() != null && app.getLicenseTypes().size() > 0) { |
|---|
| 148 | | - return Response.status(Status.FORBIDDEN).header(SecurisErrorHandler.HEADER_ERROR_MESSAGE, "Application can not be deleted becasue has assigned one or more License types, ID: " + appid).build(); |
|---|
| 149 | + return Response.status(Status.FORBIDDEN).header(DefaultExceptionHandler.ERROR_MESSAGE_HEADER, "Application can not be deleted becasue has assigned one or more License types, ID: " + appid).build(); |
|---|
| 149 | 150 | } |
|---|
| 150 | 151 | |
|---|
| 151 | 152 | em.remove(app); |
|---|