Search in sources :

Example 1 with RestApiClientException

use of org.apache.gobblin.source.extractor.exception.RestApiClientException in project incubator-gobblin by apache.

the class SalesforceExtractor method buildUrl.

private static String buildUrl(String path, List<NameValuePair> qparams) throws RestApiClientException {
    URIBuilder builder = new URIBuilder();
    builder.setPath(path);
    ListIterator<NameValuePair> i = qparams.listIterator();
    while (i.hasNext()) {
        NameValuePair keyValue = i.next();
        builder.setParameter(keyValue.getName(), keyValue.getValue());
    }
    URI uri;
    try {
        uri = builder.build();
    } catch (Exception e) {
        throw new RestApiClientException("Failed to build url; error - " + e.getMessage(), e);
    }
    return new HttpGet(uri).getURI().toString();
}
Also used : NameValuePair(org.apache.http.NameValuePair) BasicNameValuePair(org.apache.http.message.BasicNameValuePair) HttpGet(org.apache.http.client.methods.HttpGet) RestApiClientException(org.apache.gobblin.source.extractor.exception.RestApiClientException) URI(java.net.URI) ParseException(java.text.ParseException) RecordCountException(org.apache.gobblin.source.extractor.exception.RecordCountException) AsyncApiException(com.sforce.async.AsyncApiException) DataRecordException(org.apache.gobblin.source.extractor.DataRecordException) SchemaException(org.apache.gobblin.source.extractor.exception.SchemaException) RestApiClientException(org.apache.gobblin.source.extractor.exception.RestApiClientException) IOException(java.io.IOException) HighWatermarkException(org.apache.gobblin.source.extractor.exception.HighWatermarkException) RestApiConnectionException(org.apache.gobblin.source.extractor.exception.RestApiConnectionException) URIBuilder(org.apache.http.client.utils.URIBuilder)

Aggregations

AsyncApiException (com.sforce.async.AsyncApiException)1 IOException (java.io.IOException)1 URI (java.net.URI)1 ParseException (java.text.ParseException)1 DataRecordException (org.apache.gobblin.source.extractor.DataRecordException)1 HighWatermarkException (org.apache.gobblin.source.extractor.exception.HighWatermarkException)1 RecordCountException (org.apache.gobblin.source.extractor.exception.RecordCountException)1 RestApiClientException (org.apache.gobblin.source.extractor.exception.RestApiClientException)1 RestApiConnectionException (org.apache.gobblin.source.extractor.exception.RestApiConnectionException)1 SchemaException (org.apache.gobblin.source.extractor.exception.SchemaException)1 NameValuePair (org.apache.http.NameValuePair)1 HttpGet (org.apache.http.client.methods.HttpGet)1 URIBuilder (org.apache.http.client.utils.URIBuilder)1 BasicNameValuePair (org.apache.http.message.BasicNameValuePair)1