JDBCServiceManager.java

  1. /*
  2.  * GovWay - A customizable API Gateway
  3.  * https://govway.org
  4.  *
  5.  * Copyright (c) 2005-2025 Link.it srl (https://link.it).
  6.  *
  7.  * This program is free software: you can redistribute it and/or modify
  8.  * it under the terms of the GNU General Public License version 3, as published by
  9.  * the Free Software Foundation.
  10.  *
  11.  * This program is distributed in the hope that it will be useful,
  12.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14.  * GNU General Public License for more details.
  15.  *
  16.  * You should have received a copy of the GNU General Public License
  17.  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  18.  *
  19.  */
  20. package org.openspcoop2.core.statistiche.dao.jdbc;

  21. import org.openspcoop2.generic_project.exception.NotImplementedException;
  22. import org.openspcoop2.generic_project.exception.ServiceException;
  23. import org.openspcoop2.generic_project.dao.jdbc.JDBCServiceManagerProperties;
  24. import org.openspcoop2.generic_project.utils.ServiceManagerProperties;

  25. import org.openspcoop2.core.statistiche.dao.IStatisticaInfoServiceSearch;
  26. import org.openspcoop2.core.statistiche.dao.IStatisticaInfoService;
  27. import org.openspcoop2.core.statistiche.dao.IStatisticaOrariaServiceSearch;
  28. import org.openspcoop2.core.statistiche.dao.IStatisticaOrariaService;
  29. import org.openspcoop2.core.statistiche.dao.IStatisticaGiornalieraServiceSearch;
  30. import org.openspcoop2.core.statistiche.dao.IStatisticaGiornalieraService;
  31. import org.openspcoop2.core.statistiche.dao.IStatisticaSettimanaleServiceSearch;
  32. import org.openspcoop2.core.statistiche.dao.IStatisticaSettimanaleService;
  33. import org.openspcoop2.core.statistiche.dao.IStatisticaMensileServiceSearch;
  34. import org.openspcoop2.core.statistiche.dao.IStatisticaMensileService;

  35. import org.openspcoop2.core.statistiche.dao.IServiceManager;

  36. import java.sql.Connection;
  37. import java.util.Properties;

  38. import javax.sql.DataSource;

  39. import org.slf4j.Logger;

  40. /**    
  41.  * Manager that allows you to obtain the services of research and management of objects
  42.  *
  43.  * @author Poli Andrea (poli@link.it)
  44.  * @author $Author$
  45.  * @version $Rev$, $Date$
  46.  */

  47. public class JDBCServiceManager extends org.openspcoop2.generic_project.dao.jdbc.JDBCServiceManagerBase implements IServiceManager {

  48.     protected Connection getConnectionInternalResource() {
  49.         return this.connection;
  50.     }
  51.     protected DataSource getDatasourceInternalResource() {
  52.         return this.datasource;
  53.     }
  54.     protected JDBCServiceManagerProperties getJdbcPropertiesInternalResource(){
  55.         return this.jdbcProperties;
  56.     }
  57.     protected Logger getLoggerInternalResource(){
  58.         return this.log;
  59.     }
  60.     @Override
  61.     protected Connection getConnection() throws ServiceException {
  62.         try{
  63.             return super.getConnection();
  64.         }catch(Exception e){
  65.             throw new ServiceException(e.getMessage(),e);
  66.         }
  67.     }
  68.     @Override
  69.     protected void closeConnection(Connection connection) throws ServiceException {
  70.         try{
  71.             super.closeConnection(connection);
  72.         }catch(Exception e){
  73.             throw new ServiceException(e.getMessage(),e);
  74.         }
  75.     }

  76.     protected JDBCServiceManager(){}

  77.     public JDBCServiceManager(String jndiName, Properties contextJNDI,
  78.             ServiceManagerProperties smProperties) throws ServiceException {
  79.         super(jndiName, contextJNDI, smProperties);
  80.     }
  81.     public JDBCServiceManager(String jndiName, Properties contextJNDI,
  82.             JDBCServiceManagerProperties jdbcProperties) throws ServiceException {
  83.         super(jndiName, contextJNDI, jdbcProperties);
  84.     }
  85.     public JDBCServiceManager(String jndiName, Properties contextJNDI,
  86.             ServiceManagerProperties smProperties, Logger alog) throws ServiceException {
  87.         super(jndiName, contextJNDI, smProperties, alog);
  88.     }
  89.     public JDBCServiceManager(String jndiName, Properties contextJNDI,
  90.             JDBCServiceManagerProperties jdbcProperties, Logger alog) throws ServiceException {
  91.         super(jndiName, contextJNDI, jdbcProperties, alog);
  92.     }
  93.    
  94.    
  95.     public JDBCServiceManager(DataSource ds, ServiceManagerProperties smProperties)
  96.             throws ServiceException {
  97.         super(ds, smProperties);
  98.     }
  99.     public JDBCServiceManager(DataSource ds, JDBCServiceManagerProperties jdbcProperties)
  100.             throws ServiceException {
  101.         super(ds, jdbcProperties);
  102.     }
  103.     public JDBCServiceManager(DataSource ds, ServiceManagerProperties smProperties, Logger alog)
  104.             throws ServiceException {
  105.         super(ds, smProperties, alog);
  106.     }
  107.     public JDBCServiceManager(DataSource ds, JDBCServiceManagerProperties jdbcProperties, Logger alog)
  108.             throws ServiceException {
  109.         super(ds, jdbcProperties, alog);
  110.     }
  111.    
  112.    
  113.     public JDBCServiceManager(String connectionUrl, String driverJDBC,
  114.             String username, String password, ServiceManagerProperties smProperties)
  115.             throws ServiceException {
  116.         super(connectionUrl, driverJDBC, username, password, smProperties);
  117.     }
  118.     public JDBCServiceManager(String connectionUrl, String driverJDBC,
  119.             String username, String password, JDBCServiceManagerProperties jdbcProperties)
  120.             throws ServiceException {
  121.         super(connectionUrl, driverJDBC, username, password, jdbcProperties);
  122.     }
  123.     public JDBCServiceManager(String connectionUrl, String driverJDBC,
  124.             String username, String password, ServiceManagerProperties smProperties, Logger alog)
  125.             throws ServiceException {
  126.         super(connectionUrl, driverJDBC, username, password, smProperties, alog);
  127.     }
  128.     public JDBCServiceManager(String connectionUrl, String driverJDBC,
  129.             String username, String password, JDBCServiceManagerProperties jdbcProperties, Logger alog)
  130.             throws ServiceException {
  131.         super(connectionUrl, driverJDBC, username, password, jdbcProperties, alog);
  132.     }
  133.    
  134.    
  135.     public JDBCServiceManager(Connection connection, ServiceManagerProperties smProperties)
  136.             throws ServiceException {
  137.         super(connection, smProperties);
  138.     }
  139.     public JDBCServiceManager(Connection connection, JDBCServiceManagerProperties jdbcProperties)
  140.             throws ServiceException {
  141.         super(connection, jdbcProperties);
  142.     }
  143.     public JDBCServiceManager(Connection connection, ServiceManagerProperties smProperties, Logger alog) throws ServiceException {
  144.         super(connection, smProperties, alog);
  145.     }
  146.     public JDBCServiceManager(Connection connection, JDBCServiceManagerProperties jdbcProperties, Logger alog) throws ServiceException {
  147.         super(connection, jdbcProperties, alog);
  148.     }


  149.    


  150.     /*
  151.      =====================================================================================================================
  152.      Services relating to the object with name:statistica-info type:statistica-info
  153.      =====================================================================================================================
  154.     */
  155.    
  156.     /**
  157.      * Return a service used to research on the backend on objects of type {@link org.openspcoop2.core.statistiche.StatisticaInfo}
  158.      *
  159.      * @return Service used to research on the backend on objects of type {@link org.openspcoop2.core.statistiche.StatisticaInfo}  
  160.      * @throws ServiceException Exception thrown when an error occurs during processing of the request
  161.      * @throws NotImplementedException Exception thrown when the method is not implemented
  162.      */
  163.     @Override
  164.     public IStatisticaInfoServiceSearch getStatisticaInfoServiceSearch() throws ServiceException,NotImplementedException{
  165.         return new JDBCStatisticaInfoServiceSearch(this);
  166.     }
  167.    
  168.     /**
  169.      * Return a service used to research and manage on the backend on objects of type {@link org.openspcoop2.core.statistiche.StatisticaInfo}
  170.      *
  171.      * @return Service used to research and manage on the backend on objects of type {@link org.openspcoop2.core.statistiche.StatisticaInfo}    
  172.      * @throws ServiceException Exception thrown when an error occurs during processing of the request
  173.      * @throws NotImplementedException Exception thrown when the method is not implemented
  174.      */
  175.     @Override
  176.     public IStatisticaInfoService getStatisticaInfoService() throws ServiceException,NotImplementedException{
  177.         return new JDBCStatisticaInfoService(this);
  178.     }
  179.    
  180.    
  181.    
  182.     /*
  183.      =====================================================================================================================
  184.      Services relating to the object with name:statistica-oraria type:statistica-oraria
  185.      =====================================================================================================================
  186.     */
  187.    
  188.     /**
  189.      * Return a service used to research on the backend on objects of type {@link org.openspcoop2.core.statistiche.StatisticaOraria}
  190.      *
  191.      * @return Service used to research on the backend on objects of type {@link org.openspcoop2.core.statistiche.StatisticaOraria}
  192.      * @throws ServiceException Exception thrown when an error occurs during processing of the request
  193.      * @throws NotImplementedException Exception thrown when the method is not implemented
  194.      */
  195.     @Override
  196.     public IStatisticaOrariaServiceSearch getStatisticaOrariaServiceSearch() throws ServiceException,NotImplementedException{
  197.         return new JDBCStatisticaOrariaServiceSearch(this);
  198.     }
  199.    
  200.     /**
  201.      * Return a service used to research and manage on the backend on objects of type {@link org.openspcoop2.core.statistiche.StatisticaOraria}
  202.      *
  203.      * @return Service used to research and manage on the backend on objects of type {@link org.openspcoop2.core.statistiche.StatisticaOraria}  
  204.      * @throws ServiceException Exception thrown when an error occurs during processing of the request
  205.      * @throws NotImplementedException Exception thrown when the method is not implemented
  206.      */
  207.     @Override
  208.     public IStatisticaOrariaService getStatisticaOrariaService() throws ServiceException,NotImplementedException{
  209.         return new JDBCStatisticaOrariaService(this);
  210.     }
  211.    
  212.    
  213.    
  214.     /*
  215.      =====================================================================================================================
  216.      Services relating to the object with name:statistica-giornaliera type:statistica-giornaliera
  217.      =====================================================================================================================
  218.     */
  219.    
  220.     /**
  221.      * Return a service used to research on the backend on objects of type {@link org.openspcoop2.core.statistiche.StatisticaGiornaliera}
  222.      *
  223.      * @return Service used to research on the backend on objects of type {@link org.openspcoop2.core.statistiche.StatisticaGiornaliera}    
  224.      * @throws ServiceException Exception thrown when an error occurs during processing of the request
  225.      * @throws NotImplementedException Exception thrown when the method is not implemented
  226.      */
  227.     @Override
  228.     public IStatisticaGiornalieraServiceSearch getStatisticaGiornalieraServiceSearch() throws ServiceException,NotImplementedException{
  229.         return new JDBCStatisticaGiornalieraServiceSearch(this);
  230.     }
  231.    
  232.     /**
  233.      * Return a service used to research and manage on the backend on objects of type {@link org.openspcoop2.core.statistiche.StatisticaGiornaliera}
  234.      *
  235.      * @return Service used to research and manage on the backend on objects of type {@link org.openspcoop2.core.statistiche.StatisticaGiornaliera}
  236.      * @throws ServiceException Exception thrown when an error occurs during processing of the request
  237.      * @throws NotImplementedException Exception thrown when the method is not implemented
  238.      */
  239.     @Override
  240.     public IStatisticaGiornalieraService getStatisticaGiornalieraService() throws ServiceException,NotImplementedException{
  241.         return new JDBCStatisticaGiornalieraService(this);
  242.     }
  243.    
  244.    
  245.    
  246.     /*
  247.      =====================================================================================================================
  248.      Services relating to the object with name:statistica-settimanale type:statistica-settimanale
  249.      =====================================================================================================================
  250.     */
  251.    
  252.     /**
  253.      * Return a service used to research on the backend on objects of type {@link org.openspcoop2.core.statistiche.StatisticaSettimanale}
  254.      *
  255.      * @return Service used to research on the backend on objects of type {@link org.openspcoop2.core.statistiche.StatisticaSettimanale}    
  256.      * @throws ServiceException Exception thrown when an error occurs during processing of the request
  257.      * @throws NotImplementedException Exception thrown when the method is not implemented
  258.      */
  259.     @Override
  260.     public IStatisticaSettimanaleServiceSearch getStatisticaSettimanaleServiceSearch() throws ServiceException,NotImplementedException{
  261.         return new JDBCStatisticaSettimanaleServiceSearch(this);
  262.     }
  263.    
  264.     /**
  265.      * Return a service used to research and manage on the backend on objects of type {@link org.openspcoop2.core.statistiche.StatisticaSettimanale}
  266.      *
  267.      * @return Service used to research and manage on the backend on objects of type {@link org.openspcoop2.core.statistiche.StatisticaSettimanale}
  268.      * @throws ServiceException Exception thrown when an error occurs during processing of the request
  269.      * @throws NotImplementedException Exception thrown when the method is not implemented
  270.      */
  271.     @Override
  272.     public IStatisticaSettimanaleService getStatisticaSettimanaleService() throws ServiceException,NotImplementedException{
  273.         return new JDBCStatisticaSettimanaleService(this);
  274.     }
  275.    
  276.    
  277.    
  278.     /*
  279.      =====================================================================================================================
  280.      Services relating to the object with name:statistica-mensile type:statistica-mensile
  281.      =====================================================================================================================
  282.     */
  283.    
  284.     /**
  285.      * Return a service used to research on the backend on objects of type {@link org.openspcoop2.core.statistiche.StatisticaMensile}
  286.      *
  287.      * @return Service used to research on the backend on objects of type {@link org.openspcoop2.core.statistiche.StatisticaMensile}    
  288.      * @throws ServiceException Exception thrown when an error occurs during processing of the request
  289.      * @throws NotImplementedException Exception thrown when the method is not implemented
  290.      */
  291.     @Override
  292.     public IStatisticaMensileServiceSearch getStatisticaMensileServiceSearch() throws ServiceException,NotImplementedException{
  293.         return new JDBCStatisticaMensileServiceSearch(this);
  294.     }
  295.    
  296.     /**
  297.      * Return a service used to research and manage on the backend on objects of type {@link org.openspcoop2.core.statistiche.StatisticaMensile}
  298.      *
  299.      * @return Service used to research and manage on the backend on objects of type {@link org.openspcoop2.core.statistiche.StatisticaMensile}
  300.      * @throws ServiceException Exception thrown when an error occurs during processing of the request
  301.      * @throws NotImplementedException Exception thrown when the method is not implemented
  302.      */
  303.     @Override
  304.     public IStatisticaMensileService getStatisticaMensileService() throws ServiceException,NotImplementedException{
  305.         return new JDBCStatisticaMensileService(this);
  306.     }
  307.    
  308.    
  309.    
  310.    

  311. }