View Javadoc
1   package fr.ifremer.tutti.persistence;
2   
3   /*
4    * #%L
5    * Tutti :: Persistence
6    * %%
7    * Copyright (C) 2012 - 2014 Ifremer
8    * %%
9    * This program is free software: you can redistribute it and/or modify
10   * it under the terms of the GNU General Public License as
11   * published by the Free Software Foundation, either version 3 of the 
12   * License, or (at your option) any later version.
13   * 
14   * This program is distributed in the hope that it will be useful,
15   * but WITHOUT ANY WARRANTY; without even the implied warranty of
16   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17   * GNU General Public License for more details.
18   * 
19   * You should have received a copy of the GNU General Public 
20   * License along with this program.  If not, see
21   * <http://www.gnu.org/licenses/gpl-3.0.html>.
22   * #L%
23   */
24  
25  import fr.ifremer.tutti.persistence.model.ProgramDataModel;
26  import fr.ifremer.tutti.persistence.service.AccidentalBatchPersistenceService;
27  import fr.ifremer.tutti.persistence.service.AttachmentPersistenceService;
28  import fr.ifremer.tutti.persistence.service.BenthosBatchPersistenceService;
29  import fr.ifremer.tutti.persistence.service.CatchBatchPersistenceService;
30  import fr.ifremer.tutti.persistence.service.CruisePersistenceService;
31  import fr.ifremer.tutti.persistence.service.FishingOperationPersistenceService;
32  import fr.ifremer.tutti.persistence.service.IndividualObservationBatchPersistenceService;
33  import fr.ifremer.tutti.persistence.service.MarineLitterBatchPersistenceService;
34  import fr.ifremer.tutti.persistence.service.ProgramPersistenceService;
35  import fr.ifremer.tutti.persistence.service.ProtocolPersistenceService;
36  import fr.ifremer.tutti.persistence.service.SpeciesBatchPersistenceService;
37  import fr.ifremer.tutti.persistence.service.TechnicalPersistenceService;
38  import fr.ifremer.tutti.persistence.service.referential.CaracteristicPersistenceService;
39  import fr.ifremer.tutti.persistence.service.referential.GearPersistenceService;
40  import fr.ifremer.tutti.persistence.service.referential.LocationPersistenceService;
41  import fr.ifremer.tutti.persistence.service.referential.ObjectTypePersistenceService;
42  import fr.ifremer.tutti.persistence.service.referential.PersonPersistenceService;
43  import fr.ifremer.tutti.persistence.service.referential.SpeciesPersistenceService;
44  import fr.ifremer.tutti.persistence.service.referential.VesselPersistenceService;
45  import org.springframework.transaction.annotation.Transactional;
46  
47  /**
48   * Contract for a persistence driver used by Tutti.
49   *
50   * @author Tony Chemit - chemit@codelutin.com
51   * @since 0.1
52   */
53  @Transactional(readOnly = true)
54  public interface TuttiPersistence extends TuttiPersistenceServiceImplementor,
55          TechnicalPersistenceService,
56          BenthosBatchPersistenceService,
57          SpeciesBatchPersistenceService,
58          CaracteristicPersistenceService,
59          GearPersistenceService,
60          LocationPersistenceService,
61          ObjectTypePersistenceService,
62          PersonPersistenceService,
63          SpeciesPersistenceService,
64          VesselPersistenceService,
65          CatchBatchPersistenceService,
66          AttachmentPersistenceService,
67          ProgramPersistenceService,
68          CruisePersistenceService,
69          ProtocolPersistenceService,
70          FishingOperationPersistenceService,
71          MarineLitterBatchPersistenceService,
72          AccidentalBatchPersistenceService,
73          IndividualObservationBatchPersistenceService {
74  
75      String getImplementationName();
76  
77      void setSkipShutdownDbWhenClosing();
78  
79      /**
80       * To load a program with all his cruises and fishing operations.
81       *
82       * @param programId            id of the program to load
83       * @param loadFishingOperation flag to load cruise fishing operations
84       * @return loaded program
85       * @since 3.14.3
86       */
87      ProgramDataModel loadProgram(String programId, boolean loadFishingOperation);
88  
89      /**
90       * * To load a program with given cruises and fishing operations.
91       *
92       * @param programId            id of the program to load
93       * @param loadFishingOperation flag to load cruise fishing operations
94       * @param cruiseIds            ids of cruises to load
95       * @return loaded program
96       * @since 3.14.3
97       */
98      ProgramDataModel loadCruises(String programId, boolean loadFishingOperation, Integer... cruiseIds);
99  
100     /**
101      * * To load a program for his given cruise and fishing operations.
102      *
103      * @param programId           id of the program to load
104      * @param cruiseId            id of cruise to load
105      * @param fishingOperationIds ids of fishing operation to load
106      * @return loaded program
107      * @since 3.14.3
108      */
109     ProgramDataModel loadCruise(String programId, Integer cruiseId, Integer... fishingOperationIds);
110 
111 }