Project

General

Profile

1
package eu.dnetlib.data.statsmanager;
2

    
3
import org.apache.log4j.Logger;
4

    
5
import javax.xml.bind.annotation.XmlRootElement;
6

    
7

    
8
@XmlRootElement(name = "Query")
9
public class Query {
10
    private String id;
11
    private String name;
12
    private int dbResult;
13
    private int cqlResult;
14
    private statusFlag status;
15

    
16
    private Logger log = Logger.getLogger(this.getClass());
17

    
18
    public Query() {};
19

    
20
    public Query(String id, String key, Integer dbResult, int cqlResult, boolean qStatus) {
21
        this.id = id;
22
        this.name = key;
23
        this.dbResult = dbResult;
24
        this.cqlResult = cqlResult;
25
        if (qStatus) {
26
            this.status = statusFlag.success;
27

    
28
        } else {
29
            this.status = statusFlag.fail;
30
        }
31

    
32
     //   log.debug("Created Query: " + this.toString());
33
    }
34

    
35
    public enum statusFlag {success, fail}
36

    
37

    
38
    public String getName() {
39
        return name;
40
    }
41

    
42
    public void setName(String name) {
43
        this.name = name;
44
    }
45

    
46

    
47
    public int getDbResult() {
48
        return dbResult;
49
    }
50

    
51
    public void setDbResult(int dbResult) {
52
        this.dbResult = dbResult;
53
    }
54

    
55
    public int getCqlResult() {
56
        return cqlResult;
57
    }
58

    
59
    public void setCqlResult(int cqlResult) {
60
        this.cqlResult = cqlResult;
61
    }
62

    
63
    public String getId() {
64
        return id;
65
    }
66

    
67
    public void setId(String id) {
68
        this.id = id;
69
    }
70

    
71
    public statusFlag getStatus() {
72
        return status;
73
    }
74

    
75
    public void setStatus(statusFlag status) {
76
        this.status = status;
77
    }
78

    
79
    @Override
80
    public String toString() {
81
        return "Query{" +
82
                "id='" + id + '\'' +
83
                ", name='" + name + '\'' +
84
                ", dbResult=" + dbResult +
85
                ", cqlResult=" + cqlResult +
86
                ", status=" + status +
87
                '}';
88
    }
89
}
(2-2/8)