JDBCLimitedServiceManager.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 java.sql.Connection;

  24. import javax.sql.DataSource;

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

  44. public class JDBCLimitedServiceManager extends JDBCServiceManager {

  45.     private JDBCServiceManager unlimitedJdbcServiceManager;

  46.     public JDBCLimitedServiceManager(JDBCServiceManager jdbcServiceManager) {
  47.         this.datasource = jdbcServiceManager.getDatasourceInternalResource();
  48.         this.connection = jdbcServiceManager.getConnectionInternalResource();
  49.         this.log = jdbcServiceManager.getLoggerInternalResource();
  50.         this.jdbcProperties = jdbcServiceManager.getJdbcPropertiesInternalResource();
  51.         this.unlimitedJdbcServiceManager = jdbcServiceManager;
  52.     }
  53.    
  54.     private static final String CONNNECTION_MANAGED = "Connection managed from framework";
  55.    
  56.     @Override
  57.     public Connection getConnection() throws ServiceException {
  58.         throw new ServiceException(CONNNECTION_MANAGED);
  59.     }
  60.     @Override
  61.     public void closeConnection(Connection connection) throws ServiceException {
  62.         throw new ServiceException(CONNNECTION_MANAGED);
  63.     }
  64.     @Override
  65.     protected Connection getConnectionInternalResource() {
  66.         throw new org.openspcoop2.utils.UtilsRuntimeException(CONNNECTION_MANAGED);
  67.     }
  68.     @Override
  69.     protected DataSource getDatasourceInternalResource() {
  70.         throw new org.openspcoop2.utils.UtilsRuntimeException(CONNNECTION_MANAGED);
  71.     }
  72.    
  73.    
  74.    
  75.     /*
  76.      =====================================================================================================================
  77.      Services relating to the object with name:credenziale-mittente type:credenziale-mittente
  78.      =====================================================================================================================
  79.     */
  80.    
  81.     /**
  82.      * Return a service used to research on the backend on objects of type {@link org.openspcoop2.core.transazioni.CredenzialeMittente}
  83.      *
  84.      * @return Service used to research on the backend on objects of type {@link org.openspcoop2.core.transazioni.CredenzialeMittente}  
  85.      * @throws ServiceException Exception thrown when an error occurs during processing of the request
  86.      * @throws NotImplementedException Exception thrown when the method is not implemented
  87.      */
  88.     @Override
  89.     public ICredenzialeMittenteServiceSearch getCredenzialeMittenteServiceSearch() throws ServiceException,NotImplementedException{
  90.         return new JDBCCredenzialeMittenteServiceSearch(this.unlimitedJdbcServiceManager);
  91.     }
  92.    
  93.     /**
  94.      * Return a service used to research and manage on the backend on objects of type {@link org.openspcoop2.core.transazioni.CredenzialeMittente}
  95.      *
  96.      * @return Service used to research and manage on the backend on objects of type {@link org.openspcoop2.core.transazioni.CredenzialeMittente}  
  97.      * @throws ServiceException Exception thrown when an error occurs during processing of the request
  98.      * @throws NotImplementedException Exception thrown when the method is not implemented
  99.      */
  100.     @Override
  101.     public ICredenzialeMittenteService getCredenzialeMittenteService() throws ServiceException,NotImplementedException{
  102.         return new JDBCCredenzialeMittenteService(this.unlimitedJdbcServiceManager);
  103.     }
  104.    
  105.    
  106.    
  107.     /*
  108.      =====================================================================================================================
  109.      Services relating to the object with name:transazione type:transazione
  110.      =====================================================================================================================
  111.     */
  112.    
  113.     /**
  114.      * Return a service used to research on the backend on objects of type {@link org.openspcoop2.core.transazioni.Transazione}
  115.      *
  116.      * @return Service used to research on the backend on objects of type {@link org.openspcoop2.core.transazioni.Transazione}  
  117.      * @throws ServiceException Exception thrown when an error occurs during processing of the request
  118.      * @throws NotImplementedException Exception thrown when the method is not implemented
  119.      */
  120.     @Override
  121.     public ITransazioneServiceSearch getTransazioneServiceSearch() throws ServiceException,NotImplementedException{
  122.         return new JDBCTransazioneServiceSearch(this.unlimitedJdbcServiceManager);
  123.     }
  124.    
  125.     /**
  126.      * Return a service used to research and manage on the backend on objects of type {@link org.openspcoop2.core.transazioni.Transazione}
  127.      *
  128.      * @return Service used to research and manage on the backend on objects of type {@link org.openspcoop2.core.transazioni.Transazione}  
  129.      * @throws ServiceException Exception thrown when an error occurs during processing of the request
  130.      * @throws NotImplementedException Exception thrown when the method is not implemented
  131.      */
  132.     @Override
  133.     public ITransazioneService getTransazioneService() throws ServiceException,NotImplementedException{
  134.         return new JDBCTransazioneService(this.unlimitedJdbcServiceManager);
  135.     }
  136.    
  137.    
  138.    
  139.     /*
  140.      =====================================================================================================================
  141.      Services relating to the object with name:transazione-applicativo-server type:transazione-applicativo-server
  142.      =====================================================================================================================
  143.     */
  144.    
  145.     /**
  146.      * Return a service used to research on the backend on objects of type {@link org.openspcoop2.core.transazioni.TransazioneApplicativoServer}
  147.      *
  148.      * @return Service used to research on the backend on objects of type {@link org.openspcoop2.core.transazioni.TransazioneApplicativoServer}
  149.      * @throws ServiceException Exception thrown when an error occurs during processing of the request
  150.      * @throws NotImplementedException Exception thrown when the method is not implemented
  151.      */
  152.     @Override
  153.     public ITransazioneApplicativoServerServiceSearch getTransazioneApplicativoServerServiceSearch() throws ServiceException,NotImplementedException{
  154.         return new JDBCTransazioneApplicativoServerServiceSearch(this.unlimitedJdbcServiceManager);
  155.     }
  156.    
  157.     /**
  158.      * Return a service used to research and manage on the backend on objects of type {@link org.openspcoop2.core.transazioni.TransazioneApplicativoServer}
  159.      *
  160.      * @return Service used to research and manage on the backend on objects of type {@link org.openspcoop2.core.transazioni.TransazioneApplicativoServer}  
  161.      * @throws ServiceException Exception thrown when an error occurs during processing of the request
  162.      * @throws NotImplementedException Exception thrown when the method is not implemented
  163.      */
  164.     @Override
  165.     public ITransazioneApplicativoServerService getTransazioneApplicativoServerService() throws ServiceException,NotImplementedException{
  166.         return new JDBCTransazioneApplicativoServerService(this.unlimitedJdbcServiceManager);
  167.     }
  168.    
  169.    
  170.    
  171.     /*
  172.      =====================================================================================================================
  173.      Services relating to the object with name:transazione-info type:transazione-info
  174.      =====================================================================================================================
  175.     */
  176.    
  177.     /**
  178.      * Return a service used to research on the backend on objects of type {@link org.openspcoop2.core.transazioni.TransazioneInfo}
  179.      *
  180.      * @return Service used to research on the backend on objects of type {@link org.openspcoop2.core.transazioni.TransazioneInfo}  
  181.      * @throws ServiceException Exception thrown when an error occurs during processing of the request
  182.      * @throws NotImplementedException Exception thrown when the method is not implemented
  183.      */
  184.     @Override
  185.     public ITransazioneInfoServiceSearch getTransazioneInfoServiceSearch() throws ServiceException,NotImplementedException{
  186.         return new JDBCTransazioneInfoServiceSearch(this.unlimitedJdbcServiceManager);
  187.     }
  188.    
  189.     /**
  190.      * Return a service used to research and manage on the backend on objects of type {@link org.openspcoop2.core.transazioni.TransazioneInfo}
  191.      *
  192.      * @return Service used to research and manage on the backend on objects of type {@link org.openspcoop2.core.transazioni.TransazioneInfo}  
  193.      * @throws ServiceException Exception thrown when an error occurs during processing of the request
  194.      * @throws NotImplementedException Exception thrown when the method is not implemented
  195.      */
  196.     @Override
  197.     public ITransazioneInfoService getTransazioneInfoService() throws ServiceException,NotImplementedException{
  198.         return new JDBCTransazioneInfoService(this.unlimitedJdbcServiceManager);
  199.     }
  200.    
  201.    
  202.    
  203.     /*
  204.      =====================================================================================================================
  205.      Services relating to the object with name:transazione-export type:transazione-export
  206.      =====================================================================================================================
  207.     */
  208.    
  209.     /**
  210.      * Return a service used to research on the backend on objects of type {@link org.openspcoop2.core.transazioni.TransazioneExport}
  211.      *
  212.      * @return Service used to research on the backend on objects of type {@link org.openspcoop2.core.transazioni.TransazioneExport}    
  213.      * @throws ServiceException Exception thrown when an error occurs during processing of the request
  214.      * @throws NotImplementedException Exception thrown when the method is not implemented
  215.      */
  216.     @Override
  217.     public ITransazioneExportServiceSearch getTransazioneExportServiceSearch() throws ServiceException,NotImplementedException{
  218.         return new JDBCTransazioneExportServiceSearch(this.unlimitedJdbcServiceManager);
  219.     }
  220.    
  221.     /**
  222.      * Return a service used to research and manage on the backend on objects of type {@link org.openspcoop2.core.transazioni.TransazioneExport}
  223.      *
  224.      * @return Service used to research and manage on the backend on objects of type {@link org.openspcoop2.core.transazioni.TransazioneExport}
  225.      * @throws ServiceException Exception thrown when an error occurs during processing of the request
  226.      * @throws NotImplementedException Exception thrown when the method is not implemented
  227.      */
  228.     @Override
  229.     public ITransazioneExportService getTransazioneExportService() throws ServiceException,NotImplementedException{
  230.         return new JDBCTransazioneExportService(this.unlimitedJdbcServiceManager);
  231.     }
  232.    
  233.    
  234.    
  235.     /*
  236.      =====================================================================================================================
  237.      Services relating to the object with name:dump-messaggio type:dump-messaggio
  238.      =====================================================================================================================
  239.     */
  240.    
  241.     /**
  242.      * Return a service used to research on the backend on objects of type {@link org.openspcoop2.core.transazioni.DumpMessaggio}
  243.      *
  244.      * @return Service used to research on the backend on objects of type {@link org.openspcoop2.core.transazioni.DumpMessaggio}    
  245.      * @throws ServiceException Exception thrown when an error occurs during processing of the request
  246.      * @throws NotImplementedException Exception thrown when the method is not implemented
  247.      */
  248.     @Override
  249.     public IDumpMessaggioServiceSearch getDumpMessaggioServiceSearch() throws ServiceException,NotImplementedException{
  250.         return new JDBCDumpMessaggioServiceSearch(this.unlimitedJdbcServiceManager);
  251.     }
  252.    
  253.     /**
  254.      * Return a service used to research and manage on the backend on objects of type {@link org.openspcoop2.core.transazioni.DumpMessaggio}
  255.      *
  256.      * @return Service used to research and manage on the backend on objects of type {@link org.openspcoop2.core.transazioni.DumpMessaggio}
  257.      * @throws ServiceException Exception thrown when an error occurs during processing of the request
  258.      * @throws NotImplementedException Exception thrown when the method is not implemented
  259.      */
  260.     @Override
  261.     public IDumpMessaggioService getDumpMessaggioService() throws ServiceException,NotImplementedException{
  262.         return new JDBCDumpMessaggioService(this.unlimitedJdbcServiceManager);
  263.     }
  264.    
  265.    
  266.    
  267. }