public abstract class AbstractHttpProvider extends Object implements DataProvider
Modifier and Type | Field and Description |
---|---|
static int |
RETRY_AFTER |
Constructor and Description |
---|
AbstractHttpProvider() |
Modifier and Type | Method and Description |
---|---|
protected abstract List<String> |
buildRequestUrl(String resourceUri,
Endpoint endpoint)
Build the URL to use to call the webservice in order to retrieve the data for the resource passed as argument.
|
protected boolean |
isValidContentType(String contentType,
Endpoint endpoint)
Check whether the content type returned by the server is acceptable to the endpoint and data provider
|
protected abstract List<String> |
parseResponse(String resourceUri,
String requestUrl,
org.openrdf.model.Model model,
InputStream in,
String contentType)
Parse the HTTP response entity returned by the web service call and return its contents in a Sesame RDF
repository also passed as argument.
|
ClientResponse |
retrieveResource(String resource,
LDClientService client,
Endpoint endpoint)
Retrieve the data for a resource using the given http client and endpoint definition.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getName, listMimeTypes
public static final int RETRY_AFTER
protected abstract List<String> buildRequestUrl(String resourceUri, Endpoint endpoint) throws DataRetrievalException
resourceUri
- endpoint
- endpoint configuration for the data provider (optional)DataRetrievalException
protected abstract List<String> parseResponse(String resourceUri, String requestUrl, org.openrdf.model.Model model, InputStream in, String contentType) throws DataRetrievalException
resourceUri
- model
- an RDF repository for storing an RDF representation of the dataset located at the remote resource.in
- input stream as returned by the remote webservicecontentType
- content type as returned in the HTTP headers of the remote webserviceIOException
- in case an error occurs while reading the input streamDataRetrievalException
public ClientResponse retrieveResource(String resource, LDClientService client, Endpoint endpoint) throws DataRetrievalException
AbstractHttpProvider
for a generic implementation of this method.retrieveResource
in interface DataProvider
resource
- the resource to be retrievedendpoint
- the endpoint definitionDataRetrievalException
Copyright © 2012–2018 The Apache Software Foundation. All rights reserved.