Package de.xima.fc.datasource
Class RemoteDatasourceHelper
- java.lang.Object
-
- de.xima.fc.datasource.RemoteDatasourceHelper
-
public class RemoteDatasourceHelper extends Object
-
-
Constructor Summary
Constructors Constructor Description RemoteDatasourceHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
getFormattedDatasource(CSVDatasourceParameterModel model)
Downloads and formats a remote datasource.static Datenquelle
updateExistingDatasource(IEntityContext ec, IUser user, Datenquelle datasource)
Updates a datasource.
-
-
-
Method Detail
-
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, seeCSVFormatWrapper
.- 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.
-
-