View Javadoc
1   package net.sumaris.core.service;
2   
3   /*-
4    * #%L
5    * SUMARiS :: Sumaris Core Shared
6    * $Id:$
7    * $HeadURL:$
8    * %%
9    * Copyright (C) 2018 SUMARiS Consortium
10   * %%
11   * This program is free software: you can redistribute it and/or modify
12   * it under the terms of the GNU General Public License as
13   * published by the Free Software Foundation, either version 3 of the
14   * License, or (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 General Public
22   * License along with this program.  If not, see
23   * <http://www.gnu.org/licenses/gpl-3.0.html>.
24   * #L%
25   */
26  
27  import net.sumaris.core.service.administration.DepartmentService;
28  import net.sumaris.core.service.administration.PersonService;
29  import net.sumaris.core.service.data.OperationService;
30  import net.sumaris.core.service.data.TripService;
31  import net.sumaris.core.service.referential.ReferentialService;
32  import net.sumaris.core.service.schema.DatabaseSchemaService;
33  import net.sumaris.core.service.technical.SoftwareService;
34  
35  /**
36   * Locates and provides all available application services.
37   */
38  public class CoreServiceLocator {
39  
40      /**
41       * <p>getDatabaseSchemaService.</p>
42       *
43       * @return a {@link DatabaseSchemaService} object.
44       */
45      public static DatabaseSchemaService getDatabaseSchemaService() {
46          return ServiceLocator.instance().getService("databaseSchemaService", DatabaseSchemaService.class);
47      }
48  
49      /**
50       * <p>getTripService.</p>
51       *
52       * @return a {@link TripService} object.
53       */
54      public static TripService getTripService() {
55          return ServiceLocator.instance().getService("tripService", TripService.class);
56      }
57  
58      /**
59       * <p>getTripService.</p>
60       *
61       * @return a {@link TripService} object.
62       */
63      public static OperationService getOperationService() {
64          return ServiceLocator.instance().getService("operationService", OperationService.class);
65      }
66  
67      /**
68       * <p>getPersonService.</p>
69       *
70       * @return a {@link PersonService} object.
71       */
72      public static PersonService getPersonService() {
73          return ServiceLocator.instance().getService("personService", PersonService.class);
74      }
75  
76      /**
77       * <p>getDepartmentService.</p>
78       *
79       * @return a {@link DepartmentService} object.
80       */
81      public static DepartmentService getDepartmentService() {
82          return ServiceLocator.instance().getService("departmentService", DepartmentService.class);
83      }
84  
85      /**
86       * <p>getReferentialService.</p>
87       *
88       * @return a {@link ReferentialService} object.
89       */
90      public static ReferentialService getReferentialService() {
91          return ServiceLocator.instance().getService("referentialService", ReferentialService.class);
92      }
93  
94      /**
95       * <p>getDatabaseSchemaService.</p>
96       *
97       * @return a {@link DatabaseSchemaService} object.
98       */
99      public static SoftwareService getPodConfigService() {
100         return ServiceLocator.instance().getService("podConfigService", SoftwareService.class);
101     }
102 }