Interface SystemWideAlertService

All Known Implementing Classes:
SystemWideAlertServiceImpl

public interface SystemWideAlertService
An interface for the SystemWideAlertService with methods regarding the SystemWideAlert workload
  • 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 context
      message - The message of the system-wide alert
      allowSessionsType - Which sessions need to be allowed for the system-wide alert
      countdownTo - The date to which to count down to when the system-wide alert is active
      active - Whether the system-wide alert os active
      Returns:
      The created SystemWideAlert object
      Throws:
      SQLException - If something goes wrong
      AuthorizeException
    • 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 context
      alertId - 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 context
      limit - The limit for the amount of system-wide alerts returned
      offset - 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 context
      systemWideAlert - The SystemWideAlert object to be deleted
      Throws:
      SQLException - If something goes wrong
      IOException
      AuthorizeException
    • 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 context
      systemWideAlert - The SystemWideAlert object to be updated
      Throws:
      SQLException - If something goes wrong
      AuthorizeException
    • 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