Interface DataSourceService
public interface DataSourceService
- Author:
- RafaĆ Nowacki 2017-10-27
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddDeclaration(DataSourceDeclaration declaration) Add declaration to database.voidassertCanExecute(String dataSourceId) Requires the current user to be allowed to execute the data source.getChooserValues(String datasourceId, String outputParameterId, String value) Returns distinct string values from the selected output parameter of a data source declaration.getDataSource(String declarationId) Returns data source implementation.getDeclaration(String declarationId) Returns declaration from database with givendeclarationIdor null if declaration doesn't exist.Returns all declarations from database.getDeclarations(HibernateFilter filters, Pagination pagination) Returns all declarations from database.getDeclarations(HibernateFilter filters, Pagination pagination, DataSourceScope scope) Returns declarations matching the filters that may be selected in the given scope.getDeclarations(Pagination pagination) Returns all declarations from database.getDeclarations(String type) Returns all declaration of given type.getDeclarations(String type, DataSourceScope scope) Returns declarations of given type that may be used in the given scope.voidinvalidateDatasource(String dataSourceType) Ivalidates all declarations of datasource with specified typevoidremoveDeclaration(DataSourceDeclaration declaration) Remove existing declaration from database.voidupdateDeclaration(DataSourceDeclaration declaration) Update existing declaration in database.
-
Method Details
-
getDataSource
Returns data source implementation.- Parameters:
declarationId-
-
addDeclaration
Add declaration to database.- Parameters:
declaration-- Throws:
DataSourceValidateException
-
updateDeclaration
Update existing declaration in database.- Parameters:
declaration- Data source declaration id- Throws:
DataSourceValidateException
-
removeDeclaration
Remove existing declaration from database.- Parameters:
declaration-
-
getDeclaration
Returns declaration from database with givendeclarationIdor null if declaration doesn't exist.- Parameters:
declarationId- Declaration id.
-
getDeclarations
List<DataSourceDeclaration> getDeclarations()Returns all declarations from database. -
getDeclarations
Returns all declaration of given type.- Parameters:
type- Type of data source.
-
getDeclarations
Returns declarations of given type that may be used in the given scope. Does not check a user.- Parameters:
type- Type of data source ornullfor every type.scope- Scope the declaration may be used in ornullwhen the scope is not checked.
-
getDeclarations
Returns all declarations from database.- Parameters:
pagination- Data for pagination results
-
getDeclarations
CountedResult<DataSourceDeclaration> getDeclarations(HibernateFilter filters, Pagination pagination) Returns all declarations from database.- Parameters:
filters- Filters to restrict resultspagination- Data for pagination results
-
getDeclarations
CountedResult<DataSourceDeclaration> getDeclarations(HibernateFilter filters, Pagination pagination, @Nullable DataSourceScope scope) Returns declarations matching the filters that may be selected in the given scope. The scope is checked only when the data source permissions feature is enabled. When that feature is enabled, a user who is not an administrator also needs USE. Loading a declaration in order to execute it does not use this method.- Parameters:
filters- Filters to restrict resultspagination- Data for pagination resultsscope- Scope the declaration may be used in ornullwhen the scope is not checked
-
invalidateDatasource
Ivalidates all declarations of datasource with specified type- Parameters:
dataSourceType- datasource id
-
getChooserValues
Returns distinct string values from the selected output parameter of a data source declaration.- Parameters:
datasourceId- Data source declaration id.outputParameterId- Output parameter id.value- Optional filter value passed to thevalueinput parameter.
-
assertCanExecute
Requires the current user to be allowed to execute the data source. Does nothing whenUserContextis not active, when the data source permissions feature is off, when the user is an administrator, when the id is blank, when access control is off, or when the declaration is not stored.- Parameters:
dataSourceId- Data source declaration id.- Throws:
DataSourceAccessDeniedException- when the current user may not execute the data source
-