View Javadoc
1   package fr.ifremer.dali.service.control;
2   
3   /*
4    * #%L
5    * Dali :: Core
6    * $Id:$
7    * $HeadURL:$
8    * %%
9    * Copyright (C) 2014 - 2015 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  
27  import fr.ifremer.dali.dto.configuration.control.ControlRuleDTO;
28  import fr.ifremer.dali.dto.data.survey.SurveyDTO;
29  import fr.ifremer.quadrige3.core.ProgressionCoreModel;
30  import org.springframework.security.access.prepost.PreAuthorize;
31  import org.springframework.transaction.annotation.Transactional;
32  
33  import java.util.Collection;
34  
35  /**
36   * Rules control service.
37   */
38  public interface ControlRuleService {
39  
40      /**
41       * <p>controlSurveys.</p>
42       *
43       * @param surveys a {@link Collection} object.
44       * @param updateControlDateWhenSucceed Should update control date, when control succeed for a survey ?
45       * @param resetControlDateWhenFailed Should reset to NULL the control date, when control failed for a survey ?
46       * @param progressionModel progression model
47       * @return a {@link fr.ifremer.dali.service.control.ControlRuleMessagesBean} object.
48       */
49      @Transactional()
50      @PreAuthorize("hasPermission(null, T(fr.ifremer.quadrige3.core.security.QuadrigeUserAuthority).USER)")
51      ControlRuleMessagesBean controlSurveys(Collection<? extends SurveyDTO> surveys,
52                                             boolean updateControlDateWhenSucceed,
53                                             boolean resetControlDateWhenFailed, ProgressionCoreModel progressionModel);
54  
55      /**
56       * <p>controlSurvey.</p>
57       *
58       * @param survey a {@link fr.ifremer.dali.dto.data.survey.SurveyDTO} object.
59       * @param updateControlDateWhenSucceed Should update control date, when control succeed ?
60       * @param resetControlDateWhenFailed Should reset to NULL the control date, when control failed ?
61       * @return a {@link fr.ifremer.dali.service.control.ControlRuleMessagesBean} object.
62       */
63      @Transactional()
64      @PreAuthorize("hasPermission(null, T(fr.ifremer.quadrige3.core.security.QuadrigeUserAuthority).USER)")
65      ControlRuleMessagesBean controlSurvey(SurveyDTO survey,
66                                            boolean updateControlDateWhenSucceed,
67                                            boolean resetControlDateWhenFailed);
68  
69      boolean controlUniqueObject(ControlRuleDTO rule, Object objectToControl);
70  }