1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.syncope.ext.scimv2.api.data;
20
21 import com.fasterxml.jackson.annotation.JsonCreator;
22 import com.fasterxml.jackson.annotation.JsonProperty;
23 import java.util.ArrayList;
24 import java.util.List;
25 import java.util.Optional;
26 import org.apache.syncope.ext.scimv2.api.type.Resource;
27 import org.apache.syncope.ext.scimv2.api.type.SortOrder;
28
29 public class SCIMSearchRequest extends SCIMBean {
30
31 private static final long serialVersionUID = 5759362928661983543L;
32
33 private final List<String> schemas = List.of(Resource.SearchRequest.schema());
34
35 private final List<String> attributes = new ArrayList<>();
36
37 private final List<String> excludedAttributes = new ArrayList<>();
38
39 private final String filter;
40
41 private final String sortBy;
42
43 private final SortOrder sortOrder;
44
45 private final Integer startIndex;
46
47 private final Integer count;
48
49 @JsonCreator(mode = JsonCreator.Mode.PROPERTIES)
50 public SCIMSearchRequest(
51 @JsonProperty("filter") final String filter,
52 @JsonProperty("sortBy") final String sortBy,
53 @JsonProperty("sortOrder") final SortOrder sortOrder,
54 @JsonProperty("startIndex") final Integer startIndex,
55 @JsonProperty("count") final Integer count) {
56
57 this.filter = filter;
58 this.sortBy = sortBy;
59 this.sortOrder = sortOrder;
60 this.startIndex = startIndex;
61 this.count = count;
62 }
63
64 public List<String> getSchemas() {
65 return schemas;
66 }
67
68 public List<String> getAttributes() {
69 return attributes;
70 }
71
72 public List<String> getExcludedAttributes() {
73 return excludedAttributes;
74 }
75
76 public String getFilter() {
77 return filter;
78 }
79
80 public String getSortBy() {
81 return sortBy;
82 }
83
84 public SortOrder getSortOrder() {
85 return sortOrder;
86 }
87
88 public int getStartIndex() {
89 return Optional.ofNullable(startIndex).orElse(1);
90 }
91
92 public int getCount() {
93 return Optional.ofNullable(count).orElse(25);
94 }
95 }