← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 20052: Removed unused code

 

------------------------------------------------------------
revno: 20052
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2015-09-08 23:26:18 +0200
message:
  Removed unused code
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnitService.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnitStore.java
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/organisationunit/DefaultOrganisationUnitService.java
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/organisationunit/hibernate/HibernateOrganisationUnitStore.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/organisationunit/OrganisationUnitService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnitService.java	2015-09-08 20:58:02 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnitService.java	2015-09-08 21:26:18 +0000
@@ -132,15 +132,6 @@
     List<OrganisationUnit> getAllOrganisationUnits();
 
     /**
-     * Returns all OrganisationUnits by status.
-     *
-     * @param active Get active or inactive
-     * @return a list of all OrganisationUnits, or an empty list if
-     * there are no OrganisationUnits.
-     */
-    List<OrganisationUnit> getAllOrganisationUnitsByStatus( boolean status );
-
-    /**
      * Returns all OrganisationUnits by lastUpdated.
      *
      * @param lastUpdated OrganisationUnits from this date
@@ -150,16 +141,6 @@
     List<OrganisationUnit> getAllOrganisationUnitsByLastUpdated( Date lastUpdated );
 
     /**
-     * Returns all OrganisationUnits by status and lastUpdated.
-     *
-     * @param active      Get active or inactive
-     * @param lastUpdated OrganisationUnits from this date
-     * @return a list of all OrganisationUnits, or an empty list if
-     * there are no OrganisationUnits.
-     */
-    List<OrganisationUnit> getAllOrganisationUnitsByStatusLastUpdated( boolean status, Date lastUpdated );
-
-    /**
      * Returns all OrganisationUnits with corresponding identifiers.
      *
      * @param identifiers the collection of identifiers.
@@ -421,12 +402,8 @@
 
     List<OrganisationUnit> getOrganisationUnitsBetweenByName( String name, int first, int max );
 
-    List<OrganisationUnit> getOrganisationUnitsBetweenByStatus( boolean status, int first, int max );
-
     List<OrganisationUnit> getOrganisationUnitsBetweenByLastUpdated( Date lastUpdated, int first, int max );
 
-    List<OrganisationUnit> getOrganisationUnitsBetweenByStatusLastUpdated( boolean status, Date lastUpdated, int first, int max );
-
     Map<String, OrganisationUnit> getUuidOrganisationUnitMap();
 
     /**

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnitStore.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnitStore.java	2015-09-08 21:20:48 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnitStore.java	2015-09-08 21:26:18 +0000
@@ -76,15 +76,6 @@
     List<OrganisationUnit> getByCodes( Collection<String> codes );
 
     /**
-     * Returns all OrganisationUnits by status.
-     *
-     * @param active Get active or inactive
-     * @return a list of all OrganisationUnits, or an empty list if
-     *         there are no OrganisationUnits.
-     */
-    List<OrganisationUnit> getAllOrganisationUnitsByStatus( boolean active );
-
-    /**
      * Returns all OrganisationUnits by lastUpdated.
      *
      * @param lastUpdated OrganisationUnits from this date
@@ -94,16 +85,6 @@
     List<OrganisationUnit> getAllOrganisationUnitsByLastUpdated( Date lastUpdated );
 
     /**
-     * Returns all OrganisationUnits by status and lastUpdated.
-     *
-     * @param active      Get active or inactive
-     * @param lastUpdated OrganisationUnits from this date
-     * @return a list of all OrganisationUnits, or an empty list if
-     *         there are no OrganisationUnits.
-     */
-    List<OrganisationUnit> getAllOrganisationUnitsByStatusLastUpdated( boolean active, Date lastUpdated );
-
-    /**
      * Returns an OrganisationUnit with a given name. Case is ignored.
      *
      * @param name the name of the OrganisationUnit to return.
@@ -150,17 +131,6 @@
 
     /**
      * Retrieves the objects determined by the given first result and max result
-     * which status is like the current status.
-     *
-     * @param status the name which result object names must be like.
-     * @param first  the first result object to return.
-     * @param max    the max number of result objects to return.
-     * @return a list of objects.
-     */
-    List<OrganisationUnit> getBetweenByStatus( boolean status, int first, int max );
-
-    /**
-     * Retrieves the objects determined by the given first result and max result
      * which lastUpdated is larger or equal.
      *
      * @param lastUpdated the name which result object names must be like.
@@ -170,20 +140,6 @@
      */
     List<OrganisationUnit> getBetweenByLastUpdated( Date lastUpdated, int first, int max );
 
