View Javadoc
1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  You may obtain a copy of the License at
9    *
10   *   http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing,
13   * software distributed under the License is distributed on an
14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   * KIND, either express or implied.  See the License for the
16   * specific language governing permissions and limitations
17   * under the License.
18   */
19  package org.apache.syncope.common.lib.attr;
20  
21  import java.util.HashMap;
22  import java.util.Map;
23  import org.apache.syncope.common.lib.AbstractLDAPConf;
24  import org.apache.syncope.common.lib.to.AttrRepoTO;
25  
26  public class LDAPAttrRepoConf extends AbstractLDAPConf implements AttrRepoConf {
27  
28      private static final long serialVersionUID = -471527731042579422L;
29  
30      /**
31       * Whether all existing attributes should be passed
32       * down to the query builder map and be used in the construction
33       * of the filter.
34       */
35      private boolean useAllQueryAttributes = true;
36  
37      /**
38       * Define a {@code Map} of query attribute names to data-layer attribute names to use when building the query.
39       * The key is always the name of the query attribute that is defined by CAS and passed internally,
40       * and the value is the column/field that should map.
41       */
42      private final Map<String, String> queryAttributes = new HashMap<>(0);
43  
44      public boolean isUseAllQueryAttributes() {
45          return useAllQueryAttributes;
46      }
47  
48      public void setUseAllQueryAttributes(final boolean useAllQueryAttributes) {
49          this.useAllQueryAttributes = useAllQueryAttributes;
50      }
51  
52      public Map<String, String> getQueryAttributes() {
53          return queryAttributes;
54      }
55  
56      @Override
57      public Map<String, Object> map(final AttrRepoTO attrRepo, final Mapper mapper) {
58          return mapper.map(attrRepo, this);
59      }
60  }