Roberto Sánchez
2014-09-19 071a008cf28e733ca3aaafa57e675fd54a5ea33b
securis/src/main/java/net/curisit/securis/services/BasicServices.java
....@@ -24,8 +24,8 @@
2424 import net.curisit.securis.security.Securable;
2525 import net.curisit.securis.utils.TokenHelper;
2626
27
-import org.apache.logging.log4j.Logger;
2827 import org.apache.logging.log4j.LogManager;
28
+import org.apache.logging.log4j.Logger;
2929
3030 /**
3131 * Basic services for login and basic app wrkflow
....@@ -42,18 +42,23 @@
4242 TokenHelper tokenHelper;
4343
4444 @Inject
45
- public BasicServices() {}
45
+ public BasicServices() {
46
+ }
4647
4748 @GET
4849 @Path("/info")
49
- @Produces({ MediaType.TEXT_PLAIN })
50
+ @Produces({
51
+ MediaType.TEXT_PLAIN
52
+ })
5053 public Response info(@Context HttpServletRequest request) {
5154 return Response.ok().entity("License server running OK. Date: " + new Date()).build();
5255 }
5356
5457 @GET
5558 @Path("/{module:(admin)|(login)|(licenses)}")
56
- @Produces({ MediaType.TEXT_HTML })
59
+ @Produces({
60
+ MediaType.TEXT_HTML
61
+ })
5762 public Response init(@PathParam("module") String module, @Context HttpServletRequest request) {
5863 LOG.info("App index main.html");
5964 String page = "/main.html";
....@@ -63,7 +68,9 @@
6368
6469 @POST
6570 @Path("/login")
66
- @Produces({ MediaType.APPLICATION_JSON })
71
+ @Produces({
72
+ MediaType.APPLICATION_JSON
73
+ })
6774 public Response login(@FormParam("username") String user, @FormParam("password") String password, @Context HttpServletRequest request) {
6875 LOG.info("index session: " + request.getSession());
6976 LOG.info("user: {}, pass: {}", user, password);
....@@ -88,7 +95,9 @@
8895 @GET
8996 @Securable()
9097 @Path("/check")
91
- @Produces({ MediaType.APPLICATION_JSON })
98
+ @Produces({
99
+ MediaType.APPLICATION_JSON
100
+ })
92101 public Response check(@HeaderParam(TokenHelper.TOKEN_HEADER_PÀRAM) String token, @QueryParam("token") String token2) {
93102 if (token == null) {
94103 token = token2;
....@@ -110,7 +119,9 @@
110119 @GET
111120 @POST
112121 @Path("/logout")
113
- @Produces({ MediaType.APPLICATION_JSON })
122
+ @Produces({
123
+ MediaType.APPLICATION_JSON
124
+ })
114125 public Response logout(@HeaderParam(TokenHelper.TOKEN_HEADER_PÀRAM) String token) {
115126 if (token == null) {
116127 Response.status(Status.BAD_REQUEST).build();