View Javadoc
1   package fr.ifremer.tutti.persistence.service;
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.TuttiPersistenceServiceImplementor;
26  import fr.ifremer.tutti.persistence.entities.protocol.TuttiProtocol;
27  
28  import java.util.List;
29  
30  /**
31   * CRUD of {@link TuttiProtocol} entity.
32   *
33   * @author Tony Chemit - chemit@codelutin.com
34   * @since 0.3
35   */
36  public interface ProtocolPersistenceService extends TuttiPersistenceServiceImplementor {
37  
38      /**
39       * The protocol used by the persistence lay (used to consolidate entites).
40       *
41       * @return The protocol used by the persistence layer
42       * @see #setProtocol(TuttiProtocol)
43       * @since 2.6
44       */
45      TuttiProtocol getProtocol();
46  
47      /**
48       * Set the protocol to use by the persistence layer.
49       *
50       * @param protocol the new protocol to use (can be null)
51       * @see #getProtocol()
52       * @since 2.6
53       */
54      void setProtocol(TuttiProtocol protocol);
55  
56      boolean isProtocolExist(String id);
57  
58      /**
59       * Given a {@code protocolName}, find out the first available protocol name.
60       *
61       * If this name is already used, then suffix with {@code -0}, {@code -1}, until one is not used.
62       *
63       * @param protocolName base protocle name
64       * @return the first available protocol name base on the given one.
65       * @since 3.14
66       */
67      String getFirstAvailableName(String protocolName);
68  
69      TuttiProtocol getProtocolByName(String protocolName);
70  
71      List<String> getAllProtocolId();
72  
73      List<String> getAllProtocolNames();
74  
75      List<TuttiProtocol> getAllProtocol();
76  
77      /**
78       *
79       * @param programId l'identifiant de la série de compagne (peut-être null)
80       * @return la liste des protocoles dont le {@code programId} est celui passé en paramètre
81       */
82      List<TuttiProtocol> getAllProtocol(String programId);
83  
84      TuttiProtocol getProtocol(String id);
85  
86      TuttiProtocol createProtocol(TuttiProtocol bean);
87  
88      TuttiProtocol saveProtocol(TuttiProtocol bean);
89  
90      void deleteProtocol(String protocolId);
91  }