1 package de.dlr.shepard.influxDB;
2
3 import com.fasterxml.jackson.annotation.JsonIgnore;
4 import de.dlr.shepard.util.HasId;
5 import jakarta.validation.constraints.NotBlank;
6 import lombok.Data;
7 import lombok.NoArgsConstructor;
8 import org.neo4j.ogm.annotation.GeneratedValue;
9 import org.neo4j.ogm.annotation.Id;
10 import org.neo4j.ogm.annotation.NodeEntity;
11
12 @NodeEntity
13 @Data
14 @NoArgsConstructor
15 public class Timeseries implements HasId {
16
17 @Id
18 @GeneratedValue
19 @JsonIgnore
20 private Long id;
21
22 @NotBlank
23 private String measurement;
24
25 @NotBlank
26 private String device;
27
28 @NotBlank
29 private String location;
30
31 @NotBlank
32 private String symbolicName;
33
34 @NotBlank
35 private String field;
36
37 public Timeseries(String measurement, String device, String location, String symbolicName, String field) {
38 this.measurement = measurement;
39 this.device = device;
40 this.location = location;
41 this.symbolicName = symbolicName;
42 this.field = field;
43 }
44
45 @Override
46 public String getUniqueId() {
47 return String.join("-", measurement, device, location, symbolicName, field);
48 }
49 }