| InterceptionAssembler.java |
1 package ch.ige.edossier.web.server;
2
3 import java.util.Collection;
4 import java.util.List;
5 import org.apache.log4j.Logger;
6 import ch.ige.edossier.web.server.dao.InterceptionDAO;
7 import ch.ige.edossier.web.vo.InterceptionVO;
8
9 /**
10 * B32.03 - eDossier-Interceptions - Diplomarbeit an der Software-Schule Schweiz<br>
11 * Die Klasse InterceptionAssembler ist die Steuerklasse für die Datenaufbereitung der Beanstandungen.
12 * <p>
13 * Copyright (c) 2004, Eidgenössisches Institut für Geistiges Eigentum
14 * @author Anita Rueegsegger, Marc Bouquet
15 * @version $Id: InterceptionAssembler.java,v 1.9 2004/11/03 14:46:36 bouquet Exp $
16 */
17 public class InterceptionAssembler
18 {
19 /**
20 * Standard-Konstruktor
21 */
22 public InterceptionAssembler()
23 {}
24
25 /**
26 * Diese Methode gibt eine Liste von Interception-Value-Objects zurück.
27 * @param dossierId int Nummer zum selektieren der Datensätze
28 * @throws Exception Unerwarteter Fehler
29 * @return List Liste mit Interceptions-Value-Objects
30 */
31 public List getInterceptions( int dossierId ) throws Exception
32 {
33 return new InterceptionDAO().selectByDossier( dossierId );
34 }
35
36 /**
37 * Diese Methode gibt ein Value-Object einer Beanstandung zurück.
38 * @param interceptionId int Nummer zum selektieren des Datensatzes
39 * @throws Exception Unerwarteter Fehler
40 * @return InterceptionVO Value-Object
41 */
42 public InterceptionVO getInterception( int interceptionId ) throws Exception
43 {
44 return new InterceptionDAO().select( interceptionId );
45 }
46
47 /**
48 * Diese Methode liest alle neuen Interceptions des heutigen Tages aus.
49 * @param today String Datum des heutigen Tages
50 * @throws Exception Unerwarteter Fehler
51 * @return Collection mit Newsletter-Value-Objects
52 */
53 public Collection getNewInterceptions( String today ) throws Exception
54 {
55 return new InterceptionDAO().newInterception( today );
56 }
57
58 /**
59 * Mit dieser Methode wird der Status der Beanstandung mit dem übergebenen Wert gesetzt.
60 * @param interceptionId int Nummer zum selektieren des Datensatzes
61 * @param status int Status der in die Datenbank geschrieben wird
62 * @throws Exception Unerwarteter Fehler
63 * @return boolean true = Status wurde aktualisiert, false = Status konnte nicht aktualisiert werden
64 */
65 public boolean setState(int interceptionId, int status) throws Exception
66 {
67 return new InterceptionDAO().update( interceptionId, status );
68 }
69 }
70 | InterceptionAssembler.java |