/*
 * Copyright 2014 Open mHealth
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * 	http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.openmhealth.shim;

import java.time.OffsetDateTime;


/**
 * A wrapper for encapsulating data requests sent to shims. Prevents from having long method signatures.
 *
 * @author Danilo Bonilla
 */
public class ShimDataRequest {

    /**
     * Identifier for the type of data being retrieved
     */
    private String dataTypeKey;
    /**
     * parameters required for acessing data, this will likely be oauth token + any extras or some kind of trusted
     * access.
     */
    private AccessParameters accessParameters;

    /**
     * // TODO replace this with filters on effective time, using the Data Point API The start date for the data being
     * retrieved
     */
    private OffsetDateTime startDateTime;

    /**
     * The end date for the data being retrieved
     */
    private OffsetDateTime endDateTime;

    /**
     * If true, returns normalized results from the external data provider, otherwise returns raw data.
     */
    private boolean normalize = true;


    public void setDataTypeKey(String dataTypeKey) {
        this.dataTypeKey = dataTypeKey;
    }

    public void setAccessParameters(AccessParameters accessParameters) {
        this.accessParameters = accessParameters;
    }

    public OffsetDateTime getStartDateTime() {
        return startDateTime;
    }

    public void setStartDateTime(OffsetDateTime startDateTime) {
        this.startDateTime = startDateTime;
    }

    public OffsetDateTime getEndDateTime() {
        return endDateTime;
    }

    public void setEndDateTime(OffsetDateTime endDateTime) {
        this.endDateTime = endDateTime;
    }


    public String getDataTypeKey() {
        return dataTypeKey;
    }

    public AccessParameters getAccessParameters() {
        return accessParameters;
    }

    public boolean getNormalize() {
        return normalize;
    }

    public void setNormalize(boolean normalize) {
        this.normalize = normalize;
    }
}

@@ -1588,239 +1588,8 @@
 e;%0A%0A
-%0A    public void setDataTypeKey(String dataTypeKey) %7B%0A        this.dataTypeKey = dataTypeKey;%0A    %7D%0A%0A    public void setAccessParameters(AccessParameters accessParameters) %7B%0A        this.accessParameters = accessParameters;%0A    %7D%0A%0A
     
@@ -1623,32 +1623,33 @@
 artDateTime() %7B%0A
+%0A
         return s
@@ -1726,32 +1726,33 @@
 tartDateTime) %7B%0A
+%0A
         this.sta
@@ -1827,24 +1827,25 @@
 ateTime() %7B%0A
+%0A
         retu
@@ -1924,24 +1924,25 @@
 DateTime) %7B%0A
+%0A
         this
@@ -1976,17 +1976,16 @@
 %0A    %7D%0A%0A
-%0A
     publ
@@ -2009,24 +2009,25 @@
 TypeKey() %7B%0A
+%0A
         retu
@@ -2041,32 +2041,133 @@
 TypeKey;%0A    %7D%0A%0A
+    public void setDataTypeKey(String dataTypeKey) %7B%0A%0A        this.dataTypeKey = dataTypeKey;%0A    %7D%0A%0A
     public Acces
@@ -2198,24 +2198,25 @@
 ameters() %7B%0A
+%0A
         retu
@@ -2235,32 +2235,163 @@
 ameters;%0A    %7D%0A%0A
+    public void setAccessParameters(AccessParameters accessParameters) %7B%0A%0A        this.accessParameters = accessParameters;%0A    %7D%0A%0A
     public boole
@@ -2406,24 +2406,25 @@
 rmalize() %7B%0A
+%0A
         retu
@@ -2494,16 +2494,17 @@
 lize) %7B%0A
+%0A
         

Clean up code