Package org.dspace.alerts.service
Interface SystemWideAlertService
- All Known Implementing Classes:
SystemWideAlertServiceImpl
public interface SystemWideAlertService
An interface for the SystemWideAlertService with methods regarding the SystemWideAlert workload
-
Method Summary
Modifier and TypeMethodDescriptionbooleancanNonAdminUserLogin(Context context) Verifies if a non admin user can log inbooleancanUserMaintainSession(Context context, EPerson ePerson) Verifies if the user connected to the current context can retain its sessioncreate(Context context, String message, AllowSessionsEnum allowSessionsType, ZonedDateTime countdownTo, boolean active) This method will create a SystemWideAlert object in the databasevoiddelete(Context context, SystemWideAlert systemWideAlert) This method will delete the given SystemWideAlert object from the databaseThis method will retrieve a SystemWideAlert object from the Database with the given IDReturns a list of all SystemWideAlert objects in the databaseReturns a list of all SystemWideAlert objects in the databasefindAllActive(Context context, int limit, int offset) Returns a list of all active SystemWideAlert objects in the databasevoidupdate(Context context, SystemWideAlert systemWideAlert) This method will be used to update the given SystemWideAlert object in the database
-
Method Details
-
create
SystemWideAlert create(Context context, String message, AllowSessionsEnum allowSessionsType, ZonedDateTime countdownTo, boolean active) throws SQLException, AuthorizeException This method will create a SystemWideAlert object in the database- Parameters:
context- The relevant DSpace contextmessage- The message of the system-wide alertallowSessionsType- Which sessions need to be allowed for the system-wide alertcountdownTo- The date to which to count down to when the system-wide alert is activeactive- Whether the system-wide alert os active- Returns:
- The created SystemWideAlert object
- Throws:
SQLException- If something goes wrongAuthorizeException
-
find
This method will retrieve a SystemWideAlert object from the Database with the given ID- Parameters:
context- The relevant DSpace contextalertId- The alert id on which we'll search for in the database- Returns:
- The system-wide alert that holds the given alert id
- Throws:
SQLException- If something goes wrong
-
findAll
Returns a list of all SystemWideAlert objects in the database- Parameters:
context- The relevant DSpace context- Returns:
- The list of all SystemWideAlert objects in the Database
- Throws:
SQLException- If something goes wrong
-
findAll
Returns a list of all SystemWideAlert objects in the database- Parameters:
context- The relevant DSpace contextlimit- The limit for the amount of system-wide alerts returnedoffset- The offset for the system-wide alerts to be returned- Returns:
- The list of all SystemWideAlert objects in the Database
- Throws:
SQLException- If something goes wrong
-
findAllActive
Returns a list of all active SystemWideAlert objects in the database- Parameters:
context- The relevant DSpace context- Returns:
- The list of all active SystemWideAlert objects in the database
- Throws:
SQLException- If something goes wrong
-
delete
void delete(Context context, SystemWideAlert systemWideAlert) throws SQLException, IOException, AuthorizeException This method will delete the given SystemWideAlert object from the database- Parameters:
context- The relevant DSpace contextsystemWideAlert- The SystemWideAlert object to be deleted- Throws:
SQLException- If something goes wrongIOExceptionAuthorizeException
-
update
void update(Context context, SystemWideAlert systemWideAlert) throws SQLException, AuthorizeException This method will be used to update the given SystemWideAlert object in the database- Parameters:
context- The relevant DSpace contextsystemWideAlert- The SystemWideAlert object to be updated- Throws:
SQLException- If something goes wrongAuthorizeException
-
canUserMaintainSession
Verifies if the user connected to the current context can retain its session- Parameters:
context- The relevant DSpace context- Returns:
- if the user connected to the current context can retain its session
- Throws:
SQLException
-
canNonAdminUserLogin
Verifies if a non admin user can log in- Parameters:
context- The relevant DSpace context- Returns:
- if a non admin user can log in
- Throws:
SQLException
-