View Javadoc
1   package fr.ifremer.quadrige3.synchro.server.service;
2   
3   /*-
4    * #%L
5    * Quadrige3 Core :: Quadrige3 Synchro server
6    * $Id:$
7    * $HeadURL:$
8    * %%
9    * Copyright (C) 2017 Ifremer
10   * %%
11   * This program is free software: you can redistribute it and/or modify
12   * it under the terms of the GNU Affero General Public License as published by
13   * the Free Software Foundation, either version 3 of the License, or
14   * (at your option) any later version.
15   * 
16   * This program is distributed in the hope that it will be useful,
17   * but WITHOUT ANY WARRANTY; without even the implied warranty of
18   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19   * GNU General Public License for more details.
20   * 
21   * You should have received a copy of the GNU Affero General Public License
22   * along with this program.  If not, see <http://www.gnu.org/licenses/>.
23   * #L%
24   */
25  
26  import fr.ifremer.quadrige3.core.service.administration.program.ProgramService;
27  import fr.ifremer.quadrige3.core.service.administration.user.UserService;
28  import fr.ifremer.quadrige3.core.service.data.photo.PhotoService;
29  import fr.ifremer.quadrige3.core.service.data.survey.CampaignService;
30  import fr.ifremer.quadrige3.core.service.system.generalCondition.GeneralConditionService;
31  import fr.ifremer.quadrige3.core.service.system.rule.RuleListService;
32  import fr.ifremer.quadrige3.synchro.server.service.synchro.DataSynchroService;
33  import fr.ifremer.quadrige3.synchro.server.service.synchro.DocSynchroService;
34  import fr.ifremer.quadrige3.synchro.server.service.synchro.ReferentialSynchroService;
35  import fr.ifremer.quadrige3.synchro.server.service.synchro.job.SynchroJobService;
36  import fr.ifremer.quadrige3.synchro.server.service.technical.DatabaseSchemaService;
37  import org.springframework.core.task.AsyncTaskExecutor;
38  import org.springframework.mail.javamail.JavaMailSender;
39  import org.springframework.security.authentication.AuthenticationManager;
40  
41  public class ServiceLocator extends fr.ifremer.quadrige3.core.service.ServiceLocator {
42  
43      static {
44          instance = new ServiceLocator();
45          initDefault();
46      }
47  
48      private static final ServiceLocator instance;
49  
50      public static void initDefault() {
51          instance.init("uiBeanRefFactory.xml", "beanRefFactory");
52          fr.ifremer.quadrige3.core.service.ServiceLocator.setInstance(instance);
53      }
54  
55      public static ServiceLocator instance() {
56          return instance;
57      }
58  
59      public ReferentialSynchroService getReferentialSynchroService() {
60          return getService("referentialSynchroService", ReferentialSynchroService.class);
61      }
62  
63      public DataSynchroService getDataSynchroService() {
64          return getService("dataSynchroService", DataSynchroService.class);
65      }
66  
67      public DatabaseSchemaService getDatabaseSchemaService() {
68          return getService("databaseSchemaService", DatabaseSchemaService.class);
69      }
70      
71      public SynchroJobService getSynchroJobService() {
72          return getService("synchroJobService", SynchroJobService.class);
73      }
74      
75      public UserService getUserService() {
76          return getService("userService", UserService.class);
77      }
78  
79      public GeneralConditionService getGeneralConditionService() {
80          return getService("generalConditionService", GeneralConditionService.class);
81      }
82  
83      public AsyncTaskExecutor getTaskExecutor() {
84          return getService("pooledTaskExecutor", AsyncTaskExecutor.class);
85      }
86  
87      public AuthenticationManager getAuthenticationManager() {
88          return getService("authenticationManager", AuthenticationManager.class);
89      }
90  
91      public ProgramService getProgramService() {
92          return getService("programService", ProgramService.class);
93      }
94  
95      public CampaignService getCampaignService() {
96          return getService("campaignService", CampaignService.class);
97      }
98  
99      public RuleListService getRuleListService() {
100         return getService("ruleListService", RuleListService.class);
101     }
102 
103     public PhotoService getPhotoService() {
104         return getService("photoService", PhotoService.class);
105     }
106 
107     public DocSynchroService getDocSynchroService() {
108         return getService("docSynchroService", DocSynchroService.class);
109     }
110 
111     public JavaMailSender getMailSender() {
112         return getService("mailSender", JavaMailSender.class);
113     }
114 
115 
116 }