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.xml;
22  
23  import org.waarp.openr66.dao.BusinessDAO;
24  import org.waarp.openr66.dao.DAOFactory;
25  import org.waarp.openr66.dao.HostDAO;
26  import org.waarp.openr66.dao.LimitDAO;
27  import org.waarp.openr66.dao.MultipleMonitorDAO;
28  import org.waarp.openr66.dao.RuleDAO;
29  import org.waarp.openr66.dao.TransferDAO;
30  import org.waarp.openr66.dao.exception.DAOConnectionException;
31  
32  public class XMLDAOFactory extends DAOFactory {
33  
34    public XMLDAOFactory() {
35      // Empty
36    }
37  
38    @Override
39    public BusinessDAO getBusinessDAO(final boolean isCacheable) {
40      return new XMLBusinessDAO();
41    }
42  
43    @Override
44    public HostDAO getHostDAO(final boolean isCacheable) {
45      return new XMLHostDAO();
46    }
47  
48    @Override
49    public LimitDAO getLimitDAO(final boolean isCacheable)
50        throws DAOConnectionException {
51      return new XMLLimitDAO();
52    }
53  
54    @Override
55    public MultipleMonitorDAO getMultipleMonitorDAO(final boolean isCacheable)
56        throws DAOConnectionException {
57      throw new DAOConnectionException(
58          "MultipleMonitor is not supported on XML DAO");
59    }
60  
61    @Override
62    public RuleDAO getRuleDAO(final boolean isCacheable) {
63      return new XMLRuleDAO();
64    }
65  
66    @Override
67    public TransferDAO getTransferDAO() {
68      return new XMLTransferDAO();
69    }
70  
71    @Override
72    public String getLimitRequest(final String request, final int limit,
73                                  final int offset) {
74      return request;
75    }
76  
77  }