Class DokumentService
- java.lang.Object
-
- de.fhdw.hfw417.dokumentenpostfach.service.DokumentService
-
-
Constructor Summary
Constructors Constructor Description DokumentService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Dokument
fuegeDokumentHinzu(DokumentEinstellenDTO dokumentEinstellenDTO, Principal userPrincipal)
Speichert das uebergebeneDokument
-Objekt in der Datenbank.List<Dokument>
getAllDokumente(Principal userPrincipal)
Liefert alle in der Datenbank gespeichertenDokument
-Objekte zum uebergebenen Benutzer.Dokument
getDocumentByID(String id, Principal userPrincipal)
Liefert dasDokument
-Objekt mit der angegebenen id.
-
-
-
Method Detail
-
fuegeDokumentHinzu
@Transactional(rollbackFor=DokumentValidierungException.class, isolation=SERIALIZABLE, propagation=REQUIRED) public Dokument fuegeDokumentHinzu(DokumentEinstellenDTO dokumentEinstellenDTO, Principal userPrincipal) throws PortalDocException
Speichert das uebergebeneDokument
-Objekt in der Datenbank.- Parameters:
dokumentEinstellenDTO
- Das DokumentEinstellenDTO.userPrincipal
- Die Benutzerprivilegien.- Returns:
- das hinzugefuegte Objekt.
- Throws:
PortalDocException
- wird geworfen, wenn ein Fehler aufgetreten ist.
-
getAllDokumente
@Transactional(isolation=SERIALIZABLE, propagation=REQUIRED) public List<Dokument> getAllDokumente(Principal userPrincipal) throws PortalDocException
Liefert alle in der Datenbank gespeichertenDokument
-Objekte zum uebergebenen Benutzer.- Parameters:
userPrincipal
- Die Benutzerprivilegien.- Returns:
- Liste von Dokument-Objekten.
- Throws:
PortalDocException
- Fehlermeldung.
-
getDocumentByID
public Dokument getDocumentByID(String id, Principal userPrincipal) throws PortalDocException
Liefert dasDokument
-Objekt mit der angegebenen id. Falls keine Dokument die angegebene ID hat, wird eineDokumentNichtGefundenException
geworfen.- Parameters:
id
- Identifikationsnummer des gesuchten DokumentsuserPrincipal
- Die Benutzerprivilegien.- Returns:
- Das Dokument-Objekt.
- Throws:
PortalDocException
- Fehlermeldung.
-
-