WaterDataInterface.java [src/WaterData] Revision: default  Date:
package WaterData;

import java.util.ArrayList;

/**
* Last Updated: 9-April-2019
* @author Tyler Wible
* @since 8-February-2017
*/
public interface WaterDataInterface {
    
    /**
     * Get a citation for the database that was used to fetch data.
     * @return 
     */
    public String getDataSourceCitation();
    
    /**
     * Extract daily flow from the current database
     * @param directory  the output file location (used by STORET Data extraction)
     * @param orgId  the organization which provided the data to the database (only used by STORET and CDSN databases)
     * @param stationId  the station ID for which flow data is desired
     * @param startDate  the begin date of desired data (yyyy-MM-dd)
     * @param endDate  the end date of desired data (yyyy-MM-dd)
     * @return ArrayList of strings of the raw data
     * @throws WaterData.WaterDataException
     */
    public ArrayList<String> extractFlowData_raw(String directory, String orgId, String stationId, String startDate, String endDate) throws WaterDataException;
    
    /**
     * Extract daily flow from the current database
     * @param directory  the output file location (used by STORET Data extraction)
     * @param orgId  the organization which provided the data to the database (only used by STORET and CDSN databases)
     * @param stationId  the station ID for which flow data is desired
     * @param startDate  the begin date of desired data (yyyy-MM-dd)
     * @param endDate  the end date of desired data (yyyy-MM-dd)
     * @return String[][] array of paired dates and flow data.
     * Dates (yyyy-MM-dd format) are in the first column [i][0] and flow (in cfs) is in the second [i][1]
     * @throws WaterData.WaterDataException
     */
    public String[][] extractFlowData_formatted(String directory, String orgId, String stationId, String startDate, String endDate) throws WaterDataException;
    
    /**
     * Extract water quality data from the current database
     * @param directory  the output file location (used by STORET Data extraction)
     * @param orgId  the organization which provided the data to the database (only used by STORET and CDSN databases)
     * @param stationId  the station ID for which water quality data is desired
     * @param startDate  the begin date of desired data (yyyy-MM-dd)
     * @param endDate  the end date of desired data (yyyy-MM-dd)
     * @param wqTest  the water quality test desired "00600 Total nitrogen, water, unfiltered, milligrams per liter -- mg/L" (format: "5-digit test-name -- units") or "flow"
     * @return ArrayList of strings of the raw data
     * @throws WaterData.WaterDataException
     */
    public ArrayList<String> extractWaterQualityData_raw(String directory, String orgId, String stationId, String startDate, String endDate, String wqTest) throws WaterDataException;
    
    /**
     * Extract water quality data from the current database
     * @param directory  the output file location (used by STORET Data extraction)
     * @param orgId  the organization which provided the data to the database (only used by STORET and CDSN databases)
     * @param stationId  the station ID for which water quality data is desired
     * @param startDate  the begin date of desired data (yyyy-MM-dd)
     * @param endDate  the end date of desired data (yyyy-MM-dd)
     * @param wqTest  the water quality test desired "00600 Total nitrogen, water, unfiltered, milligrams per liter -- mg/L" (format: "5-digit test-name -- units") or "flow"
     * @return String[][] array of paired dates and water quality data.
     * Dates (yyyy-MM-dd format) are in the first column [i][0] and water quality data are in the second [i][1]
     * @throws WaterData.WaterDataException
     */
    public String[][] extractWaterQualityData_formatted(String directory, String orgId, String stationId, String startDate, String endDate, String wqTest) throws WaterDataException;
    
//        throw new WaterDataException("There is no " + wqTest + " water quality data available for " + database + " station: " + stationId + ".");
//    /**
//     * Extract flow and water quality data from the current database
//     * @param directory  the output file location (used by STORET Data extraction)
//     * @param orgId  the organization which provided the data to the database (only used by STORET and CDSN databases)
//     * @param stationId  the station ID for which flow and water quality data is desired
//     * @param startDate  the begin date of desired flow and water quality data (yyyy-MM-dd)
//     * @param endDate  the end date of desired flow and water quality data (yyyy-MM-dd)
//     * @param wqTest  the water quality test desired "00600 Total nitrogen, water, unfiltered, milligrams per liter -- mg/L" (format: "5-digit test-name -- units")
//     * @throws Exception 
//     */
//    public static Object[] extractFlow_and_WQdata(String directory, String orgId, String stationId, String startDate, String endDate, String wqTest) throws Exception{
//        
//    }
    
