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.client.enduser;
20  
21  import org.apache.syncope.client.enduser.commons.PreviewUtils;
22  import org.apache.syncope.client.enduser.init.ClassPathScanImplementationLookup;
23  import org.apache.syncope.client.enduser.rest.AnyTypeRestClient;
24  import org.apache.syncope.client.enduser.rest.GroupRestClient;
25  import org.apache.syncope.client.enduser.rest.SchemaRestClient;
26  import org.apache.syncope.client.enduser.rest.SecurityQuestionRestClient;
27  import org.apache.syncope.client.enduser.rest.SyncopeRestClient;
28  import org.apache.syncope.client.enduser.rest.UserSelfRestClient;
29  import org.apache.syncope.client.ui.commons.MIMETypesLoader;
30  import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
31  import org.springframework.context.annotation.Bean;
32  import org.springframework.context.annotation.Configuration;
33  
34  @Configuration(proxyBeanMethods = false)
35  public class IdRepoEnduserContext {
36  
37      @ConditionalOnMissingBean
38      @Bean
39      public ClassPathScanImplementationLookup classPathScanImplementationLookup() {
40          ClassPathScanImplementationLookup lookup = new ClassPathScanImplementationLookup();
41          lookup.load();
42          return lookup;
43      }
44  
45      @ConditionalOnMissingBean
46      @Bean
47      public MIMETypesLoader mimeTypesLoader() {
48          MIMETypesLoader mimeTypesLoader = new MIMETypesLoader();
49          mimeTypesLoader.load();
50          return mimeTypesLoader;
51      }
52  
53      @ConditionalOnMissingBean
54      @Bean
55      public PreviewUtils previewUtils(final ClassPathScanImplementationLookup lookup) {
56          return new PreviewUtils(lookup);
57      }
58  
59      @ConditionalOnMissingBean
60      @Bean
61      public AnyTypeRestClient anyTypeRestClient() {
62          return new AnyTypeRestClient();
63      }
64  
65      @ConditionalOnMissingBean
66      @Bean
67      public GroupRestClient groupRestClient() {
68          return new GroupRestClient();
69      }
70  
71      @ConditionalOnMissingBean
72      @Bean
73      public SchemaRestClient schemaRestClient() {
74          return new SchemaRestClient();
75      }
76  
77      @ConditionalOnMissingBean
78      @Bean
79      public SecurityQuestionRestClient securityQuestionRestClient() {
80          return new SecurityQuestionRestClient();
81      }
82  
83      @ConditionalOnMissingBean
84      @Bean
85      public SyncopeRestClient syncopeRestClient() {
86          return new SyncopeRestClient();
87      }
88  
89      @ConditionalOnMissingBean
90      @Bean
91      public UserSelfRestClient userSelfRestClient() {
92          return new UserSelfRestClient();
93      }
94  }