[Lada-commits] [PATCH 12 of 15] Cleanup in stammdaten rest services

Wald Commits scm-commit at wald.intevation.org
Mon Mar 23 18:00:04 CET 2015


# HG changeset patch
# User Raimund Renkert <raimund.renkert at intevation.de>
# Date 1427129599 -3600
# Node ID b3eee641431016ef7f8184d2e6111a5e5bcbab5c
# Parent  a04658486edec8a90dab18c1e9252e3a08700bf1
Cleanup in stammdaten rest services.

diff -r a04658486ede -r b3eee6414310 src/main/java/de/intevation/lada/rest/stamm/DatenbasisService.java
--- a/src/main/java/de/intevation/lada/rest/stamm/DatenbasisService.java	Mon Mar 23 17:52:17 2015 +0100
+++ b/src/main/java/de/intevation/lada/rest/stamm/DatenbasisService.java	Mon Mar 23 17:53:19 2015 +0100
@@ -18,16 +18,8 @@
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.UriInfo;
 
-import org.apache.log4j.Logger;
-
 import de.intevation.lada.model.stamm.Datenbasis;
-import de.intevation.lada.util.annotation.AuthenticationConfig;
-import de.intevation.lada.util.annotation.AuthorizationConfig;
 import de.intevation.lada.util.annotation.RepositoryConfig;
-import de.intevation.lada.util.auth.Authentication;
-import de.intevation.lada.util.auth.AuthenticationType;
-import de.intevation.lada.util.auth.Authorization;
-import de.intevation.lada.util.auth.AuthorizationType;
 import de.intevation.lada.util.data.Repository;
 import de.intevation.lada.util.data.RepositoryType;
 import de.intevation.lada.util.rest.Response;
