[Lada-commits] [PATCH] Add LoginServlet dummy

Wald Commits scm-commit at wald.intevation.org
Fri Mar 13 09:58:46 CET 2015


# HG changeset patch
# User Andre Heinecke <andre.heinecke at intevation.de>
# Date 1426237121 -3600
# Branch openid
# Node ID 28fd6616e0f886886cea360affef86e7f2abb5e1
# Parent  68c8b9e5f3e9b50399cd84987a8360f138f1ac95
Add LoginServlet dummy

    This just serves as a clean service endpoint for the
    client to try to get through the authentication filter.

diff -r 68c8b9e5f3e9 -r 28fd6616e0f8 src/main/java/de/intevation/lada/rest/LoginService.java
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/main/java/de/intevation/lada/rest/LoginService.java	Fri Mar 13 09:58:41 2015 +0100
@@ -0,0 +1,49 @@
+/* Copyright (C) 2015 by Bundesamt fuer Strahlenschutz
+ * Software engineering by Intevation GmbH
+ *
+ * This file is Free Software under the GNU GPL (v>=3) 
+ * and comes with ABSOLUTELY NO WARRANTY! Check out 
+ * the documentation coming with IMIS-Labordaten-Application for details. 
+ */
+
+import javax.enterprise.context.RequestScoped;
+
+import javax.ws.rs.Path;
+import javax.ws.rs.GET;
+import javax.inject.Inject;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.HttpHeaders;
+import javax.ws.rs.core.UriInfo;
+import javax.ws.rs.Produces;
+
+import org.apache.log4j.Logger;
+
+import de.intevation.lada.util.rest.Response;
+/**
+ * This class serves as a login check service
+ */
+ at Path("login")
+ at RequestScoped
+public class LoginService {
+
+    /* The logger used in this class.*/
+    @Inject
+    private Logger logger;
+
+    /**
+     * Get all probe objects.
+     *
+     * @return Response object containing all probe objects.
+     */
+    @SuppressWarnings("unchecked")
+    @GET
+    @Path("/")
+    @Produces("application/json")
+    public Response get(
+        @Context HttpHeaders headers,
+        @Context UriInfo info
+    ) {
+        /* This should probably contain the users name and roles. */
+        return new Response(true, 200, "Success");
+    }
+}


More information about the Lada-commits mailing list