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.eventi.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.eventi.dao.IEventoServiceSearch;
  26. import org.openspcoop2.core.eventi.dao.IEventoService;

  27. import org.openspcoop2.core.eventi.dao.IServiceManager;

  28. import java.sql.Connection;
  29. import java.util.Properties;

  30. import javax.sql.DataSource;

  31. import org.slf4j.Logger;

  32. /**    
  33.  * Manager that allows you to obtain the services of research and management of objects
  34.  *
  35.  * @author Poli Andrea (poli@link.it)
  36.  * @author $Author$
  37.  * @version $Rev$, $Date$
  38.  */

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

  40.     protected Connection getConnectionInternalResource() {
  41.         return this.connection;
  42.     }
  43.     protected DataSource getDatasourceInternalResource() {
  44.         return this.datasource;
  45.     }
  46.     protected JDBCServiceManagerProperties getJdbcPropertiesInternalResource(){
  47.         return this.jdbcProperties;
  48.     }
  49.     protected Logger getLoggerInternalResource(){
  50.         return this.log;
  51.     }
  52.     @Override
  53.     protected Connection getConnection() throws ServiceException {
  54.         try{
  55.             return super.getConnection();
  56.         }catch(Exception e){
  57.             throw new ServiceException(e.getMessage(),e);
  58.         }
  59.     }
  60.     @Override
  61.     protected void closeConnection(Connection connection) throws ServiceException {
  62.         try{
  63.             super.closeConnection(connection);
  64.         }catch(Exception e){
  65.             throw new ServiceException(e.getMessage(),e);
  66.         }
  67.     }

  68.     protected JDBCServiceManager(){}

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


  141.    


  142.     /*
  143.      =====================================================================================================================
  144.      Services relating to the object with name:evento type:evento
  145.      =====================================================================================================================
  146.     */
  147.    
  148.     /**
  149.      * Return a service used to research on the backend on objects of type {@link org.openspcoop2.core.eventi.Evento}
  150.      *
  151.      * @return Service used to research on the backend on objects of type {@link org.openspcoop2.core.eventi.Evento}    
  152.      * @throws ServiceException Exception thrown when an error occurs during processing of the request
  153.      * @throws NotImplementedException Exception thrown when the method is not implemented
  154.      */
  155.     @Override
  156.     public IEventoServiceSearch getEventoServiceSearch() throws ServiceException,NotImplementedException{
  157.         return new JDBCEventoServiceSearch(this);
  158.     }
  159.    
  160.     /**
  161.      * Return a service used to research and manage on the backend on objects of type {@link org.openspcoop2.core.eventi.Evento}
  162.      *
  163.      * @return Service used to research and manage on the backend on objects of type {@link org.openspcoop2.core.eventi.Evento}
  164.      * @throws ServiceException Exception thrown when an error occurs during processing of the request
  165.      * @throws NotImplementedException Exception thrown when the method is not implemented
  166.      */
  167.     @Override
  168.     public IEventoService getEventoService() throws ServiceException,NotImplementedException{
  169.         return new JDBCEventoService(this);
  170.     }
  171.    
  172.    
  173.    
  174.    

  175. }