use of org.talend.dataprep.async.AsyncExecutionResult in project data-prep by Talend.
the class PrepMetadataGetContentUrlGenerator method generateResultUrl.
@Override
public AsyncExecutionResult generateResultUrl(Object... args) {
// check pre-condition
Validate.notNull(args);
Validate.isTrue(args.length == 2);
Validate.isInstanceOf(String.class, args[0]);
Validate.isInstanceOf(String.class, args[1]);
String preparationId = (String) args[0];
String headId = (String) args[1];
URIBuilder builder = new URIBuilder();
builder.setPath("/api/preparations/" + preparationId + "/metadata");
if (StringUtils.isNotEmpty(headId)) {
builder.setParameter("version", headId);
}
return new AsyncExecutionResult(builder.toString());
}
use of org.talend.dataprep.async.AsyncExecutionResult in project data-prep by Talend.
the class PreparationGetContentUrlGenerator method generateResultUrl.
@Override
public AsyncExecutionResult generateResultUrl(Object... args) {
// check pre-condition
Validate.notNull(args);
Validate.isTrue(args.length == 1);
Validate.isInstanceOf(ExportParameters.class, args[0]);
ExportParameters param = (ExportParameters) args[0];
URIBuilder builder = new URIBuilder();
builder.setPath("/api/preparations/" + param.getPreparationId() + "/content");
if (StringUtils.isNotEmpty(param.getStepId())) {
builder.setParameter("version", param.getStepId());
}
if (param.getFrom() != null) {
builder.setParameter("from", param.getFrom().name());
}
return new AsyncExecutionResult(builder.toString());
}
Aggregations