-
-    /**
-     * Retrieves the objects determined by the given first result and max result
-     * which status is like the current status, and lastUpdated is larger or equal.
-     *
-     * @param status      the name which result object names must be like.
-     * @param lastUpdated the name which result object names must be like.
-     * @param first       the first result object to return.
-     * @param max         the max number of result objects to return.
-     * @return a list of objects.
-     */
-    List<OrganisationUnit> getBetweenByStatusLastUpdated( boolean status, Date lastUpdated, int first, int max );
-
-
     /**
      * Retrieves the objects where its coordinate is within the 4 area points.
      * 4 area points are

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/organisationunit/DefaultOrganisationUnitService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/organisationunit/DefaultOrganisationUnitService.java	2015-09-08 20:58:02 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/organisationunit/DefaultOrganisationUnitService.java	2015-09-08 21:26:18 +0000
@@ -28,8 +28,21 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import com.google.common.collect.Maps;
-import com.google.common.collect.Sets;
+import static org.hisp.dhis.common.IdentifiableObjectUtils.getUids;
+import static org.hisp.dhis.i18n.I18nUtils.i18n;
+
+import java.awt.geom.Point2D;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
 import org.hisp.dhis.common.IdentifiableObjectUtils;
 import org.hisp.dhis.common.OrganisationUnitSelectionMode;
 import org.hisp.dhis.commons.filter.Filter;
@@ -46,20 +59,8 @@
 import org.hisp.dhis.version.VersionService;
 import org.springframework.transaction.annotation.Transactional;
 
-import java.awt.geom.Point2D;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import static org.hisp.dhis.common.IdentifiableObjectUtils.getUids;
-import static org.hisp.dhis.i18n.I18nUtils.i18n;
+import com.google.common.collect.Maps;
+import com.google.common.collect.Sets;
 
 /**
  * @author Torgeir Lorange Ostby
@@ -189,24 +190,12 @@
     }
 
     @Override
-    public List<OrganisationUnit> getAllOrganisationUnitsByStatus( boolean status )
-    {
-        return i18n( i18nService, organisationUnitStore.getAllOrganisationUnitsByStatus( status ) );
-    }
-
-    @Override
     public List<OrganisationUnit> getAllOrganisationUnitsByLastUpdated( Date lastUpdated )
     {
         return i18n( i18nService, organisationUnitStore.getAllOrganisationUnitsByLastUpdated( lastUpdated ) );
     }
 
     @Override
-    public List<OrganisationUnit> getAllOrganisationUnitsByStatusLastUpdated( boolean status, Date lastUpdated )
-    {
-        return i18n( i18nService, organisationUnitStore.getAllOrganisationUnitsByStatusLastUpdated( status, lastUpdated ) );
-    }
-
-    @Override
     public List<OrganisationUnit> getOrganisationUnits( final Collection<Integer> identifiers )
     {
         List<OrganisationUnit> objects = getAllOrganisationUnits();
@@ -730,25 +719,12 @@
     }
 
     @Override
-    public List<OrganisationUnit> getOrganisationUnitsBetweenByStatus( boolean status, int first, int max )
-    {
-        return i18n( i18nService, organisationUnitStore.getBetweenByStatus( status, first, max ) );
-    }
-
-    @Override
     public List<OrganisationUnit> getOrganisationUnitsBetweenByLastUpdated( Date lastUpdated, int first, int max )
     {
         return i18n( i18nService, organisationUnitStore.getBetweenByLastUpdated( lastUpdated, first, max ) );
     }
 
     @Override
-    public List<OrganisationUnit> getOrganisationUnitsBetweenByStatusLastUpdated( boolean status,
-        Date lastUpdated, int first, int max )
-    {
-        return i18n( i18nService, organisationUnitStore.getBetweenByStatusLastUpdated( status, lastUpdated, first, max ) );
-    }
-
-    @Override
     public Map<String, OrganisationUnit> getUuidOrganisationUnitMap()
     {
         Map<String, OrganisationUnit> map = new HashMap<>();

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/organisationunit/hibernate/HibernateOrganisationUnitStore.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/organisationunit/hibernate/HibernateOrganisationUnitStore.java	2015-09-08 21:20:48 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/organisationunit/hibernate/HibernateOrganisationUnitStore.java	2015-09-08 21:26:18 +0000
@@ -130,29 +130,12 @@
     }
 
     @Override
-    @SuppressWarnings( "unchecked" )
-    public List<OrganisationUnit> getAllOrganisationUnitsByStatus( boolean active )
-    {
-        Query query = getQuery( "from OrganisationUnit o where o.active is :active" );
-        query.setParameter( "active", active );
-
-        return query.list();
-    }
-
-    @Override
     public List<OrganisationUnit> getAllOrganisationUnitsByLastUpdated( Date lastUpdated )
     {
         return getAllGeLastUpdated( lastUpdated );
     }
 
     @Override
-    @SuppressWarnings( "unchecked" )
-    public List<OrganisationUnit> getAllOrganisationUnitsByStatusLastUpdated( boolean active, Date lastUpdated )
-    {
-        return getCriteria().add( Restrictions.ge( "lastUpdated", lastUpdated ) ).add( Restrictions.eq( "active", active ) ).list();
-    }
-
-    @Override
     public OrganisationUnit getOrganisationUnitByNameIgnoreCase( String name )
     {
         return (OrganisationUnit) getCriteria( Restrictions.eq( "name", name ).ignoreCase() ).uniqueResult();
@@ -323,17 +306,6 @@
 
     @Override
     @SuppressWarnings( "unchecked" )
-    public List<OrganisationUnit> getBetweenByStatus( boolean status, int first, int max )
-    {
-        Criteria criteria = getCriteria().add( Restrictions.eq( "active", status ) );
-        criteria.setFirstResult( first );
-        criteria.setMaxResults( max );
-
-        return criteria.list();
-    }
-
-    @Override
-    @SuppressWarnings( "unchecked" )
     public List<OrganisationUnit> getBetweenByLastUpdated( Date lastUpdated, int first, int max )
     {
         Criteria criteria = getCriteria().add( Restrictions.ge( "lastUpdated", lastUpdated ) );
@@ -345,17 +317,6 @@
 
     @Override
     @SuppressWarnings( "unchecked" )
-    public List<OrganisationUnit> getBetweenByStatusLastUpdated( boolean status, Date lastUpdated, int first, int max )
-    {
-        Criteria criteria = getCriteria().add( Restrictions.ge( "lastUpdated", lastUpdated ) ).add( Restrictions.eq( "active", status ) );
-        criteria.setFirstResult( first );
-        criteria.setMaxResults( max );
-
-        return criteria.list();
-    }
-
-    @Override
-    @SuppressWarnings( "unchecked" )
     public List<OrganisationUnit> getWithinCoordinateArea( double[] box )
     {
         return getQuery( "from OrganisationUnit o " +