ACIS.java [src/java/svap/utils] Revision: default  Date:
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package svap.utils;

import csip.ServiceException;
import java.util.ArrayList;
import org.codehaus.jettison.json.JSONObject;

/**
 *
 * @author <a href="mailto:shaun.case@colostate.edu">Shaun Case</a>
 */
public abstract class ACIS extends ServiceCall {    
    private static final String DEFAULT_META = "name,state,county,sids,ll,elev,uid,valid_daterange,avgt";
    private static final String DEFAULT_ELEMS = "[{\"name\":\"avgt\"}]";
    protected String elems = DEFAULT_ELEMS;
    protected String meta = DEFAULT_META;
    protected String sDate, eDate;

    private JSONObject metaInfo;
    
    protected ArrayList<ClimateStation> stations = new ArrayList();

    public ACIS(String URI) {
        super(URI);
        elems = DEFAULT_ELEMS;
        meta = DEFAULT_META;
    }

    @Override
    protected void checkErrors() throws ServiceException {
        if ((null == results) || (results.length() <= 0)) {
            throw new ServiceException((errorPrefix.isEmpty() ? "" : (errorPrefix + ":  ")) + "No data was returned from " + URI + " for this request. ");
        }      
    }
}