/*
 * Copyright (C) 2013 Conductor, Inc.
 *
 * 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 net.opentsdb.contrib.tsquare.web;

import net.opentsdb.contrib.tsquare.Metric;
import net.opentsdb.contrib.tsquare.web.view.DataQueryResponseWriter;
import net.opentsdb.core.DataPoints;

/**
 * Combines {@link Metric} and a given {@link DataPoints}.  This is used to
 * send query results to implementations of {@link DataQueryResponseWriter}.
 * Keep in mind the semantics of {@link DataPoints} when holding a reference 
 * to this object.
 * 
 * @author James Royalty (jroyalty) <i>[Jul 29, 2013]</i>
 */
public class AnnotatedDataPoints {
    private Metric metric;
    private DataPoints dataPoints;
    
    public AnnotatedDataPoints(final Metric metric, final DataPoints dataPoints) {
        this.metric = metric;
        this.dataPoints = dataPoints;
    }

    public Metric getMetric() {
        return metric;
    }

    public DataPoints getDataPoints() {
        return dataPoints;
    }
}

@@ -791,16 +791,57 @@
 oints;%0A%0A
+import com.google.common.collect.Range;%0A%0A
 /**%0A * C
@@ -1245,24 +1245,69 @@
 dataPoints;%0A
+    private Range%3CLong%3E queryRangeInSeconds;%0A
     %0A    pub
@@ -1350,16 +1350,55 @@
  metric,
+ final Range%3CLong%3E queryRangeInSeconds,
  final D
@@ -1447,24 +1447,80 @@
 c = metric;%0A
+        this.queryRangeInSeconds = queryRangeInSeconds;%0A
         this
@@ -1687,10 +1687,102 @@
 ;%0A    %7D%0A
-%7D
 %0A
+    public Range%3CLong%3E getQueryRangeInSeconds() %7B%0A        return queryRangeInSeconds;%0A    %7D%0A%7D

Support for time range filtering.