1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.openehealth.ipf.commons.ihe.xds.core.requests.query;
17
18 import lombok.EqualsAndHashCode;
19 import lombok.Getter;
20 import lombok.ToString;
21
22 import static org.apache.commons.lang3.Validate.notNull;
23
24 import javax.xml.bind.annotation.*;
25 import java.io.Serializable;
26
27
28
29
30
31 @XmlAccessorType(XmlAccessType.FIELD)
32 @XmlType(name = "Query")
33 @EqualsAndHashCode(doNotUseGetters = true)
34 @ToString(doNotUseGetters = true)
35 public abstract class Query implements Serializable {
36 private static final long serialVersionUID = 7597105342752455732L;
37
38 @XmlAttribute
39 @Getter private QueryType type;
40
41
42
43
44 public Query() {
45 }
46
47
48
49
50
51
52 protected Query(QueryType type) {
53 notNull(type, "type cannot be null");
54 this.type = type;
55 }
56
57
58
59
60 public interface Visitor {
61 void visit(FindDocumentsQuery query);
62 void visit(FindDocumentsForMultiplePatientsQuery query);
63 void visit(FindFoldersQuery query);
64 void visit(FindFoldersForMultiplePatientsQuery query);
65 void visit(GetSubmissionSetsQuery query);
66 void visit(GetSubmissionSetAndContentsQuery query);
67 void visit(GetRelatedDocumentsQuery query);
68 void visit(GetFoldersQuery query);
69 void visit(GetFoldersForDocumentQuery query);
70 void visit(GetFolderAndContentsQuery query);
71 void visit(GetDocumentsQuery query);
72 void visit(GetDocumentsAndAssociationsQuery query);
73 void visit(GetAssociationsQuery query);
74 void visit(GetAllQuery query);
75 void visit(FindSubmissionSetsQuery query);
76 void visit(FetchQuery query);
77 void visit(FindDocumentsByReferenceIdQuery query);
78 }
79
80
81
82
83
84
85 public abstract void accept(Visitor visitor);
86 }