Class UserSettingsService
java.lang.Object
org.opencastproject.adminui.usersettings.UserSettingsService
Finds the user settings and message signatures from the current user.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected DBSessionprotected DBSessionFactoryprotected javax.persistence.EntityManagerFactoryFactory used to createEntityManagers for transactionsprotected OrganizationDirectoryServiceThe organization directory servicestatic final Stringprotected SecurityServiceThe security serviceprotected UserDirectoryServiceThe user directory service -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidactivate(org.osgi.service.component.ComponentContext cc) CreatesEntityManagerFactoryusing persistence provider and properties passed via OSGi.addUserSetting(String key, String value) Create a new user setting key value pair.voiddeleteUserSetting(long id) Delete a user setting by using a unique id to find it.findUserSettings(int limit, int offset) Finds the user settings for the current user.voidsetDBSessionFactory(DBSessionFactory dbSessionFactory) voidsetEntityManagerFactory(javax.persistence.EntityManagerFactory emf) OSGi DIvoidsetOrganizationDirectoryService(OrganizationDirectoryService organizationDirectoryService) OSGi callback to set the organization directory service.voidsetSecurityService(SecurityService securityService) OSGi callback to set the security service.voidsetUserDirectoryService(UserDirectoryService userDirectoryService) OSGi callback to set user directory service.updateUserSetting(long id, String key, String value) Update a user setting that currently exists using its unique id to find it.updateUserSetting(String key, String value, String oldValue) Update a user setting that currently exists using its key to find it.
-
Field Details
-
PERSISTENCE_UNIT
- See Also:
-
emf
protected javax.persistence.EntityManagerFactory emfFactory used to createEntityManagers for transactions -
dbSessionFactory
-
db
-
userDirectoryService
The user directory service -
organizationDirectoryService
The organization directory service -
securityService
The security service
-
-
Constructor Details
-
UserSettingsService
public UserSettingsService()
-
-
Method Details
-
activate
public void activate(org.osgi.service.component.ComponentContext cc) CreatesEntityManagerFactoryusing persistence provider and properties passed via OSGi.- Parameters:
cc-
-
setEntityManagerFactory
public void setEntityManagerFactory(javax.persistence.EntityManagerFactory emf) OSGi DI -
setDBSessionFactory
-
setUserDirectoryService
OSGi callback to set user directory service.- Parameters:
userDirectoryService- user directory service
-
setSecurityService
OSGi callback to set the security service.- Parameters:
securityService- the security service
-
setOrganizationDirectoryService
public void setOrganizationDirectoryService(OrganizationDirectoryService organizationDirectoryService) OSGi callback to set the organization directory service.- Parameters:
organizationDirectoryService- the organization directory service
-
findUserSettings
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
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
Delete a user setting by using a unique id to find it.- Parameters:
id- The unique id for the user setting.- Throws:
UserSettingsServiceException
-