changeset 263:2098db2e8fbd M1

Code documentation.
author Raimund Renkert <rrenkert@intevation.de>
date Wed, 17 Jul 2013 09:40:53 +0200
parents f4b359aa9127
children 543c2ae3bb39
files src/main/java/de/intevation/lada/auth/DataAuthorization.java src/main/java/de/intevation/lada/rest/LOrtService.java src/main/java/de/intevation/lada/rest/LProbeService.java src/main/java/de/intevation/lada/rest/LStatusService.java src/main/java/de/intevation/lada/rest/LZusatzwertService.java src/main/java/de/intevation/lada/rest/OrtService.java src/main/java/de/intevation/lada/rest/SNetzBetreiberService.java src/main/java/de/intevation/lada/rest/SVerwaltungseinheitService.java src/main/java/de/intevation/lada/validation/LMessungValidator.java src/main/java/de/intevation/lada/validation/LMesswertValidator.java src/main/java/de/intevation/lada/validation/LOrtValidator.java src/main/java/de/intevation/lada/validation/LProbeValidator.java src/main/java/de/intevation/lada/validation/Validator.java
diffstat 13 files changed, 116 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/src/main/java/de/intevation/lada/auth/DataAuthorization.java	Wed Jul 17 09:40:35 2013 +0200
+++ b/src/main/java/de/intevation/lada/auth/DataAuthorization.java	Wed Jul 17 09:40:53 2013 +0200
@@ -11,6 +11,12 @@
 import de.intevation.lada.model.LMessung;
 import de.intevation.lada.rest.Response;
 
+/**
+* This implementation of the authorization interface handles access to data
+* objects.
+*
+* @author <a href="mailto:rrenkert@intevation.de">Raimund Renkert</a>
+*/
 @ApplicationScoped
 @Named("dataauthorization")
 public class DataAuthorization
--- a/src/main/java/de/intevation/lada/rest/LOrtService.java	Wed Jul 17 09:40:35 2013 +0200
+++ b/src/main/java/de/intevation/lada/rest/LOrtService.java	Wed Jul 17 09:40:53 2013 +0200
@@ -154,7 +154,7 @@
     }
 
     /**
-     * Delete a LZusatzwert object.
+     * Delete a LOrt object.
      *
      * @param pzsId     The object id.
      * @param probeId   The LProbe id.
--- a/src/main/java/de/intevation/lada/rest/LProbeService.java	Wed Jul 17 09:40:35 2013 +0200
+++ b/src/main/java/de/intevation/lada/rest/LProbeService.java	Wed Jul 17 09:40:53 2013 +0200
@@ -111,8 +111,8 @@
      *
      * Query parameters are used for the filter in form of key-value pairs.
      * This filter can take the three parameters
-     *   mst=$MSTID (String)
-     *   uwb=$UWBID (String)
+     *   mstId=$MSTID (String)
+     *   umwId=$UWBID (String)
      *   begin=$PROBEENTNAHMEBEGIN (Timestamp)
      *
      * @param info      The URL query parameters.
@@ -197,6 +197,7 @@
 
     /**
      * Create a new LProbe object.
+     *
      * @param probe     A LProbeInfo object wrapping the LProbe object.
      * @param header    The HTTP header containing authorization information.
      * @return Response object.
--- a/src/main/java/de/intevation/lada/rest/LStatusService.java	Wed Jul 17 09:40:35 2013 +0200
+++ b/src/main/java/de/intevation/lada/rest/LStatusService.java	Wed Jul 17 09:40:53 2013 +0200
@@ -37,7 +37,7 @@
 public class LStatusService
 {
     /**
-     * The Repository for SUmwelt.
+     * The Repository for LStatus.
      */
     @Inject
     @Named("lstatusrepository")
