Commit f654331e authored by akucera's avatar akucera
Browse files

commit before changing all localdatetime to zoneddatetime

lot of things happened since the last commit - most notably,
implementation of the BACnetTrensProvider and its abstract parent
parent 31f4e6a4
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -25,7 +25,7 @@ import cz.muni.fi.lasaris.sbms.data.entities.Address;
import cz.muni.fi.lasaris.sbms.data.entities.values.RawValue;
import cz.muni.fi.lasaris.sbms.data.logic.ProviderManager;
import cz.muni.fi.lasaris.sbms.data.logic.DataCollector;
import cz.muni.fi.lasaris.sbms.data.util.Aggregations;
import cz.muni.fi.lasaris.sbms.data.util.Aggregator;



@@ -77,7 +77,7 @@ public class DataPointsEndpoint {
			logger.debug(json);
			SnapshotRequest readSpecs = m.readValue(json, SnapshotRequest.class);
			logger.debug(readSpecs);
			return dc.getDataPointsAggregation(readSpecs, Aggregations.getAggregation(agg), allowCache(cache));
			return dc.getDataPointsAggregation(readSpecs, Aggregator.getAggregation(agg), allowCache(cache));
		} catch (IOException e) {
			return AggregationResponse.getErrorResponse("Unable to parse query:" + e);
		}
@@ -119,7 +119,7 @@ public class DataPointsEndpoint {
			logger.debug(json);
			GroupedSnapshotRequest readSpecs = m.readValue(json, GroupedSnapshotRequest.class);
			logger.debug(readSpecs);
			AggregationResponse result =  dc.getDataPointGroupAggregations(readSpecs, Aggregations.getAggregation(agg), allowCache(cache));
			AggregationResponse result =  dc.getDataPointGroupAggregations(readSpecs, Aggregator.getAggregation(agg), allowCache(cache));
			logger.debug(result);
			return result;
		} catch (IOException e) {
+3 −3
Original line number Diff line number Diff line
@@ -20,7 +20,7 @@ import cz.muni.fi.lasaris.sbms.data.entities.AggregationFunction;
import cz.muni.fi.lasaris.sbms.data.entities.containers.Snapshot;
import cz.muni.fi.lasaris.sbms.data.entities.values.AggregatedValue;
import cz.muni.fi.lasaris.sbms.data.entities.values.RawValue;
import cz.muni.fi.lasaris.sbms.data.util.Aggregations;
import cz.muni.fi.lasaris.sbms.data.util.Aggregator;



@@ -175,14 +175,14 @@ NavigableMap<String, SnapshotRequest> protocols = readSpecs.getProtocols();
		Map<String, AggregatedValue> result = new LinkedHashMap<String, AggregatedValue>();
		
		for(String group : data.keySet()) {
			AggregatedValue value = Aggregations.computeAggregation(data.get(group).getData(), aggregation);
			AggregatedValue value = Aggregator.computeAggregation(data.get(group).getData(), aggregation);
			result.put(group, value);
		}
		return result;
	}
	
	private AggregatedValue computeAggregation(Map<Address, RawValue> data, AggregationFunction aggregation) {
		return Aggregations.computeAggregation(data, aggregation);
		return Aggregator.computeAggregation(data, aggregation);
	}

}
+6 −0
Original line number Diff line number Diff line
@@ -21,6 +21,12 @@
      <scope>test</scope>
    </dependency>
   
    <dependency>
    	<groupId>com.cronutils</groupId>
    	<artifactId>cron-utils</artifactId>
   		<version>5.0.5</version>
	</dependency>
   
  </dependencies>
  
  <build>
+4 −4
Original line number Diff line number Diff line
@@ -7,14 +7,14 @@ public enum AggregationFunction {
	WEIGHTED_AVG,
	WEIGHTED_TEMPORAL_AVG,
	MEDIAN,
	// TEMPORAL_MEDIAN,
	// WEIGHTED_MEDIAN,
	// WIGHTED_TEMPORAL_MEDIAN,
	MIN,
	MAX,
	SUM,
	COUNT, 
	AND,
	OR, 
	RATIO
	RATIO,
	WEIGHTED_RATIO,
	TEMPORAL_RATIO,
	WEIGHTED_TEMPORAL_RATIO
}
+3 −3
Original line number Diff line number Diff line
@@ -15,8 +15,8 @@ public abstract class CompositeDataContainer<L, D> {
	}
	
	public CompositeDataContainer(Map<L,D> data) {
		container = new LinkedHashMap<L, D>();
		container.putAll(data);
		container = data; //new LinkedHashMap<L, D>();
		//container.putAll(data);
	}
	
	public void add(L label, D data) {
@@ -24,7 +24,7 @@ public abstract class CompositeDataContainer<L, D> {
	}
	
	public void addAll(Map<L, D> data) {
		data.forEach((l, d) -> container.put(l, d));
		container.putAll(data);
	}
	
	public D remove(L label) {
Loading