Package org.dspace.alerts.service
Interface SystemWideAlertService
-
- All Known Implementing Classes:
SystemWideAlertServiceImpl
public interface SystemWideAlertServiceAn interface for the SystemWideAlertService with methods regarding the SystemWideAlert workload
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleancanNonAdminUserLogin(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 sessionSystemWideAlertcreate(Context context, String message, AllowSessionsEnum allowSessionsType, Date 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 databaseSystemWideAlertfind(Context context, int alertId)This method will retrieve a SystemWideAlert object from the Database with the given IDList<SystemWideAlert>findAll(Context context)Returns a list of all SystemWideAlert objects in the databaseList<SystemWideAlert>findAll(Context context, int limit, int offset)Returns a list of all SystemWideAlert objects in the databaseList<SystemWideAlert>findAllActive(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 Detail
-
create
SystemWideAlert create(Context context, String message, AllowSessionsEnum allowSessionsType, Date 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
SystemWideAlert find(Context context, int alertId) throws SQLException
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
List<SystemWideAlert> findAll(Context context) throws SQLException
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
List<SystemWideAlert> findAll(Context context, int limit, int offset) throws SQLException
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
List<SystemWideAlert> findAllActive(Context context, int limit, int offset) throws SQLException
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
boolean canUserMaintainSession(Context context, EPerson ePerson) throws SQLException
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
boolean canNonAdminUserLogin(Context context) throws SQLException
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
-
-