# HG changeset patch # User Raimund Renkert # Date 1374046853 -7200 # Node ID 2098db2e8fbd0f4f47a4e541023e553f57e491be # Parent f4b359aa91270e5ecd90ce4938c6bffcfff0cb97 Code documentation. diff -r f4b359aa9127 -r 2098db2e8fbd src/main/java/de/intevation/lada/auth/DataAuthorization.java --- 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 Raimund Renkert +*/ @ApplicationScoped @Named("dataauthorization") public class DataAuthorization diff -r f4b359aa9127 -r 2098db2e8fbd src/main/java/de/intevation/lada/rest/LOrtService.java --- 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. diff -r f4b359aa9127 -r 2098db2e8fbd src/main/java/de/intevation/lada/rest/LProbeService.java --- 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. diff -r f4b359aa9127 -r 2098db2e8fbd src/main/java/de/intevation/lada/rest/LStatusService.java --- 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") diff -r f4b359aa9127 -r 2098db2e8fbd src/main/java/de/intevation/lada/rest/LZusatzwertService.java --- 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. * diff -r f4b359aa9127 -r 2098db2e8fbd src/main/java/de/intevation/lada/rest/OrtService.java --- 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") diff -r f4b359aa9127 -r 2098db2e8fbd src/main/java/de/intevation/lada/rest/SNetzBetreiberService.java --- 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. diff -r f4b359aa9127 -r 2098db2e8fbd src/main/java/de/intevation/lada/rest/SVerwaltungseinheitService.java --- 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. diff -r f4b359aa9127 -r 2098db2e8fbd src/main/java/de/intevation/lada/validation/LMessungValidator.java --- 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 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 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 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 warnings) diff -r f4b359aa9127 -r 2098db2e8fbd src/main/java/de/intevation/lada/validation/LMesswertValidator.java --- 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 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 warnings) diff -r f4b359aa9127 -r 2098db2e8fbd src/main/java/de/intevation/lada/validation/LOrtValidator.java --- 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 validate(Object object, boolean update) throws ValidationException { diff -r f4b359aa9127 -r 2098db2e8fbd src/main/java/de/intevation/lada/validation/LProbeValidator.java --- 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 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 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 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 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 warnings) { String uwb = probe.getUmwId(); if (uwb == null || uwb.equals("")) { diff -r f4b359aa9127 -r 2098db2e8fbd src/main/java/de/intevation/lada/validation/Validator.java --- 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 validate(Object object, boolean update) throws ValidationException; }