Interface DataSourceService
public interface DataSourceService
- Author:
- RafaĆ Nowacki 2017-10-27
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddDeclaration(DataSourceDeclaration declaration) Add declaration to database.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(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.getDeclarationsForUser(String type, DataSourceScope scope) Returns declarations of given type the user fromUserContextmay choose in the given scope.getDeclarationsForUser(String username, String type, DataSourceScope scope) Returns declarations of given type the user may choose 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.
-
getDeclarationsForUser
List<DataSourceDeclaration> getDeclarationsForUser(@Nullable String type, @Nullable DataSourceScope scope) Returns declarations of given type the user fromUserContextmay choose in the given scope. When the context is not active, returns an empty list.- Parameters:
type- Type of data source ornullfor every type.scope- Scope the declaration may be used in ornullwhen the scope is not checked.
-
getDeclarationsForUser
List<DataSourceDeclaration> getDeclarationsForUser(String username, @Nullable String type, @Nullable DataSourceScope scope) Returns declarations of given type the user may choose in the given scope.- Parameters:
username- Login of the user.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
-
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.
-