Package core
Class StudentDataService
java.lang.Object
core.StudentDataService
- All Implemented Interfaces:
IStudentDataService
Serwis danych studentów.
-
Constructor Summary
ConstructorsConstructorDescriptionStudentDataService
(IStudentDataValidator validatorService) Konstruktor serwisu. -
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(StudentData studentData) Dodaje dane studenta.void
clear()
Kasuje załadowane dane studentów.void
Usuwa dane studenta o podanym numerze albumu.boolean
Sprawdza, czy istnieją dane studenta o podanym numerze albumu.Pobiera dane studenta na podstawie numeru albumu.getAll()
void
load
(IStudentDataPersistentStorageService preservationService) Ładuje dane studentów z serwisu danych trwałych.void
save
(IStudentDataPersistentStorageService preservationService) Zapisuje dane studentów w serwisie danych trwałych.int
size()
void
update
(StudentData studentData) Aktualizuje dane studenta o danym numerze albumu.boolean
validate
(StudentData studentData) Waliduje dane studenta.
-
Constructor Details
-
StudentDataService
Konstruktor serwisu.- Parameters:
validatorService
- Serwis walidujący.
-
-
Method Details
-
get
Pobiera dane studenta na podstawie numeru albumu.- Specified by:
get
in interfaceIStudentDataService
- Parameters:
album
- Numer albumu studenta.- Returns:
- Dane studenta.
- Throws:
Exception
- Wyjątek wyrzucany w przypadku braku numeru studenta lub błędu wyszukiwania danych.
-
size
- Specified by:
size
in interfaceIStudentDataService
- Returns:
- Liczba obiektów StudentData w bazie danych.
- Throws:
Exception
- Wyjątek w przypadku błędu połączenia z listą studentów.
-
clear
Kasuje załadowane dane studentów.- Specified by:
clear
in interfaceIStudentDataService
- Throws:
Exception
- Wyjątek w przypadku błędu komunikacji z listą studentów.
-
getAll
- Specified by:
getAll
in interfaceIStudentDataService
- Returns:
- Zwraca kopię listy studentów.
- Throws:
Exception
- Wyjątek w przypadku błędu komunikacji z listą studentów.
-
update
Aktualizuje dane studenta o danym numerze albumu.- Specified by:
update
in interfaceIStudentDataService
- Parameters:
studentData
- Dane studenta.- Throws:
Exception
- Wyjątek w przypadku błędu połączenia z listą studentów.
-
delete
Usuwa dane studenta o podanym numerze albumu.- Specified by:
delete
in interfaceIStudentDataService
- Parameters:
album
- Numer albumu.- Throws:
Exception
- Wyjątek w przypadku błędu połączenia z listą studentów.
-
exists
Sprawdza, czy istnieją dane studenta o podanym numerze albumu.- Specified by:
exists
in interfaceIStudentDataService
- Parameters:
album
- Numer albumu.- Returns:
- Prawda, jeśli istnieją dane studenta o podanym numerze albumu, fałsz w przeciwnym wypadku.
-
add
Dodaje dane studenta.- Specified by:
add
in interfaceIStudentDataService
- Parameters:
studentData
- Dane studenta.- Throws:
ValidationException
- Wyjątek w przypadku błędu połączenia z listą studentów.ValidationException
- Wyjątek w przypadku próby dodania studenta z istniejącym w bazie numerem albumu.ValidationException
- Wyjątek w przypadku próby dodania studenta z niepoprawnymi danymi.
-
save
Zapisuje dane studentów w serwisie danych trwałych.- Specified by:
save
in interfaceIStudentDataService
- Parameters:
preservationService
- Serwis przechowywania danych studenta.- Throws:
Exception
- Wyjątek w przypadku błędu połączenia z listą studentów.
-
load
Ładuje dane studentów z serwisu danych trwałych.- Specified by:
load
in interfaceIStudentDataService
- Parameters:
preservationService
- Obiekt przechowywania danych, z którego są czytane dane studentów.- Throws:
Exception
- Wyjątek w przypadku błędu połączenia z listą studentów.Exception
- Wyjątek w przypadku błędu ładowania danych z serwisu danych trwałych.
-
validate
Waliduje dane studenta.- Specified by:
validate
in interfaceIStudentDataService
- Parameters:
studentData
- Dane studenta.- Returns:
- Prawda, jeśli dane studenta są poprawne, fałsz w przeciwnym wypadku.
-