Interface DataSourceService


public interface DataSourceService
Author:
RafaƂ Nowacki 2017-10-27
  • Method Details

    • getDataSource

      DataSourceInstance getDataSource(String declarationId)
      Returns data source implementation.
      Parameters:
      declarationId -
    • addDeclaration

      void addDeclaration(DataSourceDeclaration declaration)
      Add declaration to database.
      Parameters:
      declaration -
      Throws:
      DataSourceValidateException
    • updateDeclaration

      void updateDeclaration(DataSourceDeclaration declaration)
      Update existing declaration in database.
      Parameters:
      declaration - Data source declaration id
      Throws:
      DataSourceValidateException
    • removeDeclaration

      void removeDeclaration(DataSourceDeclaration declaration)
      Remove existing declaration from database.
      Parameters:
      declaration -
    • getDeclaration

      DataSourceDeclaration getDeclaration(String declarationId)
      Returns declaration from database with given declarationId or null if declaration doesn't exist.
      Parameters:
      declarationId - Declaration id.
    • getDeclarations

      List<DataSourceDeclaration> getDeclarations()
      Returns all declarations from database.
    • getDeclarations

      List<DataSourceDeclaration> getDeclarations(String type)
      Returns all declaration of given type.
      Parameters:
      type - Type of data source.
    • getDeclarations

      List<DataSourceDeclaration> getDeclarations(@Nullable String type, @Nullable DataSourceScope scope)
      Returns declarations of given type that may be used in the given scope. Does not check a user.
      Parameters:
      type - Type of data source or null for every type.
      scope - Scope the declaration may be used in or null when the scope is not checked.
    • getDeclarationsForUser

      List<DataSourceDeclaration> getDeclarationsForUser(@Nullable String type, @Nullable DataSourceScope scope)
      Returns declarations of given type the user from UserContext may choose in the given scope. When the context is not active, returns an empty list.
      Parameters:
      type - Type of data source or null for every type.
      scope - Scope the declaration may be used in or null when 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 or null for every type.
      scope - Scope the declaration may be used in or null when the scope is not checked.
    • getDeclarations

      CountedResult<DataSourceDeclaration> getDeclarations(Pagination pagination)
      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 results
      pagination - Data for pagination results
    • invalidateDatasource

      void invalidateDatasource(String dataSourceType)
      Ivalidates all declarations of datasource with specified type
      Parameters:
      dataSourceType - datasource id
    • getChooserValues

      List<String> getChooserValues(String datasourceId, String outputParameterId, String value)
      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 the value input parameter.