    /**
     * Extract flood data from the current database
     * @param directory  the output file location (used by STORET Data extraction)
     * @param orgId  the organization which provided the data to the database (only used by STORET and CDSN databases)
     * @param stationId  the station ID for which flood data is desired
     * @param startDate  the begin date of desired data (yyyy-MM-dd)
     * @param endDate  the end date of desired data (yyyy-MM-dd)
     * @return ArrayList of strings of the raw data
     * @throws WaterData.WaterDataException
     */
    public ArrayList<String> extractFloodData_raw(String directory, String orgId, String stationId, String startDate, String endDate) throws WaterDataException;
    
    /**
     * Extract flood data from the current database
     * @param directory  the output file location (used by STORET Data extraction)
     * @param orgId  the organization which provided the data to the database (only used by STORET and CDSN databases)
     * @param stationId  the station ID for which flood data is desired
     * @param startDate  the begin date of desired data (yyyy-MM-dd)
     * @param endDate  the end date of desired data (yyyy-MM-dd)
     * @return double[][] array of paired years and flood data.
     * Years are in the first column [i][0] and flood values (cfs) are in the second [i][1]
     * @throws WaterData.WaterDataException
     */
    public double[][] extractFloodData_formatted(String directory, String orgId, String stationId, String startDate, String endDate) throws WaterDataException;
    
    /**
     * Extract instantaneous flow data from the current database
     * @param directory  the output file location (used by STORET Data extraction)
     * @param stationId  the station ID for which flow and water quality data is desired
     * @param startDate  the begin date of desired data (yyyy-MM-dd)
     * @param endDate  the end date of desired data (yyyy-MM-dd)
     * @return ArrayList of strings of the raw data
     * @throws WaterData.WaterDataException
     */
    public ArrayList<String> extractInstantaneousFlowData_raw(String directory, String stationId, String startDate, String endDate) throws WaterDataException;
    
    /**
     * Extract instantaneous flow data from the current database
     * @param directory  the output file location (used by STORET Data extraction)
     * @param stationId  the station ID for which flow and water quality data is desired
     * @param startDate  the begin date of desired data (yyyy-MM-dd)
     * @param endDate  the end date of desired data (yyyy-MM-dd)
     * @return String[][] array of paired dates and flow data.
     * Dates (yyyy-MM-dd HH:mm format) are in the first column [i][0] and flow data are in the second [i][1]
     * @throws WaterData.WaterDataException
     */
    public String[][] extractInstantaneousFlowData_formatted(String directory, String stationId, String startDate, String endDate) throws WaterDataException;
    
    /**
     * Extract stage-discharge (rating curve) relationship data from the current database
     * @param stationId  the station ID for which stage-discharge data is desired
     * @return ArrayList of strings of the raw data
     * @throws WaterData.WaterDataException
     */
    public ArrayList<String> extractStageDischarge_raw(String stationId) throws WaterDataException;
    
    /**
     * Extract stage-discharge (rating curve) relationship data from the current database
     * @param stationId  the station ID for which stage-discharge data is desired
     * @return double[][] array of paired discharge and depth data.
     * Discharge (cfs) is in the first column [i][0] and flow depth (ft) is in the second [i][1]
     * @throws WaterData.WaterDataException
     */
    public double[][] extractStageDischarge_formatted(String stationId) throws WaterDataException;
}