Class UserSettingsService

java.lang.Object
org.opencastproject.adminui.usersettings.UserSettingsService

public class UserSettingsService extends Object
Finds the user settings and message signatures from the current user.
  • Field Details

    • PERSISTENCE_UNIT

      public static final String PERSISTENCE_UNIT
      See Also:
    • emf

      protected javax.persistence.EntityManagerFactory emf
      Factory used to create EntityManagers for transactions
    • dbSessionFactory

      protected org.opencastproject.db.DBSessionFactory dbSessionFactory
    • db

      protected org.opencastproject.db.DBSession db
    • userDirectoryService

      protected org.opencastproject.security.api.UserDirectoryService userDirectoryService
      The user directory service
    • organizationDirectoryService

      protected org.opencastproject.security.api.OrganizationDirectoryService organizationDirectoryService
      The organization directory service
    • securityService

      protected org.opencastproject.security.api.SecurityService securityService
      The security service
  • Constructor Details

    • UserSettingsService

      public UserSettingsService()
  • Method Details

    • activate

      public void activate(org.osgi.service.component.ComponentContext cc)
      Creates EntityManagerFactory using persistence provider and properties passed via OSGi.
      Parameters:
      cc -
    • setEntityManagerFactory

      public void setEntityManagerFactory(javax.persistence.EntityManagerFactory emf)
      OSGi DI
    • setDBSessionFactory

      public void setDBSessionFactory(org.opencastproject.db.DBSessionFactory dbSessionFactory)
    • setUserDirectoryService

      public void setUserDirectoryService(org.opencastproject.security.api.UserDirectoryService userDirectoryService)
      OSGi callback to set user directory service.
      Parameters:
      userDirectoryService - user directory service
    • setSecurityService

      public void setSecurityService(org.opencastproject.security.api.SecurityService securityService)
      OSGi callback to set the security service.
      Parameters:
      securityService - the security service
    • setOrganizationDirectoryService

      public void setOrganizationDirectoryService(org.opencastproject.security.api.OrganizationDirectoryService organizationDirectoryService)
      OSGi callback to set the organization directory service.
      Parameters:
      organizationDirectoryService - the organization directory service
    • findUserSettings

      public UserSettings findUserSettings(int limit, int offset) throws UserSettingsServiceException
      Finds the user settings for the current user.
      Parameters:
      limit - The maximum limit of results to return.
      offset - The starting page offset.
      Returns:
      The user settings for the current user.
      Throws:
      UserSettingsServiceException
    • addUserSetting

      public UserSetting addUserSetting(String key, String value) throws UserSettingsServiceException
      Create a new user setting key value pair.
      Parameters:
      key - The key to use for the current user setting.
      value - The value of the user setting.
      Returns:
      A new user setting object
      Throws:
      UserSettingsServiceException
    • updateUserSetting

      public UserSetting updateUserSetting(String key, String value, String oldValue) throws UserSettingsServiceException
      Update a user setting that currently exists using its key to find it.
      Parameters:
      key - The key for the user setting.
      value - The new value to set for the user setting.
      Returns:
      An updated UserSetting
      Throws:
      UserSettingsServiceException
    • updateUserSetting

      public UserSetting updateUserSetting(long id, String key, String value) throws UserSettingsServiceException
      Update a user setting that currently exists using its unique id to find it.
      Parameters:
      id - The id for the user setting.
      key - The key for the user setting.
      value - The value for the user setting.
      Returns:
      The updated UserSetting.
      Throws:
      UserSettingsServiceException
    • deleteUserSetting

      public void deleteUserSetting(long id) throws UserSettingsServiceException
      Delete a user setting by using a unique id to find it.
      Parameters:
      id - The unique id for the user setting.
      Throws:
      UserSettingsServiceException