--- a/src/main/java/de/intevation/lada/rest/LZusatzwertService.java	Wed Jul 17 09:40:35 2013 +0200
+++ b/src/main/java/de/intevation/lada/rest/LZusatzwertService.java	Wed Jul 17 09:40:53 2013 +0200
@@ -36,7 +36,7 @@
 public class LZusatzwertService
 {
     /**
-     * The Repository for SUmwelt.
+     * The Repository for LZusatzwert.
      */
     @Inject
     @Named("lzusatzwertrepository")
@@ -50,7 +50,7 @@
     private Authentication authentication;
 
     /**
-     * Request LMessert via a filter.
+     * Request LZusatzwert via a filter.
      *
      * Query parameters are used for the filter in form of key-value pairs.
      *
--- a/src/main/java/de/intevation/lada/rest/OrtService.java	Wed Jul 17 09:40:35 2013 +0200
+++ b/src/main/java/de/intevation/lada/rest/OrtService.java	Wed Jul 17 09:40:53 2013 +0200
@@ -32,7 +32,7 @@
 public class OrtService
 {
     /**
-     * The Repository for SUmwelt.
+     * The Repository for Ort.
      */
     @Inject
     @Named("ortrepository")
--- a/src/main/java/de/intevation/lada/rest/SNetzBetreiberService.java	Wed Jul 17 09:40:35 2013 +0200
+++ b/src/main/java/de/intevation/lada/rest/SNetzBetreiberService.java	Wed Jul 17 09:40:53 2013 +0200
@@ -30,7 +30,7 @@
 public class SNetzBetreiberService
 {
     /**
-     * The Repository for SDatenbasis.
+     * The Repository for SNetzBetreiber.
      */
     @Inject
     @Named("readonlyrepository")
@@ -50,7 +50,7 @@
     private Logger logger;
 
     /**
-     * Request all SNetzbetreiber objects.
+     * Request all SNetzBetreiber objects.
      *
      * @param headers   The HTTP header containing authorization information.
      * @return Response object.
@@ -73,7 +73,7 @@
     }
 
     /**
-     * Request a single SNetzbetreiber via its id.
+     * Request a single SNetzBetreiber via its id.
      *
      * @param id        The object id.
      * @param headers   The HTTP header containing authorization information.
--- a/src/main/java/de/intevation/lada/rest/SVerwaltungseinheitService.java	Wed Jul 17 09:40:35 2013 +0200
+++ b/src/main/java/de/intevation/lada/rest/SVerwaltungseinheitService.java	Wed Jul 17 09:40:53 2013 +0200
@@ -41,7 +41,7 @@
     private Authentication authentication;
 
     /**
-     * Request all SUmwelt objects.
+     * Request all SVerwaltungseinheit objects.
      *
      * @param headers   The HTTP header containing authorization information.
      * @return Response object.
@@ -61,7 +61,7 @@
     }
 
     /**
-     * Request a SUmwelt object via its id.
+     * Request a SVerwaltungseinheit object via its id.
      *
      * @param id        The object id.
      * @param headers   The HTTP header containing authorization information.
--- a/src/main/java/de/intevation/lada/validation/LMessungValidator.java	Wed Jul 17 09:40:35 2013 +0200
+++ b/src/main/java/de/intevation/lada/validation/LMessungValidator.java	Wed Jul 17 09:40:53 2013 +0200
@@ -33,6 +33,16 @@
     @Named("lmessungrepository")
     private Repository messungRepository;
 
+    /**
+     * Validate a LMessung object.
+     *
+     * @param object    The object to validate.
+     * @param update    The database operation.
+     *                  TRUE indicates that the object should be updated, FALSE
+     *                  if the object is a new Object.
+     * @return Map containing warnings.
+     * @throws ValidationException
+     */
     @Override
     public Map<String, Integer> validate(Object object, boolean update)
     throws ValidationException {
@@ -52,6 +62,13 @@
         return warnings;
     }
 
+    /**
+     * Check if the object has a 'Nebenproben Nr.'.
+     *
+     * @param messung   The LMessung object.
+     * @param warnings  The map containing warnings.
+     * @throws ValidationException
+     */
     private void validateHasNebenprobenNr(
         LMessung messung,
         Map<String, Integer> warnings)
@@ -62,6 +79,13 @@
         }
     }
 
+    /**
+     * Check if the 'Nebenproben Nr' is unique.
+     *
+     * @param messung   The LMessung object.
+     * @param warnings  The map containing warnings.
+     * @throws ValidationException
+     */
     private void validateUniqueNebenprobenNr(
         LMessung messung,
         Map<String, Integer> warnings)
@@ -85,6 +109,13 @@
         }
     }
 
+    /**
+     * Check if the 'Messdatum' is after the 'Probennahmedatum'.
+     *
+     * @param messung   The LMessung object.
+     * @param warnings  The map containing warinings. 
+     * @throws ValidationException
+     */
     private void validateDatum(
         LMessung messung,
         Map<String, Integer> warnings)
