| .. | .. |
|---|
| 29 | 29 | import net.curisit.securis.db.LicenseType; |
|---|
| 30 | 30 | import net.curisit.securis.utils.TokenHelper; |
|---|
| 31 | 31 | |
|---|
| 32 | | -import org.apache.logging.log4j.Logger; |
|---|
| 33 | 32 | import org.apache.logging.log4j.LogManager; |
|---|
| 33 | +import org.apache.logging.log4j.Logger; |
|---|
| 34 | 34 | |
|---|
| 35 | 35 | import com.google.inject.persist.Transactional; |
|---|
| 36 | 36 | |
|---|
| .. | .. |
|---|
| 51 | 51 | @Inject |
|---|
| 52 | 52 | Provider<EntityManager> emProvider; |
|---|
| 53 | 53 | |
|---|
| 54 | | - public LicenseTypeResource() {} |
|---|
| 54 | + public LicenseTypeResource() { |
|---|
| 55 | + } |
|---|
| 55 | 56 | |
|---|
| 56 | 57 | /** |
|---|
| 57 | 58 | * |
|---|
| .. | .. |
|---|
| 59 | 60 | */ |
|---|
| 60 | 61 | @GET |
|---|
| 61 | 62 | @Path("/") |
|---|
| 62 | | - @Produces({ MediaType.APPLICATION_JSON }) |
|---|
| 63 | + @Produces({ |
|---|
| 64 | + MediaType.APPLICATION_JSON |
|---|
| 65 | + }) |
|---|
| 63 | 66 | public Response index() { |
|---|
| 64 | 67 | LOG.info("Getting license types list "); |
|---|
| 65 | 68 | |
|---|
| .. | .. |
|---|
| 76 | 79 | */ |
|---|
| 77 | 80 | @GET |
|---|
| 78 | 81 | @Path("/{ltid}") |
|---|
| 79 | | - @Produces({ MediaType.APPLICATION_JSON }) |
|---|
| 82 | + @Produces({ |
|---|
| 83 | + MediaType.APPLICATION_JSON |
|---|
| 84 | + }) |
|---|
| 80 | 85 | public Response get(@PathParam("ltid") String ltid, @HeaderParam(TokenHelper.TOKEN_HEADER_PÀRAM) String token) { |
|---|
| 81 | 86 | LOG.info("Getting license type data for id: {}: ", ltid); |
|---|
| 82 | 87 | if (ltid == null || "".equals(ltid)) { |
|---|
| .. | .. |
|---|
| 96 | 101 | @POST |
|---|
| 97 | 102 | @Path("/") |
|---|
| 98 | 103 | @Consumes(MediaType.APPLICATION_JSON) |
|---|
| 99 | | - @Produces({ MediaType.APPLICATION_JSON }) |
|---|
| 104 | + @Produces({ |
|---|
| 105 | + MediaType.APPLICATION_JSON |
|---|
| 106 | + }) |
|---|
| 100 | 107 | @Transactional |
|---|
| 101 | 108 | public Response create(LicenseType lt, @HeaderParam(TokenHelper.TOKEN_HEADER_PÀRAM) String token) { |
|---|
| 102 | 109 | LOG.info("Creating new license type"); |
|---|
| .. | .. |
|---|
| 125 | 132 | @Path("/{ltid}") |
|---|
| 126 | 133 | @Transactional |
|---|
| 127 | 134 | @Consumes(MediaType.APPLICATION_JSON) |
|---|
| 128 | | - @Produces({ MediaType.APPLICATION_JSON }) |
|---|
| 135 | + @Produces({ |
|---|
| 136 | + MediaType.APPLICATION_JSON |
|---|
| 137 | + }) |
|---|
| 129 | 138 | public Response modify(LicenseType lt, @PathParam("ltid") String ltid, @HeaderParam(TokenHelper.TOKEN_HEADER_PÀRAM) String token) { |
|---|
| 130 | 139 | LOG.info("Modifying license type with id: {}", ltid); |
|---|
| 131 | 140 | EntityManager em = emProvider.get(); |
|---|
| .. | .. |
|---|
| 166 | 175 | @DELETE |
|---|
| 167 | 176 | @Path("/{ltid}") |
|---|
| 168 | 177 | @Transactional |
|---|
| 169 | | - @Produces({ MediaType.APPLICATION_JSON }) |
|---|
| 178 | + @Produces({ |
|---|
| 179 | + MediaType.APPLICATION_JSON |
|---|
| 180 | + }) |
|---|
| 170 | 181 | public Response delete(@PathParam("ltid") String ltid, @Context HttpServletRequest request) { |
|---|
| 171 | 182 | LOG.info("Deleting app with id: {}", ltid); |
|---|
| 172 | 183 | EntityManager em = emProvider.get(); |
|---|