← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 20690: User setting service, removed unused methods

 

------------------------------------------------------------
revno: 20690
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2015-10-14 09:50:20 +0200
message:
  User setting service, removed unused methods
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/UserSettingService.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/UserSettingStore.java
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/user/DefaultUserSettingService.java
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/user/hibernate/HibernateUserSettingStore.java


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/UserSettingService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/UserSettingService.java	2015-10-14 07:46:53 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/UserSettingService.java	2015-10-14 07:50:20 +0000
@@ -113,13 +113,6 @@
     void deleteUserSetting( UserSetting userSetting );
 
     /**
-     * Removes all user settings associated with the given user.
-     *
-     * @param user the user.
-     */
-    void removeUserSettings( User user );
-
-    /**
      * Deletes the user setting with the given name.
      * 
      * @param name the name of the user setting to delete.
@@ -158,14 +151,6 @@
     List<UserSetting> getAllUserSettings( User user );
 
     /**
-     * Retrieves all UserSettings with the given name.
-     * 
-     * @param name the name.
-     * @return a List of UserSettings.
-     */
-    List<UserSetting> getUserSettings( String name );
-
-    /**
      * Returns the value of the user setting specified by the given name.
      * 
      * @param name the name of the user setting.
@@ -176,16 +161,6 @@
     Serializable getUserSetting( String name );
 
     /**
-     * Returns the value of the user setting specified by the given name.
-     * 
-     * @param name the name of the user setting.
-     * @return the value corresponding to the named user setting, or null if
-     *         there is no match.
-     * @throws NoCurrentUserException if there is no current user.
-     */
-    Serializable getUserSetting( String name, String username );
-
-    /**
      * Returns the value of the user setting specified by the given name. If
      * there is no current user or the user setting doesn't exist, the specified
      * default value is returned.

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/UserSettingStore.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/UserSettingStore.java	2015-06-16 05:11:29 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/UserSettingStore.java	2015-10-14 07:50:20 +0000
@@ -72,14 +72,6 @@
     void deleteUserSetting( UserSetting userSetting );
 
     /**
-     * Returns all UserSettings with the given name.
-     *
-     * @param name the name.
-     * @return a List of UserSettings.
-     */
-    List<UserSetting> getUserSettings( String name );
-
-    /**
      * Removes all user settings associated with the given user.
      * 
      * @param user the user.

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/user/DefaultUserSettingService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/user/DefaultUserSettingService.java	2015-10-14 07:46:53 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/user/DefaultUserSettingService.java	2015-10-14 07:50:20 +0000
@@ -135,13 +135,6 @@
     }
 
     @Override
-    public void removeUserSettings( User user )
-    {
-        userSettingStore.removeUserSettings( user );
-    }
-
-
-    @Override
     public void deleteUserSetting( String name )
     {
         User currentUser = currentUserService.getCurrentUser();
@@ -153,12 +146,6 @@
     }
     
     @Override
-    public List<UserSetting> getUserSettings( String name )
-    {
-        return userSettingStore.getUserSettings( name );
-    }
-
-    @Override
     public UserSetting getUserSetting( User user, String name )
     {
         return userSettingStore.getUserSetting( user, name );
@@ -192,14 +179,6 @@
         return getUserSetting( name, currentUser );
     }
 
-    @Override
-    public Serializable getUserSetting( String name, String username )
-    {
-        UserCredentials credentials = userService.getUserCredentialsByUsername( username );
-        
-        return getUserSetting( name, credentials == null ? null : credentials.getUserInfo() );
-    }
-
     private Serializable getUserSetting( String name, User currentUser ) 
     {
         if ( currentUser == null )

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/user/hibernate/HibernateUserSettingStore.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/user/hibernate/HibernateUserSettingStore.java	2015-06-16 05:11:29 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/user/hibernate/HibernateUserSettingStore.java	2015-10-14 07:50:20 +0000
@@ -100,17 +100,6 @@
     }
 
     @Override
-    @SuppressWarnings("unchecked")
-    public List<UserSetting> getUserSettings( String name )
-    {
-        Session session = sessionFactory.getCurrentSession();
-        Query query = session.createQuery( "from UserSetting us where us.name = :name" );
-        query.setString( "name", name );
-
-        return query.list();
-    }
-
-    @Override
     public void deleteUserSetting( UserSetting userSetting )
     {
         Session session = sessionFactory.getCurrentSession();