--- a/src/main/java/de/intevation/lada/validation/LMesswertValidator.java	Wed Jul 17 09:40:35 2013 +0200
+++ b/src/main/java/de/intevation/lada/validation/LMesswertValidator.java	Wed Jul 17 09:40:53 2013 +0200
@@ -13,7 +13,15 @@
 public class LMesswertValidator
 implements Validator
 {
-
+    /**
+     * Validate a LMesswert object.
+     *
+     * @param object    The LMesswert object.
+     * @param update    The database operation.
+     *                  TRUE indicates that the object should be updated, FALSE
+     *                  if the object is a new Object.
+     * @return Map containing warnings.
+     */
     @Override
     public Map<String, Integer> validate(Object object, boolean update)
     throws ValidationException {
@@ -29,6 +37,14 @@
         return null;
     }
 
+    /**
+     * Check if the LMesswert has a 'Messunsicherheit' or if the the value
+     * is lower than the 'Nachweisgrenze'.
+     *
+     * @param messwert  The LMesswert object.
+     * @param warnings  The map containing warnings.
+     * @throws ValidationException
+     */
     private void validateMessunsicherheit(
         LMesswert messwert,
         Map<String, Integer> warnings)
--- a/src/main/java/de/intevation/lada/validation/LOrtValidator.java	Wed Jul 17 09:40:35 2013 +0200
+++ b/src/main/java/de/intevation/lada/validation/LOrtValidator.java	Wed Jul 17 09:40:53 2013 +0200
@@ -13,7 +13,15 @@
 public class LOrtValidator
 implements Validator
 {
-
+    /**
+     * Validate a LOrt object.
+     *
+     * @param object    The LOrt object.
+     * @param update    The database operation.
+     *                  TRUE indicates that the object should be updated, FALSE
+     *                  if the object is a new Object.
+     * @return Map containing warnings.
+     */
     @Override
     public Map<String, Integer> validate(Object object, boolean update)
     throws ValidationException {
--- a/src/main/java/de/intevation/lada/validation/LProbeValidator.java	Wed Jul 17 09:40:35 2013 +0200
+++ b/src/main/java/de/intevation/lada/validation/LProbeValidator.java	Wed Jul 17 09:40:53 2013 +0200
@@ -37,7 +37,11 @@
     /**
      * Validate a LProbe object.
      *
-     * @param probe The LProbe object.
+     * @param probe     The LProbe object.
+     * @param update    The database operation.
+     *                  TRUE indicates that the object should be updated, FALSE
+     *                  if the object is a new Object.
+     * @return Map containing warnings.
      */
     @Override
     public Map<String, Integer> validate(Object probe, boolean update)
@@ -57,6 +61,13 @@
         return warnings;
     }
 
+    /**
+     * Check if the 'Hauptproben Nr' is unique.
+     *
+     * @param p         The LProbe object.
+     * @param warnings  The map containing warnings.
+     * @throws ValidationException
+     */
     private void validateHauptProbenNummer(LProbe p, Map<String, Integer> warnings)
     throws ValidationException {
         String hpn = p.getHauptprobenNr();
@@ -73,6 +84,12 @@
         }
     }
 
+    /**
+     * Check if the LProbe object has 'Entnahmeort'.
+     *
+     * @param probe
+     * @param warnings
+     */
     private void validateEntnahmeOrt(LProbe probe, Map<String, Integer> warnings) {
         String pid = probe.getProbeId();
 
@@ -87,6 +104,12 @@
         }
     }
 
+    /**
+     * Check if 'Probenahmeende' is after 'Probenahmebeginn'.
+     *
+     * @param probe     The LProbe object.
+     * @param warnings  The map containing warnings.
+     */
     private void validateProbenahmeBegin(LProbe probe, Map<String, Integer> warnings) {
         Date begin = probe.getProbeentnahmeBeginn();
         if (begin == null) {
@@ -97,6 +120,12 @@
         }
     }
 
+    /**
+     * Check if the LProbe object has a 'Umweltbereich'.
+     *
+     * @param probe     The LProbe object.
+     * @param warnings  The map containing warnings.
+     */
     private void validateUWB(LProbe probe, Map<String, Integer> warnings) {
         String uwb = probe.getUmwId();
         if (uwb == null || uwb.equals("")) {
--- a/src/main/java/de/intevation/lada/validation/Validator.java	Wed Jul 17 09:40:35 2013 +0200
+++ b/src/main/java/de/intevation/lada/validation/Validator.java	Wed Jul 17 09:40:53 2013 +0200
@@ -9,6 +9,16 @@
  */
 public interface Validator
 {
+    /**
+     * Validate a database object.
+     * 
+     * @param object    The object to validate.
+     * @param update    The database operation.
+     *                  TRUE indicates that the object should be updated, FALSE
+     *                  if the object is a new Object.
+     * @return Map containing warnings.
+     * @throws ValidationException
+     */
     public Map<String, Integer> validate(Object object, boolean update)
     throws ValidationException;
 }
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)