changeset 583:b3eee6414310

Cleanup in stammdaten rest services.
author Raimund Renkert <raimund.renkert@intevation.de>
date Mon, 23 Mar 2015 17:53:19 +0100
parents a04658486ede
children 6de05718ac8d
files src/main/java/de/intevation/lada/rest/stamm/DatenbasisService.java src/main/java/de/intevation/lada/rest/stamm/KoordinatenartService.java src/main/java/de/intevation/lada/rest/stamm/LocationService.java src/main/java/de/intevation/lada/rest/stamm/MesseinheitService.java src/main/java/de/intevation/lada/rest/stamm/MessgroesseService.java src/main/java/de/intevation/lada/rest/stamm/MessmethodeService.java src/main/java/de/intevation/lada/rest/stamm/PflichtmessgroesseService.java src/main/java/de/intevation/lada/rest/stamm/ProbenartService.java src/main/java/de/intevation/lada/rest/stamm/ProbenzusatzService.java src/main/java/de/intevation/lada/rest/stamm/StaatService.java src/main/java/de/intevation/lada/rest/stamm/UmweltService.java
diffstat 11 files changed, 0 insertions(+), 341 deletions(-) [+]
line wrap: on
line diff
--- 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),
--- 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),
--- 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");
--- 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),
--- 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),
--- 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,
--- 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),
--- 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),
--- 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,
--- 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),
--- 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,
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)