- java.lang.Object
-
- services.CampStudentService
-
- All Implemented Interfaces:
ICampStudentService
public class CampStudentService extends java.lang.Object implements ICampStudentService
CampStudentService
implementsICampStudentService
interface and provide camp functions in the role permission of a student
-
-
Constructor Summary
Constructors Constructor Description CampStudentService()
Construct an instance ofCampStudentService
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.ArrayList<Camp>
getAvailableCamps(Schools school)
Retrieves the available camps for a specific school.java.util.ArrayList<Camp>
getRegisteredCamps(java.lang.String studentID)
Retrieves the camps registered by a specific student.boolean
registerForCamp(java.lang.String studentID, int campID, boolean committee)
Registers a student for a specific camp.boolean
withdrawFromCamp(java.lang.String studentID, int campID)
Withdraws a student from a specific camp.
-
-
-
Constructor Detail
-
CampStudentService
public CampStudentService()
Construct an instance ofCampStudentService
-
-
Method Detail
-
getAvailableCamps
public java.util.ArrayList<Camp> getAvailableCamps(Schools school)
Description copied from interface:ICampStudentService
Retrieves the available camps for a specific school.- Specified by:
getAvailableCamps
in interfaceICampStudentService
- Parameters:
school
- The school for which available camps are to be retrieved.- Returns:
- An
ArrayList
ofCamp
s containing the available camps.
-
getRegisteredCamps
public java.util.ArrayList<Camp> getRegisteredCamps(java.lang.String studentID)
Description copied from interface:ICampStudentService
Retrieves the camps registered by a specific student.- Specified by:
getRegisteredCamps
in interfaceICampStudentService
- Parameters:
studentID
- The ID of the student for whom registered camps are to be retrieved.- Returns:
- An
ArrayList
ofCamp
s containing the registered camps.
-
registerForCamp
public boolean registerForCamp(java.lang.String studentID, int campID, boolean committee)
Description copied from interface:ICampStudentService
Registers a student for a specific camp.- Specified by:
registerForCamp
in interfaceICampStudentService
- Parameters:
studentID
- The ID of the student to be registered.campID
- The ID of the camp for registration.committee
- A boolean indicating whether the student wants to become a committee.- Returns:
true
if the registration is successful,false
otherwise.
-
withdrawFromCamp
public boolean withdrawFromCamp(java.lang.String studentID, int campID)
Description copied from interface:ICampStudentService
Withdraws a student from a specific camp.- Specified by:
withdrawFromCamp
in interfaceICampStudentService
- Parameters:
studentID
- The ID of the student to be withdrawn.campID
- The ID of the camp for withdrawal.- Returns:
true
if the withdrawal is successful,false
otherwise.
-
-