Package org.dspace.alerts
Class SystemWideAlertServiceImpl
java.lang.Object
org.dspace.alerts.SystemWideAlertServiceImpl
- All Implemented Interfaces:
SystemWideAlertService
The implementation for the
SystemWideAlertService class-
Constructor Summary
Constructors -
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
-
Constructor Details
-
SystemWideAlertServiceImpl
public SystemWideAlertServiceImpl()
-
-
Method Details
-
create
public SystemWideAlert create(Context context, String message, AllowSessionsEnum allowSessionsType, ZonedDateTime countdownTo, boolean active) throws SQLException, AuthorizeException Description copied from interface:SystemWideAlertServiceThis method will create a SystemWideAlert object in the database- Specified by:
createin interfaceSystemWideAlertService- 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
Description copied from interface:SystemWideAlertServiceThis method will retrieve a SystemWideAlert object from the Database with the given ID- Specified by:
findin interfaceSystemWideAlertService- 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
Description copied from interface:SystemWideAlertServiceReturns a list of all SystemWideAlert objects in the database- Specified by:
findAllin interfaceSystemWideAlertService- Parameters:
context- The relevant DSpace context- Returns:
- The list of all SystemWideAlert objects in the Database
- Throws:
SQLException- If something goes wrong
-
findAll
Description copied from interface:SystemWideAlertServiceReturns a list of all SystemWideAlert objects in the database- Specified by:
findAllin interfaceSystemWideAlertService- 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
public List<SystemWideAlert> findAllActive(Context context, int limit, int offset) throws SQLException Description copied from interface:SystemWideAlertServiceReturns a list of all active SystemWideAlert objects in the database- Specified by:
findAllActivein interfaceSystemWideAlertService- Parameters:
context- The relevant DSpace context- Returns:
- The list of all active SystemWideAlert objects in the database
- Throws:
SQLException- If something goes wrong
-
delete
public void delete(Context context, SystemWideAlert systemWideAlert) throws SQLException, IOException, AuthorizeException Description copied from interface:SystemWideAlertServiceThis method will delete the given SystemWideAlert object from the database- Specified by:
deletein interfaceSystemWideAlertService- Parameters:
context- The relevant DSpace contextsystemWideAlert- The SystemWideAlert object to be deleted- Throws:
SQLException- If something goes wrongIOExceptionAuthorizeException
-
update
public void update(Context context, SystemWideAlert systemWideAlert) throws SQLException, AuthorizeException Description copied from interface:SystemWideAlertServiceThis method will be used to update the given SystemWideAlert object in the database- Specified by:
updatein interfaceSystemWideAlertService- Parameters:
context- The relevant DSpace contextsystemWideAlert- The SystemWideAlert object to be updated- Throws:
SQLException- If something goes wrongAuthorizeException
-
canNonAdminUserLogin
Description copied from interface:SystemWideAlertServiceVerifies if a non admin user can log in- Specified by:
canNonAdminUserLoginin interfaceSystemWideAlertService- Parameters:
context- The relevant DSpace context- Returns:
- if a non admin user can log in
- Throws:
SQLException
-
canUserMaintainSession
Description copied from interface:SystemWideAlertServiceVerifies if the user connected to the current context can retain its session- Specified by:
canUserMaintainSessionin interfaceSystemWideAlertService- Parameters:
context- The relevant DSpace context- Returns:
- if the user connected to the current context can retain its session
- Throws:
SQLException
-