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.transazioni.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.transazioni.dao.ICredenzialeMittenteServiceSearch;
  26. import org.openspcoop2.core.transazioni.dao.ICredenzialeMittenteService;
  27. import org.openspcoop2.core.transazioni.dao.ITransazioneServiceSearch;
  28. import org.openspcoop2.core.transazioni.dao.ITransazioneService;
  29. import org.openspcoop2.core.transazioni.dao.ITransazioneApplicativoServerServiceSearch;
  30. import org.openspcoop2.core.transazioni.dao.ITransazioneApplicativoServerService;
  31. import org.openspcoop2.core.transazioni.dao.ITransazioneInfoServiceSearch;
  32. import org.openspcoop2.core.transazioni.dao.ITransazioneInfoService;
  33. import org.openspcoop2.core.transazioni.dao.ITransazioneExportServiceSearch;
  34. import org.openspcoop2.core.transazioni.dao.ITransazioneExportService;
  35. import org.openspcoop2.core.transazioni.dao.IDumpMessaggioServiceSearch;
  36. import org.openspcoop2.core.transazioni.dao.IDumpMessaggioService;

  37. import org.openspcoop2.core.transazioni.dao.IServiceManager;

  38. import java.sql.Connection;
  39. import java.util.Properties;

  40. import javax.sql.DataSource;

  41. import org.slf4j.Logger;

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

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

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

  78.     protected JDBCServiceManager(){}

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


  151.    


  152.     /*
  153.      =====================================================================================================================
  154.      Services relating to the object with name:credenziale-mittente type:credenziale-mittente
  155.      =====================================================================================================================
  156.     */
  157.    
  158.     /**
  159.      * Return a service used to research on the backend on objects of type {@link org.openspcoop2.core.transazioni.CredenzialeMittente}
  160.      *
  161.      * @return Service used to research on the backend on objects of type {@link org.openspcoop2.core.transazioni.CredenzialeMittente}  
  162.      * @throws ServiceException Exception thrown when an error occurs during processing of the request
  163.      * @throws NotImplementedException Exception thrown when the method is not implemented
  164.      */
  165.     @Override
  166.     public ICredenzialeMittenteServiceSearch getCredenzialeMittenteServiceSearch() throws ServiceException,NotImplementedException{
  167.         return new JDBCCredenzialeMittenteServiceSearch(this);
  168.     }
  169.    
  170.     /**
  171.      * Return a service used to research and manage on the backend on objects of type {@link org.openspcoop2.core.transazioni.CredenzialeMittente}
  172.      *
  173.      * @return Service used to research and manage on the backend on objects of type {@link org.openspcoop2.core.transazioni.CredenzialeMittente}  
  174.      * @throws ServiceException Exception thrown when an error occurs during processing of the request
  175.      * @throws NotImplementedException Exception thrown when the method is not implemented
  176.      */
  177.     @Override
  178.     public ICredenzialeMittenteService getCredenzialeMittenteService() throws ServiceException,NotImplementedException{
  179.         return new JDBCCredenzialeMittenteService(this);
  180.     }
  181.    
  182.    
  183.    
  184.     /*
  185.      =====================================================================================================================
  186.      Services relating to the object with name:transazione type:transazione
  187.      =====================================================================================================================
  188.     */
  189.    
  190.     /**
  191.      * Return a service used to research on the backend on objects of type {@link org.openspcoop2.core.transazioni.Transazione}
  192.      *
  193.      * @return Service used to research on the backend on objects of type {@link org.openspcoop2.core.transazioni.Transazione}  
  194.      * @throws ServiceException Exception thrown when an error occurs during processing of the request
  195.      * @throws NotImplementedException Exception thrown when the method is not implemented
  196.      */
  197.     @Override
  198.     public ITransazioneServiceSearch getTransazioneServiceSearch() throws ServiceException,NotImplementedException{
  199.         return new JDBCTransazioneServiceSearch(this);
  200.     }
  201.    
  202.     /**
  203.      * Return a service used to research and manage on the backend on objects of type {@link org.openspcoop2.core.transazioni.Transazione}
  204.      *
  205.      * @return Service used to research and manage on the backend on objects of type {@link org.openspcoop2.core.transazioni.Transazione}  
  206.      * @throws ServiceException Exception thrown when an error occurs during processing of the request
  207.      * @throws NotImplementedException Exception thrown when the method is not implemented
  208.      */
  209.     @Override
  210.     public ITransazioneService getTransazioneService() throws ServiceException,NotImplementedException{
  211.         return new JDBCTransazioneService(this);
  212.     }
  213.    
  214.    
  215.    
  216.     /*
  217.      =====================================================================================================================
  218.      Services relating to the object with name:transazione-applicativo-server type:transazione-applicativo-server
  219.      =====================================================================================================================
  220.     */
  221.    
  222.     /**
  223.      * Return a service used to research on the backend on objects of type {@link org.openspcoop2.core.transazioni.TransazioneApplicativoServer}
  224.      *
  225.      * @return Service used to research on the backend on objects of type {@link org.openspcoop2.core.transazioni.TransazioneApplicativoServer}
  226.      * @throws ServiceException Exception thrown when an error occurs during processing of the request
  227.      * @throws NotImplementedException Exception thrown when the method is not implemented
  228.      */
  229.     @Override
  230.     public ITransazioneApplicativoServerServiceSearch getTransazioneApplicativoServerServiceSearch() throws ServiceException,NotImplementedException{
  231.         return new JDBCTransazioneApplicativoServerServiceSearch(this);
  232.     }
  233.    
  234.     /**
  235.      * Return a service used to research and manage on the backend on objects of type {@link org.openspcoop2.core.transazioni.TransazioneApplicativoServer}
  236.      *
  237.      * @return Service used to research and manage on the backend on objects of type {@link org.openspcoop2.core.transazioni.TransazioneApplicativoServer}  
  238.      * @throws ServiceException Exception thrown when an error occurs during processing of the request
  239.      * @throws NotImplementedException Exception thrown when the method is not implemented
  240.      */
  241.     @Override
  242.     public ITransazioneApplicativoServerService getTransazioneApplicativoServerService() throws ServiceException,NotImplementedException{
  243.         return new JDBCTransazioneApplicativoServerService(this);
  244.     }
  245.    
  246.    
  247.    
  248.     /*
  249.      =====================================================================================================================
  250.      Services relating to the object with name:transazione-info type:transazione-info
  251.      =====================================================================================================================
  252.     */
  253.    
  254.     /**
  255.      * Return a service used to research on the backend on objects of type {@link org.openspcoop2.core.transazioni.TransazioneInfo}
  256.      *
  257.      * @return Service used to research on the backend on objects of type {@link org.openspcoop2.core.transazioni.TransazioneInfo}  
  258.      * @throws ServiceException Exception thrown when an error occurs during processing of the request
  259.      * @throws NotImplementedException Exception thrown when the method is not implemented
  260.      */
  261.     @Override
  262.     public ITransazioneInfoServiceSearch getTransazioneInfoServiceSearch() throws ServiceException,NotImplementedException{
  263.         return new JDBCTransazioneInfoServiceSearch(this);
  264.     }
  265.    
  266.     /**
  267.      * Return a service used to research and manage on the backend on objects of type {@link org.openspcoop2.core.transazioni.TransazioneInfo}
  268.      *
  269.      * @return Service used to research and manage on the backend on objects of type {@link org.openspcoop2.core.transazioni.TransazioneInfo}  
  270.      * @throws ServiceException Exception thrown when an error occurs during processing of the request
  271.      * @throws NotImplementedException Exception thrown when the method is not implemented
  272.      */
  273.     @Override
  274.     public ITransazioneInfoService getTransazioneInfoService() throws ServiceException,NotImplementedException{
  275.         return new JDBCTransazioneInfoService(this);
  276.     }
  277.    
  278.    
  279.    
  280.     /*
  281.      =====================================================================================================================
  282.      Services relating to the object with name:transazione-export type:transazione-export
  283.      =====================================================================================================================
  284.     */
  285.    
  286.     /**
  287.      * Return a service used to research on the backend on objects of type {@link org.openspcoop2.core.transazioni.TransazioneExport}
  288.      *
  289.      * @return Service used to research on the backend on objects of type {@link org.openspcoop2.core.transazioni.TransazioneExport}    
  290.      * @throws ServiceException Exception thrown when an error occurs during processing of the request
  291.      * @throws NotImplementedException Exception thrown when the method is not implemented
  292.      */
  293.     @Override
  294.     public ITransazioneExportServiceSearch getTransazioneExportServiceSearch() throws ServiceException,NotImplementedException{
  295.         return new JDBCTransazioneExportServiceSearch(this);
  296.     }
  297.    
  298.     /**
  299.      * Return a service used to research and manage on the backend on objects of type {@link org.openspcoop2.core.transazioni.TransazioneExport}
  300.      *
  301.      * @return Service used to research and manage on the backend on objects of type {@link org.openspcoop2.core.transazioni.TransazioneExport}
  302.      * @throws ServiceException Exception thrown when an error occurs during processing of the request
  303.      * @throws NotImplementedException Exception thrown when the method is not implemented
  304.      */
  305.     @Override
  306.     public ITransazioneExportService getTransazioneExportService() throws ServiceException,NotImplementedException{
  307.         return new JDBCTransazioneExportService(this);
  308.     }
  309.    
  310.    
  311.    
  312.     /*
  313.      =====================================================================================================================
  314.      Services relating to the object with name:dump-messaggio type:dump-messaggio
  315.      =====================================================================================================================
  316.     */
  317.    
  318.     /**
  319.      * Return a service used to research on the backend on objects of type {@link org.openspcoop2.core.transazioni.DumpMessaggio}
  320.      *
  321.      * @return Service used to research on the backend on objects of type {@link org.openspcoop2.core.transazioni.DumpMessaggio}    
  322.      * @throws ServiceException Exception thrown when an error occurs during processing of the request
  323.      * @throws NotImplementedException Exception thrown when the method is not implemented
  324.      */
  325.     @Override
  326.     public IDumpMessaggioServiceSearch getDumpMessaggioServiceSearch() throws ServiceException,NotImplementedException{
  327.         return new JDBCDumpMessaggioServiceSearch(this);
  328.     }
  329.    
  330.     /**
  331.      * Return a service used to research and manage on the backend on objects of type {@link org.openspcoop2.core.transazioni.DumpMessaggio}
  332.      *
  333.      * @return Service used to research and manage on the backend on objects of type {@link org.openspcoop2.core.transazioni.DumpMessaggio}
  334.      * @throws ServiceException Exception thrown when an error occurs during processing of the request
  335.      * @throws NotImplementedException Exception thrown when the method is not implemented
  336.      */
  337.     @Override
  338.     public IDumpMessaggioService getDumpMessaggioService() throws ServiceException,NotImplementedException{
  339.         return new JDBCDumpMessaggioService(this);
  340.     }
  341.    
  342.    
  343.    
  344.    

  345. }