@@ -36,25 +28,11 @@
 @RequestScoped
 public class DatenbasisService {
 
-    /* The logger used in this class.*/
-    @Inject
-    private Logger logger;
-
     /* The data repository granting read/write access.*/
     @Inject
     @RepositoryConfig(type=RepositoryType.RO)
     private Repository defaultRepo;
 
-    /* The authentication module.*/
-    @Inject
-    @AuthenticationConfig(type=AuthenticationType.NONE)
-    private Authentication authentication;
-
-    /* The authorization module.*/
-    @Inject
-    @AuthorizationConfig(type=AuthorizationType.NONE)
-    private Authorization authorization;
-
     /**
      * Get all messung objects.
      *
@@ -67,10 +45,6 @@
         @Context HttpHeaders headers,
         @Context UriInfo info
     ) {
-        if (!authentication.isAuthenticated(headers)) {
-            logger.debug("User is not authenticated!");
-            return new Response(false, 699, null);
-        }
         return defaultRepo.getAll(Datenbasis.class, "stamm");
     }
 
@@ -86,10 +60,6 @@
         @Context HttpHeaders headers,
         @PathParam("id") String id
     ) {
-        if (!authentication.isAuthenticated(headers)) {
-            logger.debug("User is not authenticated!");
-            return new Response(false, 699, null);
-        }
         return defaultRepo.getById(
             Datenbasis.class,
             Integer.valueOf(id),
diff -r a04658486ede -r b3eee6414310 src/main/java/de/intevation/lada/rest/stamm/KoordinatenartService.java
--- a/src/main/java/de/intevation/lada/rest/stamm/KoordinatenartService.java	Mon Mar 23 17:52:17 2015 +0100
+++ b/src/main/java/de/intevation/lada/rest/stamm/KoordinatenartService.java	Mon Mar 23 17:53:19 2015 +0100
@@ -18,16 +18,8 @@
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.UriInfo;
 
-import org.apache.log4j.Logger;
-
 import de.intevation.lada.model.stamm.KoordinatenArt;
-import de.intevation.lada.util.annotation.AuthenticationConfig;
-import de.intevation.lada.util.annotation.AuthorizationConfig;
 import de.intevation.lada.util.annotation.RepositoryConfig;
-import de.intevation.lada.util.auth.Authentication;
-import de.intevation.lada.util.auth.AuthenticationType;
-import de.intevation.lada.util.auth.Authorization;
-import de.intevation.lada.util.auth.AuthorizationType;
 import de.intevation.lada.util.data.Repository;
 import de.intevation.lada.util.data.RepositoryType;
 import de.intevation.lada.util.rest.Response;
@@ -36,25 +28,11 @@
 @RequestScoped
 public class KoordinatenartService {
 
-    /* The logger used in this class.*/
-    @Inject
-    private Logger logger;
-
     /* The data repository granting read/write access.*/
     @Inject
     @RepositoryConfig(type=RepositoryType.RO)
     private Repository defaultRepo;
 
-    /* The authentication module.*/
-    @Inject
-    @AuthenticationConfig(type=AuthenticationType.NONE)
-    private Authentication authentication;
-
-    /* The authorization module.*/
-    @Inject
-    @AuthorizationConfig(type=AuthorizationType.NONE)
-    private Authorization authorization;
-
     /**
      * Get all objects.
      *
@@ -67,10 +45,6 @@
         @Context HttpHeaders headers,
         @Context UriInfo info
     ) {
-        if (!authentication.isAuthenticated(headers)) {
-            logger.debug("User is not authenticated!");
-            return new Response(false, 699, null);
-        }
         return defaultRepo.getAll(KoordinatenArt.class, "stamm");
     }
 
@@ -86,10 +60,6 @@
         @Context HttpHeaders headers,
         @PathParam("id") String id
     ) {
-        if (!authentication.isAuthenticated(headers)) {
-            logger.debug("User is not authenticated!");
-            return new Response(false, 699, null);
-        }
         return defaultRepo.getById(
             KoordinatenArt.class,
             Integer.valueOf(id),
diff -r a04658486ede -r b3eee6414310 src/main/java/de/intevation/lada/rest/stamm/LocationService.java
--- a/src/main/java/de/intevation/lada/rest/stamm/LocationService.java	Mon Mar 23 17:52:17 2015 +0100
+++ b/src/main/java/de/intevation/lada/rest/stamm/LocationService.java	Mon Mar 23 17:53:19 2015 +0100
@@ -22,16 +22,8 @@
 import javax.ws.rs.core.MultivaluedMap;
 import javax.ws.rs.core.UriInfo;
 
-import org.apache.log4j.Logger;
-
 import de.intevation.lada.model.stamm.SOrt;
-import de.intevation.lada.util.annotation.AuthenticationConfig;
-import de.intevation.lada.util.annotation.AuthorizationConfig;
 import de.intevation.lada.util.annotation.RepositoryConfig;
-import de.intevation.lada.util.auth.Authentication;
-import de.intevation.lada.util.auth.AuthenticationType;
-import de.intevation.lada.util.auth.Authorization;
-import de.intevation.lada.util.auth.AuthorizationType;
 import de.intevation.lada.util.data.QueryBuilder;
 import de.intevation.lada.util.data.Repository;
 import de.intevation.lada.util.data.RepositoryType;
@@ -41,25 +33,11 @@
 @RequestScoped
 public class LocationService {
 
-    /* The logger used in this class.*/
-    @Inject
-    private Logger logger;
-
     /* The data repository granting read/write access.*/
     @Inject
     @RepositoryConfig(type=RepositoryType.RW)
     private Repository defaultRepo;
 
-    /* The authentication module.*/
-    @Inject
-    @AuthenticationConfig(type=AuthenticationType.NONE)
-    private Authentication authentication;
-
-    /* The authorization module.*/
-    @Inject
-    @AuthorizationConfig(type=AuthorizationType.NONE)
-    private Authorization authorization;
-
     /**
      * Get all objects.
      *
@@ -72,10 +50,6 @@
         @Context HttpHeaders headers,
         @Context UriInfo info
     ) {
-        if (!authentication.isAuthenticated(headers)) {
-            logger.debug("User is not authenticated!");
-            return new Response(false, 699, null);
-        }
         MultivaluedMap<String, String> params = info.getQueryParameters();
         if (params.isEmpty() || !params.containsKey("ortId")) {
             return defaultRepo.getAll(SOrt.class, "stamm");
@@ -101,10 +75,6 @@
         @Context HttpHeaders headers,
         @PathParam("id") String id
     ) {
-        if (!authentication.isAuthenticated(headers)) {
-            logger.debug("User is not authenticated!");
-            return new Response(false, 699, null);
-        }
         return defaultRepo.getById(
             SOrt.class,
             Integer.valueOf(id),
@@ -118,9 +88,6 @@
         @Context HttpHeaders headers,
         SOrt ort
     ) {
-        if (!authentication.isAuthenticated(headers)) {
-            return new Response(false, 699, null);
-        }
         /* Persist the new object*/
         return defaultRepo.create(ort, "stamm");
     }
