Class BaseDataSourceService

    • Constructor Detail

      • BaseDataSourceService

        public BaseDataSourceService()
    • Method Detail

      • getName

        public String getName()
        Description copied from interface: DataSourceService
        The name of this service, in the default implementation this is the entityname of the Entity to get/insert/update/delete.
        Specified by:
        getName in interface DataSourceService
        Returns:
        the name of the service
      • getDataSource

        public DataSource getDataSource()
        Description copied from interface: DataSourceService
        This method allows to implement a security access to a DataSource when it is used add(), update() or remove() methods. It can be overridden in specific DataSources to apply a particular security mechanism.
        Specified by:
        getDataSource in interface DataSourceService
        Returns:
        the data source read from the database. Note: can be null for data sources which are created in-memory on request.
      • setDataSource

        public void setDataSource​(DataSource dataSource)
        Description copied from interface: DataSourceService
        Passes in the data source read from the database. Is the place to initialize the data in the service class
        Specified by:
        setDataSource in interface DataSourceService
        Parameters:
        dataSource - the data source read from the database.
      • checkEditDatasourceAccess

        public void checkEditDatasourceAccess​(Map<String,​String> parameters)
        Description copied from interface: DataSourceService
        This method allows to implement a security access to a DataSource when it is used add(), update() or remove() methods. It can be overridden in specific DataSources to apply a particular security mechanism.
        Specified by:
        checkEditDatasourceAccess in interface DataSourceService
      • checkFetchDatasourceAccess

        public void checkFetchDatasourceAccess​(Map<String,​String> parameters)
        Description copied from interface: DataSourceService
        This method allows to implement a security access to a DataSource when it is used fetch() method. It can be overridden in specific DataSources to apply a particular security mechanism.
        Specified by:
        checkFetchDatasourceAccess in interface DataSourceService
      • getWhereAndFilterClause

        protected String getWhereAndFilterClause​(Map<String,​String> parameters)
        This method returns a String with the where and filter clauses that will be applied.
        Returns:
        A String with the value of the where and filter clause. It can be null when there is no filter clause nor where clause.
      • handleExceptionUnsecuredDSAccess

        protected void handleExceptionUnsecuredDSAccess​(OBSecurityException securityException)