View Javadoc
1   /*
2    * This file is part of Waarp Project (named also Waarp or GG).
3    *
4    *  Copyright (c) 2019, Waarp SAS, and individual contributors by the @author
5    *  tags. See the COPYRIGHT.txt in the distribution for a full listing of
6    * individual contributors.
7    *
8    *  All Waarp Project is free software: you can redistribute it and/or
9    * modify it under the terms of the GNU General Public License as published by
10   * the Free Software Foundation, either version 3 of the License, or (at your
11   * option) any later version.
12   *
13   * Waarp is distributed in the hope that it will be useful, but WITHOUT ANY
14   * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
15   * A PARTICULAR PURPOSE. See the GNU General Public License for more details.
16   *
17   *  You should have received a copy of the GNU General Public License along with
18   * Waarp . If not, see <http://www.gnu.org/licenses/>.
19   */
20  
21  package org.waarp.openr66.dao;
22  
23  import org.waarp.openr66.dao.exception.DAOConnectionException;
24  import org.waarp.openr66.dao.exception.DAONoDataException;
25  import org.waarp.openr66.pojo.Transfer;
26  
27  import java.util.List;
28  
29  /**
30   * Interface to interact with Transfer objects in the persistance layer
31   */
32  public interface TransferDAO extends AbstractDAO<Transfer> {
33  
34    /**
35     * Retrieve all Transfer objects to the given filters in a List from the
36     * persistance layer
37     *
38     * @param filters List of filter
39     *
40     * @throws DAOConnectionException If data access error occurs
41     */
42    List<Transfer> find(List<Filter> filters, int limit)
43        throws DAOConnectionException;
44  
45    /**
46     * Retrieve all Transfer objects to the given filters in a List from the
47     * persistance layer
48     *
49     * @param filters List of filter
50     *
51     * @throws DAOConnectionException If data access error occurs
52     */
53    List<Transfer> find(List<Filter> filters, int limit, int offset)
54        throws DAOConnectionException;
55  
56    /**
57     * Retrieve all Transfer objects to the given filters in a List from the
58     * persistance layer
59     *
60     * @param filters List of filter
61     *
62     * @throws DAOConnectionException If data access error occurs
63     */
64    List<Transfer> find(List<Filter> filters, String column, boolean ascend)
65        throws DAOConnectionException;
66  
67    /**
68     * Retrieve all Transfer objects to the given filters in a List from the
69     * persistance layer
70     *
71     * @param filters List of filter
72     *
73     * @throws DAOConnectionException If data access error occurs
74     */
75    List<Transfer> find(List<Filter> filters, String column, boolean ascend,
76                        int limit) throws DAOConnectionException;
77  
78    /**
79     * Retrieve all Transfer objects to the given filters in a List from the
80     * persistance layer
81     *
82     * @param filters List of filter
83     *
84     * @throws DAOConnectionException If data access error occurs
85     */
86    List<Transfer> find(List<Filter> filters, String column, boolean ascend,
87                        int limit, int offset) throws DAOConnectionException;
88  
89    /**
90     * Retrieve Transfer objects count with the given filters
91     *
92     * @param filters List of filter
93     *
94     * @return the count of Transfer objects
95     *
96     * @throws DAOConnectionException If data access error occurs
97     */
98    long count(List<Filter> filters) throws DAOConnectionException;
99  
100   /**
101    * Retrieve the Transfer object with the specified Special ID from the
102    * persistance layer
103    *
104    * @param id special ID of the Transfer object requested
105    *
106    * @throws DAOConnectionException If a data access error occurs
107    * @throws DAONoDataException if no data are available
108    */
109   Transfer select(long id, String requester, String requested, String owner)
110       throws DAOConnectionException, DAONoDataException;
111 
112   /**
113    * Verify if a Transfer object with the specified Special ID exists in the
114    * persistance layer
115    *
116    * @param id special ID of the Transfer object verified
117    *
118    * @return true if a Transfer object with the specified Special ID exist;
119    *     false if no Transfer object
120    *     correspond to the specified Special ID.
121    *
122    * @throws DAOConnectionException If a data access error occurs
123    */
124   boolean exist(long id, String requester, String requested, String owner)
125       throws DAOConnectionException;
126 }