@@ -134,10 +101,6 @@
     @Path("/")
     @Produces(MediaType.APPLICATION_JSON)
     public Response update(@Context HttpHeaders headers, SOrt ort) {
-        if (!authentication.isAuthenticated(headers)) {
-            logger.debug("User is not authenticated!");
-            return new Response(false, 699, null);
-        }
         Response response = defaultRepo.update(ort, "stamm");
         Response updated = defaultRepo.getById(
             SOrt.class,
@@ -157,10 +120,6 @@
         @Context HttpHeaders headers,
         @PathParam("id") String id
     ) {
-        if (!authentication.isAuthenticated(headers)) {
-            logger.debug("User is not authenticated!");
-            return new Response(false, 699, null);
-        }
         /* Get the object by id*/
         Response object =
             defaultRepo.getById(SOrt.class, Integer.valueOf(id), "stamm");
diff -r a04658486ede -r b3eee6414310 src/main/java/de/intevation/lada/rest/stamm/MesseinheitService.java
--- a/src/main/java/de/intevation/lada/rest/stamm/MesseinheitService.java	Mon Mar 23 17:52:17 2015 +0100
+++ b/src/main/java/de/intevation/lada/rest/stamm/MesseinheitService.java	Mon Mar 23 17:53:19 2015 +0100
@@ -18,16 +18,8 @@
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.UriInfo;
 
-import org.apache.log4j.Logger;
-
 import de.intevation.lada.model.stamm.MessEinheit;
-import de.intevation.lada.util.annotation.AuthenticationConfig;
-import de.intevation.lada.util.annotation.AuthorizationConfig;
 import de.intevation.lada.util.annotation.RepositoryConfig;
-import de.intevation.lada.util.auth.Authentication;
-import de.intevation.lada.util.auth.AuthenticationType;
-import de.intevation.lada.util.auth.Authorization;
-import de.intevation.lada.util.auth.AuthorizationType;
 import de.intevation.lada.util.data.Repository;
 import de.intevation.lada.util.data.RepositoryType;
 import de.intevation.lada.util.rest.Response;
@@ -36,25 +28,11 @@
 @RequestScoped
 public class MesseinheitService {
 
-    /* The logger used in this class.*/
-    @Inject
-    private Logger logger;
-
     /* The data repository granting read/write access.*/
     @Inject
     @RepositoryConfig(type=RepositoryType.RO)
     private Repository defaultRepo;
 
-    /* The authentication module.*/
-    @Inject
-    @AuthenticationConfig(type=AuthenticationType.NONE)
-    private Authentication authentication;
-
-    /* The authorization module.*/
-    @Inject
-    @AuthorizationConfig(type=AuthorizationType.NONE)
-    private Authorization authorization;
-
     /**
      * Get all objects.
      *
@@ -67,10 +45,6 @@
         @Context HttpHeaders headers,
         @Context UriInfo info
     ) {
-        if (!authentication.isAuthenticated(headers)) {
-            logger.debug("User is not authenticated!");
-            return new Response(false, 699, null);
-        }
         return defaultRepo.getAll(MessEinheit.class, "stamm");
     }
 
@@ -86,10 +60,6 @@
         @Context HttpHeaders headers,
         @PathParam("id") String id
     ) {
-        if (!authentication.isAuthenticated(headers)) {
-            logger.debug("User is not authenticated!");
-            return new Response(false, 699, null);
-        }
         return defaultRepo.getById(
             MessEinheit.class,
             Integer.valueOf(id),
diff -r a04658486ede -r b3eee6414310 src/main/java/de/intevation/lada/rest/stamm/MessgroesseService.java
--- a/src/main/java/de/intevation/lada/rest/stamm/MessgroesseService.java	Mon Mar 23 17:52:17 2015 +0100
+++ b/src/main/java/de/intevation/lada/rest/stamm/MessgroesseService.java	Mon Mar 23 17:53:19 2015 +0100
@@ -18,16 +18,8 @@
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.UriInfo;
 
-import org.apache.log4j.Logger;
-
 import de.intevation.lada.model.stamm.Messgroesse;
-import de.intevation.lada.util.annotation.AuthenticationConfig;
-import de.intevation.lada.util.annotation.AuthorizationConfig;
 import de.intevation.lada.util.annotation.RepositoryConfig;
-import de.intevation.lada.util.auth.Authentication;
-import de.intevation.lada.util.auth.AuthenticationType;
-import de.intevation.lada.util.auth.Authorization;
-import de.intevation.lada.util.auth.AuthorizationType;
 import de.intevation.lada.util.data.Repository;
 import de.intevation.lada.util.data.RepositoryType;
 import de.intevation.lada.util.rest.Response;
@@ -36,25 +28,11 @@
 @RequestScoped
 public class MessgroesseService {
 
-    /* The logger used in this class.*/
-    @Inject
-    private Logger logger;
-
     /* The data repository granting read/write access.*/
     @Inject
     @RepositoryConfig(type=RepositoryType.RO)
     private Repository defaultRepo;
 
-    /* The authentication module.*/
-    @Inject
-    @AuthenticationConfig(type=AuthenticationType.NONE)
-    private Authentication authentication;
-
-    /* The authorization module.*/
-    @Inject
-    @AuthorizationConfig(type=AuthorizationType.NONE)
-    private Authorization authorization;
-
     /**
      * Get all objects.
      *
@@ -67,10 +45,6 @@
         @Context HttpHeaders headers,
         @Context UriInfo info
     ) {
-        if (!authentication.isAuthenticated(headers)) {
-            logger.debug("User is not authenticated!");
-            return new Response(false, 699, null);
-        }
         return defaultRepo.getAll(Messgroesse.class, "stamm");
     }
 
@@ -86,10 +60,6 @@
         @Context HttpHeaders headers,
         @PathParam("id") String id
     ) {
-        if (!authentication.isAuthenticated(headers)) {
-            logger.debug("User is not authenticated!");
-            return new Response(false, 699, null);
-        }
         return defaultRepo.getById(
             Messgroesse.class,
             Integer.valueOf(id),
diff -r a04658486ede -r b3eee6414310 src/main/java/de/intevation/lada/rest/stamm/MessmethodeService.java
--- a/src/main/java/de/intevation/lada/rest/stamm/MessmethodeService.java	Mon Mar 23 17:52:17 2015 +0100
+++ b/src/main/java/de/intevation/lada/rest/stamm/MessmethodeService.java	Mon Mar 23 17:53:19 2015 +0100
@@ -18,16 +18,8 @@
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.UriInfo;
 
-import org.apache.log4j.Logger;
-
 import de.intevation.lada.model.stamm.MessMethode;
-import de.intevation.lada.util.annotation.AuthenticationConfig;
-import de.intevation.lada.util.annotation.AuthorizationConfig;
 import de.intevation.lada.util.annotation.RepositoryConfig;
-import de.intevation.lada.util.auth.Authentication;
-import de.intevation.lada.util.auth.AuthenticationType;
-import de.intevation.lada.util.auth.Authorization;
-import de.intevation.lada.util.auth.AuthorizationType;
 import de.intevation.lada.util.data.Repository;
 import de.intevation.lada.util.data.RepositoryType;
 import de.intevation.lada.util.rest.Response;
@@ -36,25 +28,11 @@
 @RequestScoped
 public class MessmethodeService {
 
-    /* The logger used in this class.*/
-    @Inject
-    private Logger logger;
-
     /* The data repository granting read/write access.*/
     @Inject
     @RepositoryConfig(type=RepositoryType.RO)
     private Repository defaultRepo;
 
-    /* The authentication module.*/
-    @Inject
-    @AuthenticationConfig(type=AuthenticationType.NONE)
-    private Authentication authentication;
-
-    /* The authorization module.*/
-    @Inject
-    @AuthorizationConfig(type=AuthorizationType.NONE)
-    private Authorization authorization;
-
     /**
      * Get all objects.
      *
@@ -67,10 +45,6 @@
         @Context HttpHeaders headers,
         @Context UriInfo info
     ) {
-        if (!authentication.isAuthenticated(headers)) {
-            logger.debug("User is not authenticated!");
-            return new Response(false, 699, null);
-        }
         return defaultRepo.getAll(MessMethode.class, "stamm");
     }
 
@@ -86,10 +60,6 @@
         @Context HttpHeaders headers,
         @PathParam("id") String id
     ) {
-        if (!authentication.isAuthenticated(headers)) {
-            logger.debug("User is not authenticated!");
-            return new Response(false, 699, null);
-        }
         return defaultRepo.getById(
             MessMethode.class,
             id,
diff -r a04658486ede -r b3eee6414310 src/main/java/de/intevation/lada/rest/stamm/PflichtmessgroesseService.java
--- a/src/main/java/de/intevation/lada/rest/stamm/PflichtmessgroesseService.java	Mon Mar 23 17:52:17 2015 +0100
+++ b/src/main/java/de/intevation/lada/rest/stamm/PflichtmessgroesseService.java	Mon Mar 23 17:53:19 2015 +0100
@@ -18,16 +18,8 @@
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.UriInfo;
 
-import org.apache.log4j.Logger;
-
 import de.intevation.lada.model.stamm.PflichtMessgroesse;
-import de.intevation.lada.util.annotation.AuthenticationConfig;
-import de.intevation.lada.util.annotation.AuthorizationConfig;
 import de.intevation.lada.util.annotation.RepositoryConfig;
-import de.intevation.lada.util.auth.Authentication;
-import de.intevation.lada.util.auth.AuthenticationType;
-import de.intevation.lada.util.auth.Authorization;
-import de.intevation.lada.util.auth.AuthorizationType;
 import de.intevation.lada.util.data.Repository;
 import de.intevation.lada.util.data.RepositoryType;
 import de.intevation.lada.util.rest.Response;
@@ -36,25 +28,11 @@
 @RequestScoped
 public class PflichtmessgroesseService {
 
-    /* The logger used in this class.*/
-    @Inject
-    private Logger logger;
-
     /* The data repository granting read/write access.*/
     @Inject
     @RepositoryConfig(type=RepositoryType.RO)
     private Repository defaultRepo;
 
-    /* The authentication module.*/
-    @Inject
-    @AuthenticationConfig(type=AuthenticationType.NONE)
-    private Authentication authentication;
-
-    /* The authorization module.*/
-    @Inject
-    @AuthorizationConfig(type=AuthorizationType.NONE)
-    private Authorization authorization;
-
     /**
      * Get all objects.
      *
@@ -67,10 +45,6 @@
         @Context HttpHeaders headers,
         @Context UriInfo info
     ) {
-        if (!authentication.isAuthenticated(headers)) {
-            logger.debug("User is not authenticated!");
-            return new Response(false, 699, null);
-        }
         return defaultRepo.getAll(PflichtMessgroesse.class, "stamm");
     }
 
@@ -86,10 +60,6 @@
         @Context HttpHeaders headers,
         @PathParam("id") String id
     ) {
-        if (!authentication.isAuthenticated(headers)) {
-            logger.debug("User is not authenticated!");
-            return new Response(false, 699, null);
-        }
         return defaultRepo.getById(
             PflichtMessgroesse.class,
             Integer.valueOf(id),
diff -r a04658486ede -r b3eee6414310 src/main/java/de/intevation/lada/rest/stamm/ProbenartService.java
--- a/src/main/java/de/intevation/lada/rest/stamm/ProbenartService.java	Mon Mar 23 17:52:17 2015 +0100
+++ b/src/main/java/de/intevation/lada/rest/stamm/ProbenartService.java	Mon Mar 23 17:53:19 2015 +0100
@@ -18,16 +18,8 @@
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.UriInfo;
 
-import org.apache.log4j.Logger;
-
 import de.intevation.lada.model.stamm.Probenart;
-import de.intevation.lada.util.annotation.AuthenticationConfig;
-import de.intevation.lada.util.annotation.AuthorizationConfig;
 import de.intevation.lada.util.annotation.RepositoryConfig;
-import de.intevation.lada.util.auth.Authentication;
-import de.intevation.lada.util.auth.AuthenticationType;
-import de.intevation.lada.util.auth.Authorization;
-import de.intevation.lada.util.auth.AuthorizationType;
 import de.intevation.lada.util.data.Repository;
 import de.intevation.lada.util.data.RepositoryType;
 import de.intevation.lada.util.rest.Response;
@@ -36,25 +28,11 @@
 @RequestScoped
 public class ProbenartService {
 
-    /* The logger used in this class.*/
-    @Inject
-    private Logger logger;
-
     /* The data repository granting read/write access.*/
     @Inject
     @RepositoryConfig(type=RepositoryType.RO)
     private Repository defaultRepo;
 
-    /* The authentication module.*/
-    @Inject
-    @AuthenticationConfig(type=AuthenticationType.NONE)
-    private Authentication authentication;
-
-    /* The authorization module.*/
-    @Inject
-    @AuthorizationConfig(type=AuthorizationType.NONE)
-    private Authorization authorization;
-
     /**
      * Get all objects.
      *
@@ -67,10 +45,6 @@
         @Context HttpHeaders headers,
         @Context UriInfo info
     ) {
-        if (!authentication.isAuthenticated(headers)) {
-            logger.debug("User is not authenticated!");
-            return new Response(false, 699, null);
-        }
         return defaultRepo.getAll(Probenart.class, "stamm");
     }
 
@@ -86,10 +60,6 @@
         @Context HttpHeaders headers,
         @PathParam("id") String id
     ) {
-        if (!authentication.isAuthenticated(headers)) {
-            logger.debug("User is not authenticated!");
-            return new Response(false, 699, null);
-        }
         return defaultRepo.getById(
             Probenart.class,
             Integer.valueOf(id),
diff -r a04658486ede -r b3eee6414310 src/main/java/de/intevation/lada/rest/stamm/ProbenzusatzService.java
--- a/src/main/java/de/intevation/lada/rest/stamm/ProbenzusatzService.java	Mon Mar 23 17:52:17 2015 +0100
+++ b/src/main/java/de/intevation/lada/rest/stamm/ProbenzusatzService.java	Mon Mar 23 17:53:19 2015 +0100
@@ -18,16 +18,8 @@
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.UriInfo;
 
-import org.apache.log4j.Logger;
-
 import de.intevation.lada.model.stamm.ProbenZusatz;
-import de.intevation.lada.util.annotation.AuthenticationConfig;
-import de.intevation.lada.util.annotation.AuthorizationConfig;
 import de.intevation.lada.util.annotation.RepositoryConfig;
-import de.intevation.lada.util.auth.Authentication;
-import de.intevation.lada.util.auth.AuthenticationType;
-import de.intevation.lada.util.auth.Authorization;
-import de.intevation.lada.util.auth.AuthorizationType;
 import de.intevation.lada.util.data.Repository;
 import de.intevation.lada.util.data.RepositoryType;
 import de.intevation.lada.util.rest.Response;
@@ -36,25 +28,11 @@
 @RequestScoped
 public class ProbenzusatzService {
 
-    /* The logger used in this class.*/
-    @Inject
-    private Logger logger;
-
     /* The data repository granting read/write access.*/
     @Inject
     @RepositoryConfig(type=RepositoryType.RO)
     private Repository defaultRepo;
 
-    /* The authentication module.*/
-    @Inject
-    @AuthenticationConfig(type=AuthenticationType.NONE)
-    private Authentication authentication;
-
-    /* The authorization module.*/
-    @Inject
-    @AuthorizationConfig(type=AuthorizationType.NONE)
-    private Authorization authorization;
-
     /**
      * Get all objects.
      *
@@ -67,10 +45,6 @@
         @Context HttpHeaders headers,
         @Context UriInfo info
     ) {
-        if (!authentication.isAuthenticated(headers)) {
-            logger.debug("User is not authenticated!");
-            return new Response(false, 699, null);
-        }
         return defaultRepo.getAll(ProbenZusatz.class, "stamm");
     }
 
@@ -86,10 +60,6 @@
         @Context HttpHeaders headers,
         @PathParam("id") String id
     ) {
-        if (!authentication.isAuthenticated(headers)) {
-            logger.debug("User is not authenticated!");
-            return new Response(false, 699, null);
-        }
         return defaultRepo.getById(
             ProbenZusatz.class,
             id,
diff -r a04658486ede -r b3eee6414310 src/main/java/de/intevation/lada/rest/stamm/StaatService.java
--- a/src/main/java/de/intevation/lada/rest/stamm/StaatService.java	Mon Mar 23 17:52:17 2015 +0100
+++ b/src/main/java/de/intevation/lada/rest/stamm/StaatService.java	Mon Mar 23 17:53:19 2015 +0100
@@ -18,16 +18,8 @@
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.UriInfo;
 
-import org.apache.log4j.Logger;
-
 import de.intevation.lada.model.stamm.Staat;
-import de.intevation.lada.util.annotation.AuthenticationConfig;
-import de.intevation.lada.util.annotation.AuthorizationConfig;
 import de.intevation.lada.util.annotation.RepositoryConfig;
-import de.intevation.lada.util.auth.Authentication;
-import de.intevation.lada.util.auth.AuthenticationType;
-import de.intevation.lada.util.auth.Authorization;
-import de.intevation.lada.util.auth.AuthorizationType;
 import de.intevation.lada.util.data.Repository;
 import de.intevation.lada.util.data.RepositoryType;
 import de.intevation.lada.util.rest.Response;
@@ -36,25 +28,11 @@
 @RequestScoped
 public class StaatService {
 
-    /* The logger used in this class.*/
-    @Inject
-    private Logger logger;
-
     /* The data repository granting read/write access.*/
     @Inject
     @RepositoryConfig(type=RepositoryType.RO)
     private Repository defaultRepo;
 
-    /* The authentication module.*/
-    @Inject
-    @AuthenticationConfig(type=AuthenticationType.NONE)
-    private Authentication authentication;
-
-    /* The authorization module.*/
-    @Inject
-    @AuthorizationConfig(type=AuthorizationType.NONE)
-    private Authorization authorization;
-
     /**
      * Get all objects.
      *
@@ -67,10 +45,6 @@
         @Context HttpHeaders headers,
         @Context UriInfo info
     ) {
-        if (!authentication.isAuthenticated(headers)) {
-            logger.debug("User is not authenticated!");
-            return new Response(false, 699, null);
-        }
         return defaultRepo.getAll(Staat.class, "stamm");
     }
 
@@ -86,10 +60,6 @@
         @Context HttpHeaders headers,
         @PathParam("id") String id
     ) {
-        if (!authentication.isAuthenticated(headers)) {
-            logger.debug("User is not authenticated!");
-            return new Response(false, 699, null);
-        }
         return defaultRepo.getById(
             Staat.class,
             Integer.valueOf(id),
diff -r a04658486ede -r b3eee6414310 src/main/java/de/intevation/lada/rest/stamm/UmweltService.java
--- a/src/main/java/de/intevation/lada/rest/stamm/UmweltService.java	Mon Mar 23 17:52:17 2015 +0100
+++ b/src/main/java/de/intevation/lada/rest/stamm/UmweltService.java	Mon Mar 23 17:53:19 2015 +0100
@@ -18,16 +18,8 @@
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.UriInfo;
 
-import org.apache.log4j.Logger;
-
 import de.intevation.lada.model.stamm.Umwelt;
-import de.intevation.lada.util.annotation.AuthenticationConfig;
-import de.intevation.lada.util.annotation.AuthorizationConfig;
 import de.intevation.lada.util.annotation.RepositoryConfig;
-import de.intevation.lada.util.auth.Authentication;
-import de.intevation.lada.util.auth.AuthenticationType;
-import de.intevation.lada.util.auth.Authorization;
-import de.intevation.lada.util.auth.AuthorizationType;
 import de.intevation.lada.util.data.Repository;
 import de.intevation.lada.util.data.RepositoryType;
 import de.intevation.lada.util.rest.Response;
@@ -36,25 +28,11 @@
 @RequestScoped
 public class UmweltService {
 
-    /* The logger used in this class.*/
-    @Inject
-    private Logger logger;
-
     /* The data repository granting read/write access.*/
     @Inject
     @RepositoryConfig(type=RepositoryType.RO)
     private Repository defaultRepo;
 
-    /* The authentication module.*/
-    @Inject
-    @AuthenticationConfig(type=AuthenticationType.NONE)
-    private Authentication authentication;
-
-    /* The authorization module.*/
-    @Inject
-    @AuthorizationConfig(type=AuthorizationType.NONE)
-    private Authorization authorization;
-
     /**
      * Get all objects.
      *
@@ -67,10 +45,6 @@
         @Context HttpHeaders headers,
         @Context UriInfo info
     ) {
-        if (!authentication.isAuthenticated(headers)) {
-            logger.debug("User is not authenticated!");
-            return new Response(false, 699, null);
-        }
         return defaultRepo.getAll(Umwelt.class, "stamm");
     }
 
@@ -86,10 +60,6 @@
         @Context HttpHeaders headers,
         @PathParam("id") String id
     ) {
-        if (!authentication.isAuthenticated(headers)) {
-            logger.debug("User is not authenticated!");
-            return new Response(false, 699, null);
-        }
         return defaultRepo.getById(
             Umwelt.class,
             id,


More information about the Lada-commits mailing list