Class RemoteDatasourceHelper

java.lang.Object
de.xima.fc.datasource.RemoteDatasourceHelper

public class RemoteDatasourceHelper extends Object
  • Constructor Details

    • RemoteDatasourceHelper

      public RemoteDatasourceHelper()
  • Method Details

    • getFormattedDatasource

      public static String getFormattedDatasource(CSVDatasourceParameterModel model) throws DatasourceDownloadException
      Downloads and formats a remote datasource. Remote-URL must be set in the model. Delimiter, quote character etc. are configured in the model. Should have a default, see CSVFormatWrapper.
      Parameters:
      model - The model containing the remote datasource parameters
      Returns:
      The formatted datasource as a string.
      Throws:
      DatasourceDownloadException
    • updateExistingDatasource

      public static Datenquelle updateExistingDatasource(IEntityContext ec, IUser user, Datenquelle datasource)
      Updates a datasource. Currently only supports type CSV. Checks if the remote datasource is enabled and if the last update was more than the configured interval ago. Errors during the download will be logged in the client protocol.
      Parameters:
      ec - The entity context for accessing the database.
      user - The user who requests the update.
      datasource - the data source to update
      Returns:
      The data source, updated if needed.