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.SyncopeConstants;
24  import org.apache.syncope.common.lib.to.AttrRepoTO;
25  
26  public class SyncopeAttrRepoConf implements AttrRepoConf {
27  
28      private static final long serialVersionUID = -3334329948161152222L;
29  
30      private String domain = SyncopeConstants.MASTER_DOMAIN;
31  
32      /**
33       * User FIQL filter to use for searching.
34       */
35      protected String searchFilter;
36  
37      /**
38       * Specify the username for REST authentication.
39       */
40      private String basicAuthUsername;
41  
42      /**
43       * Specify the password for REST authentication.
44       */
45      private String basicAuthPassword;
46  
47      /**
48       * Headers, defined as a Map, to include in the request when making the REST call.
49       * Will overwrite any header that CAS is pre-defined to
50       * send and include in the request. Key in the map should be the header name
51       * and the value in the map should be the header value.
52       */
53      private final Map<String, String> headers = new HashMap<>();
54  
55      public String getDomain() {
56          return domain;
57      }
58  
59      public void setDomain(final String domain) {
60          this.domain = domain;
61      }
62  
63      public String getSearchFilter() {
64          return searchFilter;
65      }
66  
67      public void setSearchFilter(final String searchFilter) {
68          this.searchFilter = searchFilter;
69      }
70  
71      public String getBasicAuthUsername() {
72          return basicAuthUsername;
73      }
74  
75      public void setBasicAuthUsername(final String basicAuthUsername) {
76          this.basicAuthUsername = basicAuthUsername;
77      }
78  
79      public String getBasicAuthPassword() {
80          return basicAuthPassword;
81      }
82  
83      public void setBasicAuthPassword(final String basicAuthPassword) {
84          this.basicAuthPassword = basicAuthPassword;
85      }
86  
87      public Map<String, String> getHeaders() {
88          return headers;
89      }
90  
91      @Override
92      public Map<String, Object> map(final AttrRepoTO attrRepo, final Mapper mapper) {
93          return mapper.map(attrRepo, this);
94      }
95  }