1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.syncope.common.lib.attr;
20
21 import java.util.ArrayList;
22 import java.util.HashMap;
23 import java.util.List;
24 import java.util.Map;
25 import org.apache.syncope.common.lib.AbstractJDBCConf;
26 import org.apache.syncope.common.lib.to.AttrRepoTO;
27 import org.apache.syncope.common.lib.types.CaseCanonicalizationMode;
28
29 public class JDBCAttrRepoConf extends AbstractJDBCConf implements AttrRepoConf {
30
31 private static final long serialVersionUID = -4474060002361453868L;
32
33 public enum QueryType {
34 AND,
35 OR
36
37 }
38
39
40
41
42 private boolean singleRow = true;
43
44
45
46
47 private boolean requireAllAttributes = true;
48
49
50
51
52
53 private CaseCanonicalizationMode caseCanonicalization = CaseCanonicalizationMode.NONE;
54
55
56
57
58 private QueryType queryType = QueryType.AND;
59
60
61
62
63
64
65 private final Map<String, String> columnMappings = new HashMap<>(0);
66
67
68
69
70 private final List<String> username = new ArrayList<>(0);
71
72
73
74
75
76 private final List<String> caseInsensitiveQueryAttributes = new ArrayList<>(0);
77
78
79
80
81
82
83 private final Map<String, String> queryAttributes = new HashMap<>(0);
84
85 public boolean isSingleRow() {
86 return singleRow;
87 }
88
89 public void setSingleRow(final boolean singleRow) {
90 this.singleRow = singleRow;
91 }
92
93 public boolean isRequireAllAttributes() {
94 return requireAllAttributes;
95 }
96
97 public void setRequireAllAttributes(final boolean requireAllAttributes) {
98 this.requireAllAttributes = requireAllAttributes;
99 }
100
101 public CaseCanonicalizationMode getCaseCanonicalization() {
102 return caseCanonicalization;
103 }
104
105 public void setCaseCanonicalization(final CaseCanonicalizationMode caseCanonicalization) {
106 this.caseCanonicalization = caseCanonicalization;
107 }
108
109 public QueryType getQueryType() {
110 return queryType;
111 }
112
113 public void setQueryType(final QueryType queryType) {
114 this.queryType = queryType;
115 }
116
117 public Map<String, String> getColumnMappings() {
118 return columnMappings;
119 }
120
121 public List<String> getUsername() {
122 return username;
123 }
124
125 public List<String> getCaseInsensitiveQueryAttributes() {
126 return caseInsensitiveQueryAttributes;
127 }
128
129 public Map<String, String> getQueryAttributes() {
130 return queryAttributes;
131 }
132
133 @Override
134 public Map<String, Object> map(final AttrRepoTO attrRepo, final Mapper mapper) {
135 return mapper.map(attrRepo, this);
136 }
137 }