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.plugins.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.plugins.dao.IPluginServiceSearch;
  26. import org.openspcoop2.core.plugins.dao.IPluginService;
  27. import org.openspcoop2.core.plugins.dao.IConfigurazioneServizioServiceSearch;
  28. import org.openspcoop2.core.plugins.dao.IConfigurazioneServizioService;
  29. import org.openspcoop2.core.plugins.dao.IConfigurazioneServizioAzioneServiceSearch;
  30. import org.openspcoop2.core.plugins.dao.IConfigurazioneServizioAzioneService;
  31. import org.openspcoop2.core.plugins.dao.IConfigurazioneFiltroServiceSearch;
  32. import org.openspcoop2.core.plugins.dao.IConfigurazioneFiltroService;

  33. import org.openspcoop2.core.plugins.dao.IServiceManager;

  34. import java.sql.Connection;
  35. import java.util.Properties;

  36. import javax.sql.DataSource;

  37. import org.slf4j.Logger;

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

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

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

  74.     protected JDBCServiceManager(){}

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


  147.    


  148.     /*
  149.      =====================================================================================================================
  150.      Services relating to the object with name:plugin type:plugin
  151.      =====================================================================================================================
  152.     */
  153.    
  154.     /**
  155.      * Return a service used to research on the backend on objects of type {@link org.openspcoop2.core.plugins.Plugin}
  156.      *
  157.      * @return Service used to research on the backend on objects of type {@link org.openspcoop2.core.plugins.Plugin}  
  158.      * @throws ServiceException Exception thrown when an error occurs during processing of the request
  159.      * @throws NotImplementedException Exception thrown when the method is not implemented
  160.      */
  161.     @Override
  162.     public IPluginServiceSearch getPluginServiceSearch() throws ServiceException,NotImplementedException{
  163.         return new JDBCPluginServiceSearch(this);
  164.     }
  165.    
  166.     /**
  167.      * Return a service used to research and manage on the backend on objects of type {@link org.openspcoop2.core.plugins.Plugin}
  168.      *
  169.      * @return Service used to research and manage on the backend on objects of type {@link org.openspcoop2.core.plugins.Plugin}    
  170.      * @throws ServiceException Exception thrown when an error occurs during processing of the request
  171.      * @throws NotImplementedException Exception thrown when the method is not implemented
  172.      */
  173.     @Override
  174.     public IPluginService getPluginService() throws ServiceException,NotImplementedException{
  175.         return new JDBCPluginService(this);
  176.     }
  177.    
  178.    
  179.    
  180.     /*
  181.      =====================================================================================================================
  182.      Services relating to the object with name:configurazione-servizio type:configurazione-servizio
  183.      =====================================================================================================================
  184.     */
  185.    
  186.     /**
  187.      * Return a service used to research on the backend on objects of type {@link org.openspcoop2.core.plugins.ConfigurazioneServizio}
  188.      *
  189.      * @return Service used to research on the backend on objects of type {@link org.openspcoop2.core.plugins.ConfigurazioneServizio}  
  190.      * @throws ServiceException Exception thrown when an error occurs during processing of the request
  191.      * @throws NotImplementedException Exception thrown when the method is not implemented
  192.      */
  193.     @Override
  194.     public IConfigurazioneServizioServiceSearch getConfigurazioneServizioServiceSearch() throws ServiceException,NotImplementedException{
  195.         return new JDBCConfigurazioneServizioServiceSearch(this);
  196.     }
  197.    
  198.     /**
  199.      * Return a service used to research and manage on the backend on objects of type {@link org.openspcoop2.core.plugins.ConfigurazioneServizio}
  200.      *
  201.      * @return Service used to research and manage on the backend on objects of type {@link org.openspcoop2.core.plugins.ConfigurazioneServizio}    
  202.      * @throws ServiceException Exception thrown when an error occurs during processing of the request
  203.      * @throws NotImplementedException Exception thrown when the method is not implemented
  204.      */
  205.     @Override
  206.     public IConfigurazioneServizioService getConfigurazioneServizioService() throws ServiceException,NotImplementedException{
  207.         return new JDBCConfigurazioneServizioService(this);
  208.     }
  209.    
  210.    
  211.    
  212.     /*
  213.      =====================================================================================================================
  214.      Services relating to the object with name:configurazione-servizio-azione type:configurazione-servizio-azione
  215.      =====================================================================================================================
  216.     */
  217.    
  218.     /**
  219.      * Return a service used to research on the backend on objects of type {@link org.openspcoop2.core.plugins.ConfigurazioneServizioAzione}
  220.      *
  221.      * @return Service used to research on the backend on objects of type {@link org.openspcoop2.core.plugins.ConfigurazioneServizioAzione}
  222.      * @throws ServiceException Exception thrown when an error occurs during processing of the request
  223.      * @throws NotImplementedException Exception thrown when the method is not implemented
  224.      */
  225.     @Override
  226.     public IConfigurazioneServizioAzioneServiceSearch getConfigurazioneServizioAzioneServiceSearch() throws ServiceException,NotImplementedException{
  227.         return new JDBCConfigurazioneServizioAzioneServiceSearch(this);
  228.     }
  229.    
  230.     /**
  231.      * Return a service used to research and manage on the backend on objects of type {@link org.openspcoop2.core.plugins.ConfigurazioneServizioAzione}
  232.      *
  233.      * @return Service used to research and manage on the backend on objects of type {@link org.openspcoop2.core.plugins.ConfigurazioneServizioAzione}  
  234.      * @throws ServiceException Exception thrown when an error occurs during processing of the request
  235.      * @throws NotImplementedException Exception thrown when the method is not implemented
  236.      */
  237.     @Override
  238.     public IConfigurazioneServizioAzioneService getConfigurazioneServizioAzioneService() throws ServiceException,NotImplementedException{
  239.         return new JDBCConfigurazioneServizioAzioneService(this);
  240.     }
  241.    
  242.    
  243.    
  244.     /*
  245.      =====================================================================================================================
  246.      Services relating to the object with name:configurazione-filtro type:configurazione-filtro
  247.      =====================================================================================================================
  248.     */
  249.    
  250.     /**
  251.      * Return a service used to research on the backend on objects of type {@link org.openspcoop2.core.plugins.ConfigurazioneFiltro}
  252.      *
  253.      * @return Service used to research on the backend on objects of type {@link org.openspcoop2.core.plugins.ConfigurazioneFiltro}
  254.      * @throws ServiceException Exception thrown when an error occurs during processing of the request
  255.      * @throws NotImplementedException Exception thrown when the method is not implemented
  256.      */
  257.     @Override
  258.     public IConfigurazioneFiltroServiceSearch getConfigurazioneFiltroServiceSearch() throws ServiceException,NotImplementedException{
  259.         return new JDBCConfigurazioneFiltroServiceSearch(this);
  260.     }
  261.    
  262.     /**
  263.      * Return a service used to research and manage on the backend on objects of type {@link org.openspcoop2.core.plugins.ConfigurazioneFiltro}
  264.      *
  265.      * @return Service used to research and manage on the backend on objects of type {@link org.openspcoop2.core.plugins.ConfigurazioneFiltro}  
  266.      * @throws ServiceException Exception thrown when an error occurs during processing of the request
  267.      * @throws NotImplementedException Exception thrown when the method is not implemented
  268.      */
  269.     @Override
  270.     public IConfigurazioneFiltroService getConfigurazioneFiltroService() throws ServiceException,NotImplementedException{
  271.         return new JDBCConfigurazioneFiltroService(this);
  272.     }
  273.    
  274.    
  275.    
  276.    

  277. }