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.core.rest.cxf;
20  
21  import org.apache.syncope.common.rest.api.service.ConnectorService;
22  import org.apache.syncope.common.rest.api.service.ReconciliationService;
23  import org.apache.syncope.common.rest.api.service.RemediationService;
24  import org.apache.syncope.common.rest.api.service.ResourceService;
25  import org.apache.syncope.core.logic.ConnectorLogic;
26  import org.apache.syncope.core.logic.ReconciliationLogic;
27  import org.apache.syncope.core.logic.RemediationLogic;
28  import org.apache.syncope.core.logic.ResourceLogic;
29  import org.apache.syncope.core.persistence.api.dao.AnyObjectDAO;
30  import org.apache.syncope.core.persistence.api.dao.GroupDAO;
31  import org.apache.syncope.core.persistence.api.dao.UserDAO;
32  import org.apache.syncope.core.persistence.api.search.SearchCondVisitor;
33  import org.apache.syncope.core.rest.cxf.service.ConnectorServiceImpl;
34  import org.apache.syncope.core.rest.cxf.service.ReconciliationServiceImpl;
35  import org.apache.syncope.core.rest.cxf.service.RemediationServiceImpl;
36  import org.apache.syncope.core.rest.cxf.service.ResourceServiceImpl;
37  import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
38  import org.springframework.context.annotation.Bean;
39  import org.springframework.context.annotation.Configuration;
40  
41  @Configuration(proxyBeanMethods = false)
42  public class IdMRESTCXFContext {
43  
44      @ConditionalOnMissingBean
45      @Bean
46      public ConnectorService connectorService(final ConnectorLogic connectorLogic) {
47          return new ConnectorServiceImpl(connectorLogic);
48      }
49  
50      @ConditionalOnMissingBean
51      @Bean
52      public ReconciliationService reconciliationService(
53              final SearchCondVisitor searchCondVisitor,
54              final ReconciliationLogic reconciliationLogic) {
55  
56          return new ReconciliationServiceImpl(searchCondVisitor, reconciliationLogic);
57      }
58  
59      @ConditionalOnMissingBean
60      @Bean
61      public RemediationService remediationService(
62              final RemediationLogic remediationLogic,
63              final UserDAO userDAO,
64              final GroupDAO groupDAO,
65              final AnyObjectDAO anyObjectDAO) {
66  
67          return new RemediationServiceImpl(remediationLogic, userDAO, groupDAO, anyObjectDAO);
68      }
69  
70      @ConditionalOnMissingBean
71      @Bean
72      public ResourceService resourceService(final ResourceLogic resourceLogic) {
73          return new ResourceServiceImpl(resourceLogic);
74      }
75  }