=== removed directory 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/aggregation' === removed file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/aggregation/AggregatedDataValue.java' --- dhis-2/dhis-api/src/main/java/org/hisp/dhis/aggregation/AggregatedDataValue.java 2015-01-17 07:41:26 +0000 +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/aggregation/AggregatedDataValue.java 1970-01-01 00:00:00 +0000 @@ -1,195 +0,0 @@ -package org.hisp.dhis.aggregation; - -/* - * Copyright (c) 2004-2015, University of Oslo - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * Neither the name of the HISP project nor the names of its contributors may - * be used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -import org.hisp.dhis.common.AggregatedValue; - -/** - * @author Lars Helge Overland - */ -public class AggregatedDataValue - extends AggregatedValue -{ - private int dataElementId; - - private int categoryOptionComboId; - - private transient String dataElementName; - - // ---------------------------------------------------------------------- - // Constructors - // ---------------------------------------------------------------------- - - public AggregatedDataValue() - { - } - - /** - * @param dataElementId data element id - * @param categoryOptionComboId category option combo id - * @param periodId period id - * @param periodTypeId period type id - * @param organisationUnitId organisation unit id - * @param level level level - * @param value value value - */ - public AggregatedDataValue( int dataElementId, int categoryOptionComboId, int periodId, - int periodTypeId, int organisationUnitId, int level, double value ) - { - this.dataElementId = dataElementId; - this.categoryOptionComboId = categoryOptionComboId; - this.periodId = periodId; - this.periodTypeId = periodTypeId; - this.organisationUnitId = organisationUnitId; - this.level = level; - this.value = value; - } - - /** - * @param dataElementId data element id - * @param categoryOptionComboId category option combo id - * @param periodId period id - * @param periodTypeId period type id - * @param organisationUnitId organisation unit id - * @param organisationUnitGroupId organisation unit group id - * @param level level - * @param value value - */ - public AggregatedDataValue( int dataElementId, int categoryOptionComboId, int periodId, - int periodTypeId, int organisationUnitId, int organisationUnitGroupId, int level, double value ) - { - this.dataElementId = dataElementId; - this.categoryOptionComboId = categoryOptionComboId; - this.periodId = periodId; - this.periodTypeId = periodTypeId; - this.organisationUnitId = organisationUnitId; - this.organisationUnitGroupId = organisationUnitGroupId; - this.level = level; - this.value = value; - } - - // ---------------------------------------------------------------------- - // Logic - // ---------------------------------------------------------------------- - - public void clear() - { - this.dataElementId = 0; - this.categoryOptionComboId = 0; - this.periodId = 0; - this.periodTypeId = 0; - this.organisationUnitId = 0; - this.level = 0; - this.value = 0.0; - } - - @Override - public int getElementId() - { - return dataElementId; - } - - // ---------------------------------------------------------------------- - // Getters and setters - // ---------------------------------------------------------------------- - - public int getDataElementId() - { - return dataElementId; - } - - public void setDataElementId( int dataElementId ) - { - this.dataElementId = dataElementId; - } - - public int getCategoryOptionComboId() - { - return categoryOptionComboId; - } - - public void setCategoryOptionComboId( int categoryOptionComboId ) - { - this.categoryOptionComboId = categoryOptionComboId; - } - - public String getDataElementName() - { - return dataElementName; - } - - public void setDataElementName( String dataElementName ) - { - this.dataElementName = dataElementName; - } - - // ---------------------------------------------------------------------- - // hashCode and equals - // ---------------------------------------------------------------------- - - @Override - public String toString() - { - return - "[Data element: " + dataElementId + - " option combo: " + categoryOptionComboId + - " period: " + periodId + - " org unit: " + organisationUnitId + - " org unit group: " + organisationUnitGroupId + - " value: " + value + "]"; - } - - @Override - public int hashCode() - { - return dataElementId * periodId * organisationUnitId * organisationUnitGroupId * 17; - } - - @Override - public boolean equals( Object object ) - { - if ( this == object ) - { - return true; - } - - if ( object == null || !( object instanceof AggregatedDataValue ) ) - { - return false; - } - - AggregatedDataValue that = (AggregatedDataValue) object; - - return this.dataElementId == that.getDataElementId() && - this.categoryOptionComboId == that.getCategoryOptionComboId() && - this.periodId == that.getPeriodId() && - this.organisationUnitId == that.getOrganisationUnitId() && - this.organisationUnitGroupId == that.getOrganisationUnitGroupId(); - } -} === removed file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/aggregation/AggregatedDataValueService.java' --- dhis-2/dhis-api/src/main/java/org/hisp/dhis/aggregation/AggregatedDataValueService.java 2015-06-16 05:11:29 +0000 +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/aggregation/AggregatedDataValueService.java 1970-01-01 00:00:00 +0000 @@ -1,302 +0,0 @@ -package org.hisp.dhis.aggregation; - -/* - * Copyright (c) 2004-2015, University of Oslo - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * Neither the name of the HISP project nor the names of its contributors may - * be used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -import java.util.Collection; -import java.util.List; - -import org.hisp.dhis.completeness.DataSetCompletenessResult; -import org.hisp.dhis.dataelement.DataElement; -import org.hisp.dhis.dataelement.DataElementCategoryOption; -import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo; -import org.hisp.dhis.indicator.Indicator; -import org.hisp.dhis.organisationunit.OrganisationUnit; -import org.hisp.dhis.organisationunit.OrganisationUnitLevel; -import org.hisp.dhis.period.Period; - -/** - * @author Lars Helge Overland - */ -public interface AggregatedDataValueService -{ - String ID = AggregatedDataValueService.class.getName(); - - // ---------------------------------------------------------------------- - // AggregatedDataValue - // ---------------------------------------------------------------------- - - /** - * Gets the total aggregated value from the datamart table for the given parameters. - * - * @param dataElement The DataElement identifier. - * @param period The Period identifier. - * @param organisationUnit The OrganisationUnit identifier. - * @return the aggregated value. - */ - Double getAggregatedDataValue( int dataElement, int period, int organisationUnit ); - - /** - * Gets the total aggregated value from the datamart table for the given parameters. - * - * @param dataElement The DataElement. - * @param period The Period. - * @param organisationUnit The OrganisationUnit. - * @return the aggregated value. - */ - Double getAggregatedValue( DataElement dataElement, Period period, OrganisationUnit organisationUnit ); - - /** - * Gets the total aggregated value from the datamart table for the given parameters. - * - * @param dataElement The DataElement identifier. - * @param dimensionOptionElement the DimensionOptionElement identifier. - * @param period The Period identifier. - * @param organisationUnit The OrganisationUnit identifier. - * @return the aggregated value. - */ - Double getAggregatedDataValue( int dataElement, int categoryOptionCombo, int period, int organisationUnit ); - - /** - * Gets the total aggregated value from the datamart table for the given parameters. - * - * @param dataElement The DataElement. - * @param categoryOption the DataElementCategoryOption. - * @param period The Period. - * @param organisationUnit The OrganisationUnit. - * @return the aggregated value. - */ - Double getAggregatedValue( DataElement dataElement, DataElementCategoryOption categoryOption, Period period, OrganisationUnit organisationUnit ); - - /** - * Gets the aggregated value from the datamart table for the given parameters. - * - * @param dataElement The DataElement. - * @param categoryOptionCombo The DataElementCategoryOptionCombo. - * @param period The Period. - * @param organisationUnit The OrganisationUnit. - * @return the aggregated value, or -1 if no value exists. - */ - Double getAggregatedValue( DataElement dataElement, DataElementCategoryOptionCombo categoryOptionCombo, Period period, OrganisationUnit organisationUnit ); - - /** - * Gets the aggregated value from the datamart table for the given parameters. - * - * @param dataElement The DataElement identifier. - * @param categoryOptionCombo The DataElementCategoryOptionCombo identifier. - * @param periods The collection of Periods. - * @param organisationUnit The OrganisationUnit identifier. - * @return the aggregated value. - */ - Double getAggregatedValue( int dataElement, int categoryOptionCombo, Collection periodIds, int organisationUnit ); - - /** - * Gets a collection of AggregatedDataValues. - * - * @param periodIds the collection of Period identifiers. - * @param organisationUnitIds the collection of OrganisationUnit identifiers. - * @return a collection of AggregatedDataValues. - */ - List getAggregatedDataValues( Collection periodIds, Collection organisationUnitIds ); - - /** - * Gets a collection of AggregatedDataValues where the value is the sum of - * all category option combos for the data element. 0 is set as - * categoryoptioncombo identifier value on the AggregatedDataValues. - * - * @param periodIds the collection of Period identifiers. - * @param organisationUnitIds the collection of OrganisationUnit identifiers. - * @return a collection of AggregatedDataValues. - */ - List getAggregatedDataValueTotals( Collection periodIds, Collection organisationUnitIds ); - - /** - * Gets a collection of AggregatedDataValues. - * - * @param dataElementId the DataElement identifier. - * @param periodIds the collection of Period identifiers. - * @param organisationUnitIds the collection of OrganisationUnit identifiers. - * @return a collection of AggregatedDataValues. - */ - List getAggregatedDataValues( int dataElementId, Collection periodIds, Collection organisationUnitIds ); - - /** - * Gets a collection of AggregatedDataValues. - * - * @param dataElementIds the collection of DataElement identifiers. - * @param periodIds the collection of Period identifiers. - * @param organisationUnitIds the collection of OrganisationUnit identifiers. - * @return a collection of AggregatedDataValues. - */ - List getAggregatedDataValues( Collection dataElementIds, Collection periodIds, Collection organisationUnitIds ); - - /** - * Gets a collection of AggregatedDataValues where the value is the sum of - * all category option combos for the data element. 0 is set as - * categoryoptioncombo identifier value on the AggregatedDataValues. - * - * @param dataElementIds the collection of DataElement identifiers. - * @param periodIds the collection of Period identifiers. - * @param organisationUnitIds the collection of OrganisationUnit identifiers. - * @return a collection of AggregatedDataValues. - */ - List getAggregatedDataValueTotals( Collection dataElementIds, Collection periodIds, Collection organisationUnitIds ); - - /** - * Deletes AggregatedDataValues registered for the given parameters. - * - * @param dataElementIds a collection of DataElement identifiers. - * @param periodIds a collection of Period identifiers. - * @param organisationUnitIds a collection of OrganisationUnit identifiers. - */ - void deleteAggregatedDataValues( Collection dataElementIds, Collection periodIds, - Collection organisationUnitIds ); - - /** - * Deletes all AggregatedDataValues. - * - * @return the number of deleted AggregatedDataValues. - */ - void deleteAggregatedDataValues(); - - /** - * Returns agg data values for children of an orgunit at a particular level - * @param orgunit the root organisationunit - * @param level the level to retrieve values at - * @param periods the periods to retrieve values for - * @return an iterator type object for retrieving the values - */ - public StoreIterator getAggregateDataValuesAtLevel(OrganisationUnit orgunit, OrganisationUnitLevel level, Collection periods); - - /** - * Returns count of agg data values for children of an orgunit at a particular level - * @param orgunit the root organisationunit - * @param level the level to retrieve values at - * @param periods the periods to retrieve values for - * @return an iterator type object for retrieving the values - */ - public int countDataValuesAtLevel( OrganisationUnit orgunit, OrganisationUnitLevel level, Collection periods ); - - // ---------------------------------------------------------------------- - // AggregatedIndicatorValue - // ---------------------------------------------------------------------- - - /** - * Gets the aggregated value from the datamart table for the given parameters. - * - * @param indicator The Indicator. - * @param period The Period. - * @param organisationUnit The OrganisationUnit. - * @return the aggregated value, or -1 if no value exists. - */ - Double getAggregatedValue( Indicator indicator, Period period, OrganisationUnit organisationUnit ); - - /** - * Gets a collection of AggregatedIndicatorValues. - * - * @param periodIds the Period identifiers. - * @param organisationUnitIds the OrganisationUnit identifiers. - * @return a collection of AggregatedIndicatorValues. - */ - List getAggregatedIndicatorValues( Collection periodIds, Collection organisationUnitIds ); - - /** - * Gets a collection of AggregatedIndicatorValues. - * - * @param indicatorIds the Indicator identifiers. - * @param periodIds the Period identifiers. - * @param organisationUnitIds the OrganisationUnit identifiers. - * @return a collection of AggregatedIndicatorValues. - */ - List getAggregatedIndicatorValues( Collection indicatorIds, - Collection periodIds, Collection organisationUnitIds ); - - /** - * Deletes AggregatedIndicatorValue registered for the given parameters. - * - * @param indicatorIds a collection of Indicator identifiers. - * @param periodIds a collection of Period identifiers. - * @param organisationUnitIds a collection of OrganisationUnit identifiers. - */ - void deleteAggregatedIndicatorValues( Collection indicatorIds, Collection periodIds, - Collection organisationUnitIds ); - - /** - * Deletes all AggregatedIndicatorValue. - * - * @return the number of deleted AggregatedIndicatorValues. - */ - void deleteAggregatedIndicatorValues(); - - /** - * Returns agg indicator values for children of an orgunit at a particular level - * @param orgunit the root organisationunit - * @param level the level to retrieve values at - * @param periods the periods to retrieve values for - * @return an iterator type object for retrieving the values - */ - public StoreIterator getAggregateIndicatorValuesAtLevel(OrganisationUnit orgunit, OrganisationUnitLevel level, Collection periods); - - /** - * Returns count of agg indicator values for children of an orgunit at a particular level - * @param orgunit the root organisationunit - * @param level the level to retrieve values at - * @param periods the periods to retrieve values for - * @return an iterator type object for retrieving the values - */ - public int countIndicatorValuesAtLevel( OrganisationUnit orgunit, OrganisationUnitLevel level, Collection periods ); - - // ---------------------------------------------------------------------- - // AggregatedDataSetCompleteness - // ---------------------------------------------------------------------- - - /** - * Gets a collection of DataSetCompletenessResult. Populates the data set id, - * period id, organisation unit id and value properties. - * - * @param dataSetIds a collection of DataSet identifiers. - * @param periodIds a collection of Period identifiers. - * @param organisationUnitIds a collection of OrganisationUnit identifiers. - */ - List getAggregatedDataSetCompleteness( Collection dataSetIds, Collection periodIds, - Collection organisationUnitIds ); - - // ---------------------------------------------------------------------- - // Data mart - // ---------------------------------------------------------------------- - - /** - * Drops all data mart tables. - */ - void dropDataMart(); - - /** - * Creates all data mart tables. - */ - void createDataMart(); -} === removed file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/aggregation/AggregatedDataValueStore.java' --- dhis-2/dhis-api/src/main/java/org/hisp/dhis/aggregation/AggregatedDataValueStore.java 2015-06-16 05:11:29 +0000 +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/aggregation/AggregatedDataValueStore.java 1970-01-01 00:00:00 +0000 @@ -1,280 +0,0 @@ -package org.hisp.dhis.aggregation; - -/* - * Copyright (c) 2004-2015, University of Oslo - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * Neither the name of the HISP project nor the names of its contributors may - * be used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -import java.util.Collection; -import java.util.List; - -import org.hisp.dhis.completeness.DataSetCompletenessResult; -import org.hisp.dhis.dataelement.DataElement; -import org.hisp.dhis.dataelement.DataElementCategoryOption; -import org.hisp.dhis.organisationunit.OrganisationUnit; -import org.hisp.dhis.organisationunit.OrganisationUnitLevel; -import org.hisp.dhis.period.Period; - -/** - * @author Lars Helge Overland - */ -public interface AggregatedDataValueStore -{ - String ID = AggregatedDataValueStore.class.getName(); - - // ---------------------------------------------------------------------- - // AggregatedDataValue - // ---------------------------------------------------------------------- - - /** - * Gets the total aggregated value from the datamart table for the given parameters. - * - * @param dataElement The DataElement identifier. - * @param period The Period identifier. - * @param organisationUnit The OrganisationUnit identifier. - * @return the aggregated value. - */ - Double getAggregatedDataValue( int dataElement, int period, int organisationUnit ); - - /** - * Gets the aggregated value from the datamart table for the given parameters. - * - * @param dataElement The DataElement. - * @param categoryOptionCombo The DataElementCategoryOptionCombo. - * @param period The Period. - * @param organisationUnit The OrganisationUnit. - * @return the aggregated value, or -1 if no value exists. - */ - Double getAggregatedDataValue( int dataElement, int categoryOptionCombo, int period, int organisationUnit ); - - /** - * Gets the total aggregated value from the datamart table for the given parameters. - * - * @param dataElement The DataElement. - * @param categoryOption the DataElementCategoryOption. - * @param period The Period. - * @param organisationUnit The OrganisationUnit. - * @return the aggregated value. - */ - Double getAggregatedDataValue( DataElement dataElement, DataElementCategoryOption categoryOption, Period period, OrganisationUnit organisationUnit ); - - /** - * Gets the aggregated value from the datamart table for the given parameters. - * - * @param dataElement The DataElement identifier. - * @param categoryOptionCombo The DataElementCategoryOptionCombo identifier. - * @param periods The collection of Periods. - * @param organisationUnit The OrganisationUnit identifier. - * @return the aggregated value. - */ - Double getAggregatedDataValue( int dataElement, int categoryOptionCombo, Collection periodIds, int organisationUnit ); - - /** - * Gets a collection of AggregatedDataValues. - * - * @param periodIds the collection of Period identifiers. - * @param organisationUnitIds the collection of OrganisationUnit identifiers. - * @return a list of AggregatedDataValues. - */ - List getAggregatedDataValues( Collection periodIds, Collection organisationUnitIds ); - - /** - * Gets a collection of AggregatedDataValues where the value is the sum of - * all category option combos for the data element. 0 is set as - * categoryoptioncombo identifier value on the AggregatedDataValues. - * - * @param periodIds the collection of Period identifiers. - * @param organisationUnitIds the collection of OrganisationUnit identifiers. - * @return a list of AggregatedDataValues. - */ - List getAggregatedDataValueTotals( Collection periodIds, Collection organisationUnitIds ); - - /** - * Gets a collection of AggregatedDataValues. - * - * @param dataElementId the DataElement identifier. - * @param periodIds the collection of Period identifiers. - * @param organisationUnitIds the collection of OrganisationUnit identifiers. - * @return a list of AggregatedDataValues. - */ - List getAggregatedDataValues( int dataElementId, Collection periodIds, Collection organisationUnitIds ); - - /** - * Gets a collection of AggregatedDataValues. - * - * @param dataElementIds the collection of DataElement identifiers. - * @param periodIds the collection of Period identifiers. - * @param organisationUnitIds the collection of OrganisationUnit identifiers. - * @return a list of AggregatedDataValues. - */ - List getAggregatedDataValues( Collection dataElementIds, Collection periodIds, Collection organisationUnitIds ); - - /** - * Gets a collection of AggregatedDataValues where the value is the sum of - * all category option combos for the data element. 0 is set as - * categoryoptioncombo identifier value on the AggregatedDataValues. - * - * @param dataElementIds the collection of DataElement identifiers. - * @param periodIds the collection of Period identifiers. - * @param organisationUnitIds the collection of OrganisationUnit identifiers. - * @return a list of AggregatedDataValues. - */ - List getAggregatedDataValueTotals( Collection dataElementIds, Collection periodIds, Collection organisationUnitIds ); - - /** - * Deletes AggregatedDataValues registered for the given parameters. - * - * @param dataElementIds a collection of DataElement identifiers. - * @param periodIds a collection of Period identifiers. - * @param organisationUnitIds a collection of OrganisationUnit identifiers. - */ - void deleteAggregatedDataValues( Collection dataElementIds, Collection periodIds, - Collection organisationUnitIds ); - - /** - * Deletes all AggregatedDataValues. - * - * @return the number of deleted AggregatedDataValues. - */ - void deleteAggregatedDataValues(); - - /** - * Returns values for children of an orgunit at a particular level - * @param orgunit the root organisationunit - * @param level the level to retrieve values at - * @param periods the period to retrieve values for - * @return an iterator type object for retrieving the values - */ - public StoreIterator getAggregatedDataValuesAtLevel(OrganisationUnit orgunit, OrganisationUnitLevel level, Collection periods); - - /** - * Returns count of agg data values for children of an orgunit at a particular level - * @param orgunit the root organisationunit - * @param level the level to retrieve values at - * @param periods the periods to retrieve values for - * @return an iterator type object for retrieving the values - */ - public int countDataValuesAtLevel( OrganisationUnit orgunit, OrganisationUnitLevel level, Collection periods ); - - // ---------------------------------------------------------------------- - // AggregatedIndicatorValue - // ---------------------------------------------------------------------- - - /** - * Gets the aggregated value from the datamart table for the given parameters. - * - * @param indicator The Indicator identifier. - * @param period The Period identifier. - * @param organisationUnit The OrganisationUnit identifier. - * @return the aggregated value, or -1 if no value exists. - */ - Double getAggregatedIndicatorValue( int indicator, int period, int organisationUnit ); - - /** - * Gets a collection of AggregatedIndicatorValues. - * - * @param periodIds the Period identifiers. - * @param organisationUnitIds the OrganisationUnit identifiers. - * @return a list of AggregatedIndicatorValues. - */ - List getAggregatedIndicatorValues( Collection periodIds, Collection organisationUnitIds ); - - /** - * Gets a collection of AggregatedIndicatorValues. - * - * @param indicatorIds the Indicator identifiers. - * @param periodIds the Period identifiers. - * @param organisationUnitIds the OrganisationUnit identifiers. - * @return a list of AggregatedIndicatorValues. - */ - List getAggregatedIndicatorValues( Collection indicatorIds, - Collection periodIds, Collection organisationUnitIds ); - - /** - * Deletes AggregatedIndicatorValue registered for the given parameters. - * - * @param indicatorIds a collection of Indicator identifiers. - * @param periodIds a collection of Period identifiers. - * @param organisationUnitIds a collection of OrganisationUnit identifiers. - */ - void deleteAggregatedIndicatorValues( Collection indicatorIds, Collection periodIds, - Collection organisationUnitIds ); - - /** - * Deletes all AggregatedIndicatorValue. - * - * @return the number of deleted AggregatedIndicatorValues. - */ - void deleteAggregatedIndicatorValues(); - - - /** - * Returns values for children of an orgunit at a particular level - * @param orgunit the root organisationunit - * @param level the level to retrieve values at - * @param periods the period to retrieve values for - * @return an iterator type object for retrieving the values - */ - public StoreIterator getAggregatedIndicatorValuesAtLevel(OrganisationUnit orgunit, OrganisationUnitLevel level, Collection periods); - - /** - * Returns count of agg indicator values for children of an orgunit at a particular level - * @param orgunit the root organisationunit - * @param level the level to retrieve values at - * @param periods the periods to retrieve values for - * @return an iterator type object for retrieving the values - */ - public int countIndicatorValuesAtLevel( OrganisationUnit orgunit, OrganisationUnitLevel level, Collection periods ); - - // ---------------------------------------------------------------------- - // AggregatedDataSetCompleteness - // ---------------------------------------------------------------------- - - /** - * Gets a collection of DataSetCompletenessResult. Populates the data set id, - * period id, organisation unit id and value properties. - * - * @param dataSetIds a collection of DataSet identifiers. - * @param periodIds a collection of Period identifiers. - * @param organisationUnitIds a collection of OrganisationUnit identifiers. - */ - List getAggregatedDataSetCompleteness( Collection dataSetIds, Collection periodIds, - Collection organisationUnitIds ); - - // ---------------------------------------------------------------------- - // Data mart - // ---------------------------------------------------------------------- - - /** - * Drops all data mart tables. - */ - void dropDataMart(); - - /** - * Creates all data mart tables. - */ - void createDataMart(); -} === removed file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/aggregation/AggregatedIndicatorValue.java' --- dhis-2/dhis-api/src/main/java/org/hisp/dhis/aggregation/AggregatedIndicatorValue.java 2015-01-17 07:41:26 +0000 +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/aggregation/AggregatedIndicatorValue.java 1970-01-01 00:00:00 +0000 @@ -1,253 +0,0 @@ -package org.hisp.dhis.aggregation; - -/* - * Copyright (c) 2004-2015, University of Oslo - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * Neither the name of the HISP project nor the names of its contributors may - * be used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -import org.hisp.dhis.common.AggregatedValue; - -/** - * @author Lars Helge Overland - */ -public class AggregatedIndicatorValue - extends AggregatedValue -{ - private int indicatorId; - - private String annualized; - - private double factor; - - private double numeratorValue; - - private double denominatorValue; - - private transient String indicatorName; - - // ---------------------------------------------------------------------- - // Constructors - // ---------------------------------------------------------------------- - - public AggregatedIndicatorValue() - { - } - - /** - * @param indicatorId indicator id - * @param periodId period id - * @param periodTypeId period type id - * @param organisationUnitId organisation unit id - * @param level level - * @param factor factor - * @param value value - * @param numeratorValue numerator value - * @param denominatorValue denominator value - */ - public AggregatedIndicatorValue( int indicatorId, int periodId, int periodTypeId, int organisationUnitId, - int level, String annualized, double factor, double value, double numeratorValue, double denominatorValue ) - { - this.indicatorId = indicatorId; - this.periodId = periodId; - this.periodTypeId = periodTypeId; - this.organisationUnitId = organisationUnitId; - this.level = level; - this.annualized = annualized; - this.factor = factor; - this.value = value; - this.numeratorValue = numeratorValue; - this.denominatorValue = denominatorValue; - } - - /** - * @param indicatorId indicator id - * @param periodId period id - * @param periodTypeId period type id - * @param organisationUnitId organisation unit id - * @param organisationUnitGroupId organisation unit group id - * @param level level - * @param factor factor - * @param value value - * @param numeratorValue numerator value - * @param denominatorValue denominator value - */ - public AggregatedIndicatorValue( int indicatorId, int periodId, int periodTypeId, int organisationUnitId, - int organisationUnitGroupId, int level, String annualized, double factor, double value, double numeratorValue, double denominatorValue ) - { - this.indicatorId = indicatorId; - this.periodId = periodId; - this.periodTypeId = periodTypeId; - this.organisationUnitId = organisationUnitId; - this.organisationUnitGroupId = organisationUnitGroupId; - this.level = level; - this.annualized = annualized; - this.factor = factor; - this.value = value; - this.numeratorValue = numeratorValue; - this.denominatorValue = denominatorValue; - } - - // ---------------------------------------------------------------------- - // Logic - // ---------------------------------------------------------------------- - - public void clear() - { - this.indicatorId = 0; - this.periodId = 0; - this.periodTypeId = 0; - this.organisationUnitId = 0; - this.level = 0; - this.factor = 0.0; - this.value = 0.0; - this.numeratorValue = 0.0; - this.denominatorValue = 0.0; - } - - @Override - public int getElementId() - { - return indicatorId; - } - - // ---------------------------------------------------------------------- - // Getters and setters - // ---------------------------------------------------------------------- - - public int getIndicatorId() - { - return indicatorId; - } - - public void setIndicatorId( int indicatorId ) - { - this.indicatorId = indicatorId; - } - - @Override - public int getLevel() - { - return level; - } - - @Override - public void setLevel( int level ) - { - this.level = level; - } - - public double getDenominatorValue() - { - return denominatorValue; - } - - public void setDenominatorValue( double denominatorValue ) - { - this.denominatorValue = denominatorValue; - } - - public String getAnnualized() - { - return annualized; - } - - public void setAnnualized( String annualized ) - { - this.annualized = annualized; - } - - public double getFactor() - { - return factor; - } - - public void setFactor( double factor ) - { - this.factor = factor; - } - - public double getNumeratorValue() - { - return numeratorValue; - } - - public void setNumeratorValue( double numeratorValue ) - { - this.numeratorValue = numeratorValue; - } - - public String getIndicatorName() - { - return indicatorName; - } - - public void setIndicatorName( String indicatorName ) - { - this.indicatorName = indicatorName; - } - - // ---------------------------------------------------------------------- - // hashCode and equals - // ---------------------------------------------------------------------- - - @Override - public String toString() - { - return - "[Indicator: " + indicatorId + - " period: " + periodId + - " org unit: " + organisationUnitId + - " org unit group: " + organisationUnitGroupId + - " value: " + value + "]"; - } - - @Override - public int hashCode() - { - return indicatorId * periodId * organisationUnitId * organisationUnitGroupId * 17; - } - - @Override - public boolean equals( Object o ) - { - if ( this == o ) - { - return true; - } - - if ( o == null || !( o instanceof AggregatedIndicatorValue ) ) - { - return false; - } - - AggregatedIndicatorValue that = (AggregatedIndicatorValue) o; - - return this.indicatorId == that.getIndicatorId() && - this.periodId == that.getPeriodId() && - this.organisationUnitId == that.getOrganisationUnitId() && - this.organisationUnitGroupId == that.getOrganisationUnitGroupId(); - } -} === removed file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/aggregation/AggregatedOrgUnitDataValueService.java' --- dhis-2/dhis-api/src/main/java/org/hisp/dhis/aggregation/AggregatedOrgUnitDataValueService.java 2015-01-17 07:41:26 +0000 +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/aggregation/AggregatedOrgUnitDataValueService.java 1970-01-01 00:00:00 +0000 @@ -1,70 +0,0 @@ -package org.hisp.dhis.aggregation; - -/* - * Copyright (c) 2004-2015, University of Oslo - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * Neither the name of the HISP project nor the names of its contributors may - * be used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -import java.util.Collection; - -import org.hisp.dhis.dataelement.DataElement; -import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo; -import org.hisp.dhis.indicator.Indicator; -import org.hisp.dhis.organisationunit.OrganisationUnit; -import org.hisp.dhis.organisationunit.OrganisationUnitGroup; -import org.hisp.dhis.period.Period; - -public interface AggregatedOrgUnitDataValueService -{ - String ID = AggregatedOrgUnitDataValueService.class.getName(); - - // ------------------------------------------------------------------------- - // AggregatedDataValue - // ------------------------------------------------------------------------- - - Double getAggregatedValue( DataElement dataElement, DataElementCategoryOptionCombo optionCombo, - Period period, OrganisationUnit organisationUnit, OrganisationUnitGroup group ); - - Collection getAggregatedDataValueTotals( Collection dataElementIds, - Collection periodIds, int organisationUnitId, Collection organisationUnitGroupIds ); - - void deleteAggregatedDataValues( Collection dataElementIds, Collection periodIds, Collection organisationUnitIds ); - - void deleteAggregatedDataValues(); - - // ------------------------------------------------------------------------- - // AggregatedIndicatorValue - // ------------------------------------------------------------------------- - - Double getAggregatedIndicatorValue( Indicator indicator, Period period, OrganisationUnit organisationUnit, OrganisationUnitGroup group ); - - Collection getAggregatedIndicatorValues( Collection indicatorIds, - Collection periodIds, int organisationUnitId, Collection organisationUnitGroupIds ); - - void deleteAggregatedIndicatorValues( Collection indicatorIds, Collection periodIds, Collection organisationUnitIds ); - - void deleteAggregatedIndicatorValues(); -} === removed file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/aggregation/AggregatedOrgUnitDataValueStore.java' --- dhis-2/dhis-api/src/main/java/org/hisp/dhis/aggregation/AggregatedOrgUnitDataValueStore.java 2015-06-16 05:11:29 +0000 +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/aggregation/AggregatedOrgUnitDataValueStore.java 1970-01-01 00:00:00 +0000 @@ -1,61 +0,0 @@ -package org.hisp.dhis.aggregation; - -/* - * Copyright (c) 2004-2015, University of Oslo - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * Neither the name of the HISP project nor the names of its contributors may - * be used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -import java.util.Collection; -import java.util.List; - -public interface AggregatedOrgUnitDataValueStore -{ - // ------------------------------------------------------------------------- - // AggregatedDataValue - // ------------------------------------------------------------------------- - - Double getAggregatedDataValue( int dataElement, int categoryOptionCombo, int period, int organisationUnit, int organisationUnitGroup ); - - List getAggregatedDataValueTotals( Collection dataElementIds, - Collection periodIds, int organisationUnitId, Collection organisationUnitGroupIds ); - - void deleteAggregatedDataValues( Collection dataElementIds, Collection periodIds, Collection organisationUnitIds ); - - void deleteAggregatedDataValues(); - - // ------------------------------------------------------------------------- - // AggregatedIndicatorValue - // ------------------------------------------------------------------------- - - Double getAggregatedIndicatorValue( int indicator, int period, int organisationUnit, int organisationUnitGroup ); - - List getAggregatedIndicatorValues( Collection indicatorIds, - Collection periodIds, int organisationUnitId, Collection organisationUnitGroupIds ); - - void deleteAggregatedIndicatorValues( Collection indicatorIds, Collection periodIds, Collection organisationUnitIds ); - - void deleteAggregatedIndicatorValues(); -} === removed file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/aggregation/AggregationService.java' --- dhis-2/dhis-api/src/main/java/org/hisp/dhis/aggregation/AggregationService.java 2015-01-17 07:41:26 +0000 +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/aggregation/AggregationService.java 1970-01-01 00:00:00 +0000 @@ -1,118 +0,0 @@ -package org.hisp.dhis.aggregation; - -/* - * Copyright (c) 2004-2015, University of Oslo - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * Neither the name of the HISP project nor the names of its contributors may - * be used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -import java.util.Date; - -import org.hisp.dhis.dataelement.DataElement; -import org.hisp.dhis.dataelement.DataElementCategoryOption; -import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo; -import org.hisp.dhis.indicator.Indicator; -import org.hisp.dhis.organisationunit.OrganisationUnit; - -/** - * @author Lars Helge Overland - */ -public interface AggregationService -{ - String ID = AggregationService.class.getName(); - - /** - * Calculates the aggregated value based on the aggregation operator defined - * in the given dataelement. - * - * @param dataElement the DataElement to aggregate over. - * @param optionCombo the DataElementCategoryOptionCombo to aggregate over. - * If null, the total value for the DataElement will be used. - * @param startDate the start date of the aggregation period. - * @param endDate the end date of the aggregation period. - * @param organisationUnit the OrganisationUnit to aggregate over. - * @return the aggregated value or null if no values are found. - * @throws AggregationStoreException - */ - Double getAggregatedDataValue( DataElement dataElement, DataElementCategoryOptionCombo optionCombo, Date startDate, Date endDate, - OrganisationUnit organisationUnit ); - - /** - * Calculates the aggregated value based on the aggregation operator defined - * in the given dataelement. - * - * @param dataElement the DataElement to aggregate over. - * @param categoryOption the DataElementCategoryOption to aggregate over. - * @param startDate the start date of the aggregation period. - * @param endDate the end date of the aggregation period. - * @param organisationUnit the OrganisationUnit to aggregate over. - * @return the aggregated value or null if no values are found. - * @throws AggregationStoreException - */ - Double getAggregatedDataValue( DataElement dataElement, Date startDate, Date endDate, OrganisationUnit organisationUnit, - DataElementCategoryOption categoryOption ); - - /** - * Calculates the aggregated value of the given indicator. - * - * @param indicator the Indicator to aggregate over. - * @param startDate the start date of the aggregation period. - * @param endDate the end date of the aggregation period. - * @param organisationUnit the OrganisationUnit to aggregate over. - * @return the aggregated value or null if no values are found. - * @throws AggregationStoreException - */ - Double getAggregatedIndicatorValue( Indicator indicator, Date startDate, Date endDate, - OrganisationUnit organisationUnit ); - - /** - * Calculates the aggregated value of the numerator of the given indicator. - * - * @param indicator the indicator to aggregate over. - * @param startDate the start date of the aggregation period. - * @param endDate the end date of the aggregation period. - * @param organisationUnit the OrganisationUnit to aggregate over. - * @return the aggregated value or null if no values are found. - * @throws AggregationStoreException - */ - Double getAggregatedNumeratorValue( Indicator indicator, Date startDate, Date endDate, - OrganisationUnit organisationUnit ); - - /** - * Calculates the aggregated value of the denominator of the given - * indicator. - * - * @param indicator the indicator to aggregate over. - * @param startDate the start date of the aggregation period. - * @param endDate the end date of the aggregation period. - * @param organisationUnit the OrganisationUnit to aggregate over. - * @return the aggregated value or null if no values are found. - * @throws AggregationStoreException - */ - Double getAggregatedDenominatorValue( Indicator indicator, Date startDate, Date endDate, - OrganisationUnit organisationUnit ); - - void clearCache(); -} === removed file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/aggregation/AggregationStore.java' --- dhis-2/dhis-api/src/main/java/org/hisp/dhis/aggregation/AggregationStore.java 2015-01-17 07:41:26 +0000 +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/aggregation/AggregationStore.java 1970-01-01 00:00:00 +0000 @@ -1,71 +0,0 @@ -package org.hisp.dhis.aggregation; - -/* - * Copyright (c) 2004-2015, University of Oslo - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * Neither the name of the HISP project nor the names of its contributors may - * be used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -import java.util.Collection; - -import org.hisp.dhis.datavalue.DataValue; - -/** - * @author Lars Helge Overland - */ -public interface AggregationStore -{ - String ID = AggregationStore.class.getName(); - - // ---------------------------------------------------------------------- - // DataValue - // ---------------------------------------------------------------------- - - /** - * Gets all DataValues for the given parameters. This method can be used in conjunction with the - * StatementInterceptor, which creates a database connection and statement which is reused for multiple - * invocations of this method. - * - * @param sourceIds a collection of source ids. - * @param dataElementId the dataElementId. - * @param optionComboId the optionComboId. - * @param periodIds a collection of period ids. - * @return collection of DataValues for the given parameters. - */ - Collection getDataValues( Collection sourceIds, Integer dataElementId, Integer optionComboId, Collection periodIds ); - - /** - * Gets all DataValues for the given parameters. This method can be used in conjunction with the - * StatementInterceptor, which creates a database connection and statement which is reused for multiple - * invocations of this method. - * - * @param sourceId the Source id. - * @param dataElementId the DataElement id. - * @param optionComboId the optionComboId. - * @param periodIds a collection of period ids. - * @return collection of DataValues for the given parameters. - */ - Collection getDataValues( Integer sourceId, Integer dataElementId, Integer optionComboId, Collection periodIds ); -} === removed file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/aggregation/StoreIterator.java' --- dhis-2/dhis-api/src/main/java/org/hisp/dhis/aggregation/StoreIterator.java 2015-01-17 07:41:26 +0000 +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/aggregation/StoreIterator.java 1970-01-01 00:00:00 +0000 @@ -1,60 +0,0 @@ -package org.hisp.dhis.aggregation; - -/* - * Copyright (c) 2004-2015, University of Oslo - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * Neither the name of the HISP project nor the names of its contributors may - * be used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/** - * @interface StoreIterator - * Provides an object for processing a collection of Objects, such - * as from a jdbc resultset with a rowmapper - * - * @author bobj - */ -public interface StoreIterator { - - // ---------------------------------------------------------------------- - // StoreIterator - // ---------------------------------------------------------------------- - - /** - * Gets the next object - * - * @return the object or null. - */ - T next(); - - /** - * Close any underlying resources - * - * Note: if you do not iterate through the entire resultset, ie. until next() - * returns NULL, you have the responsibility to call close() in order to release - * the underlying resultset, connection etc - * - */ - void close(); -} === removed file 'dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/objectmapper/AggregatedDataSetCompletenessRowMapper.java' --- dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/objectmapper/AggregatedDataSetCompletenessRowMapper.java 2015-01-17 07:41:26 +0000 +++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/objectmapper/AggregatedDataSetCompletenessRowMapper.java 1970-01-01 00:00:00 +0000 @@ -1,63 +0,0 @@ -package org.hisp.dhis.system.objectmapper; - -/* - * Copyright (c) 2004-2015, University of Oslo - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * Neither the name of the HISP project nor the names of its contributors may - * be used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -import java.sql.ResultSet; -import java.sql.SQLException; - -import org.amplecode.quick.mapper.RowMapper; -import org.hisp.dhis.completeness.DataSetCompletenessResult; - -/** - * @author Lars Helge Overland - */ -public class AggregatedDataSetCompletenessRowMapper - implements RowMapper, org.springframework.jdbc.core.RowMapper -{ - @Override - public DataSetCompletenessResult mapRow( ResultSet resultSet ) - throws SQLException - { - final DataSetCompletenessResult value = new DataSetCompletenessResult(); - - value.setDataSetId( resultSet.getInt( "datasetid" ) ); - value.setPeriodId( resultSet.getInt( "periodid" ) ); - value.setOrganisationUnitId( resultSet.getInt( "organisationunitid" ) ); - value.setValue( resultSet.getDouble( "value" ) ); - - return value; - } - - @Override - public DataSetCompletenessResult mapRow( ResultSet resultSet, int arg1 ) - throws SQLException - { - return mapRow( resultSet ); - } -} === removed file 'dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/objectmapper/AggregatedDataValueRowMapper.java' --- dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/objectmapper/AggregatedDataValueRowMapper.java 2015-01-17 07:41:26 +0000 +++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/objectmapper/AggregatedDataValueRowMapper.java 1970-01-01 00:00:00 +0000 @@ -1,64 +0,0 @@ -package org.hisp.dhis.system.objectmapper; - -/* - * Copyright (c) 2004-2015, University of Oslo - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * Neither the name of the HISP project nor the names of its contributors may - * be used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -import java.sql.ResultSet; -import java.sql.SQLException; - -import org.amplecode.quick.mapper.RowMapper; -import org.hisp.dhis.aggregation.AggregatedDataValue; - -/** - * @author Lars Helge Overland - */ -public class AggregatedDataValueRowMapper - implements RowMapper, org.springframework.jdbc.core.RowMapper -{ - @Override - public AggregatedDataValue mapRow( ResultSet resultSet ) - throws SQLException - { - final AggregatedDataValue value = new AggregatedDataValue(); - - value.setDataElementId( resultSet.getInt( "dataelementid" ) ); - value.setCategoryOptionComboId( resultSet.getInt( "categoryoptioncomboid" ) ); - value.setPeriodId( resultSet.getInt( "periodid" ) ); - value.setOrganisationUnitId( resultSet.getInt( "organisationunitid" ) ); - value.setValue( resultSet.getDouble( "value" ) ); - - return value; - } - - @Override - public AggregatedDataValue mapRow( ResultSet resultSet, int rowNum ) - throws SQLException - { - return mapRow( resultSet ); - } -} === removed file 'dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/objectmapper/AggregatedIndicatorValueRowMapper.java' --- dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/objectmapper/AggregatedIndicatorValueRowMapper.java 2015-01-17 07:41:26 +0000 +++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/objectmapper/AggregatedIndicatorValueRowMapper.java 1970-01-01 00:00:00 +0000 @@ -1,67 +0,0 @@ -package org.hisp.dhis.system.objectmapper; - -/* - * Copyright (c) 2004-2015, University of Oslo - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * Neither the name of the HISP project nor the names of its contributors may - * be used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -import java.sql.ResultSet; -import java.sql.SQLException; - -import org.amplecode.quick.mapper.RowMapper; -import org.hisp.dhis.aggregation.AggregatedIndicatorValue; - -/** - * @author Lars Helge Overland - */ -public class AggregatedIndicatorValueRowMapper - implements RowMapper, org.springframework.jdbc.core.RowMapper -{ - @Override - public AggregatedIndicatorValue mapRow( ResultSet resultSet ) - throws SQLException - { - final AggregatedIndicatorValue value = new AggregatedIndicatorValue(); - - value.setIndicatorId( resultSet.getInt( "indicatorid" ) ); - value.setPeriodId( resultSet.getInt( "periodid" ) ); - value.setOrganisationUnitId( resultSet.getInt( "organisationunitid" ) ); - value.setAnnualized( resultSet.getString( "annualized" ) ); - value.setFactor( resultSet.getDouble( "factor" ) ); - value.setValue( resultSet.getDouble( "value" ) ); - value.setNumeratorValue( resultSet.getDouble( "numeratorvalue" ) ); - value.setDenominatorValue( resultSet.getDouble( "denominatorvalue" ) ); - - return value; - } - - @Override - public AggregatedIndicatorValue mapRow( ResultSet resultSet, int rowNum ) - throws SQLException - { - return mapRow( resultSet ); - } -} === removed file 'dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/objectmapper/AggregatedOrgUnitDataValueRowMapper.java' --- dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/objectmapper/AggregatedOrgUnitDataValueRowMapper.java 2015-01-17 07:41:26 +0000 +++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/objectmapper/AggregatedOrgUnitDataValueRowMapper.java 1970-01-01 00:00:00 +0000 @@ -1,59 +0,0 @@ -package org.hisp.dhis.system.objectmapper; - -/* - * Copyright (c) 2004-2015, University of Oslo - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * Neither the name of the HISP project nor the names of its contributors may - * be used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -import java.sql.ResultSet; -import java.sql.SQLException; - -import org.hisp.dhis.aggregation.AggregatedDataValue; - -/** - * @author Lars Helge Overland - */ -public class AggregatedOrgUnitDataValueRowMapper - extends AggregatedDataValueRowMapper -{ - @Override - public AggregatedDataValue mapRow( ResultSet resultSet ) - throws SQLException - { - final AggregatedDataValue value = super.mapRow( resultSet ); - - value.setOrganisationUnitGroupId( resultSet.getInt( "organisationunitgroupid" ) ); - - return value; - } - - @Override - public AggregatedDataValue mapRow( ResultSet resultSet, int rowNum ) - throws SQLException - { - return this.mapRow( resultSet ); - } -} === removed file 'dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/objectmapper/AggregatedOrgUnitIndicatorValueRowMapper.java' --- dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/objectmapper/AggregatedOrgUnitIndicatorValueRowMapper.java 2015-01-17 07:41:26 +0000 +++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/objectmapper/AggregatedOrgUnitIndicatorValueRowMapper.java 1970-01-01 00:00:00 +0000 @@ -1,59 +0,0 @@ -package org.hisp.dhis.system.objectmapper; - -/* - * Copyright (c) 2004-2015, University of Oslo - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * Neither the name of the HISP project nor the names of its contributors may - * be used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -import java.sql.ResultSet; -import java.sql.SQLException; - -import org.hisp.dhis.aggregation.AggregatedIndicatorValue; - -/** - * @author Lars Helge Overland - */ -public class AggregatedOrgUnitIndicatorValueRowMapper - extends AggregatedIndicatorValueRowMapper -{ - @Override - public AggregatedIndicatorValue mapRow( ResultSet resultSet ) - throws SQLException - { - final AggregatedIndicatorValue value = super.mapRow( resultSet ); - - value.setOrganisationUnitGroupId( resultSet.getInt( "organisationunitgroupid" ) ); - - return value; - } - - @Override - public AggregatedIndicatorValue mapRow( ResultSet resultSet, int rowNum ) - throws SQLException - { - return this.mapRow( resultSet ); - } -}