Class HttpDataService
java.lang.Object
net.sf.jasperreports.dataadapters.http.HttpDataService
- All Implemented Interfaces:
DataFileService
- Author:
- Lucian Chirita (lucianc@users.sourceforge.net)
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final StringDeprecated.static final StringDeprecated.Replaced byPROPERTY_POST_PARAMETER.static final StringDeprecated.Replaced byPROPERTY_URL_PARAMETER.static final StringDeprecated.Replaced byPROPERTY_URL.static final StringDeprecated.Replaced byPROPERTY_USERNAME.static final StringProperty that specifies the POST/PUT request body to be sent when HTTP data adapter is used.static final StringProperty that specifies the name of the request header to be sent when HTTP data adapter is used.static final StringProperty that specifies the HTTP request method to be used by the HTTP data adapters.static final StringProperty that specifies the password to be used by the HTTP data adapters with basic authentication.static final StringProperty that specifies the name of the request POST parameter to be sent when HTTP data adapter is used.static final StringProperty that specifies the base URL to be used by the HTTP data adapters.static final StringProperty that specifies the name of the request parameter to be added to the URL when HTTP data adapter is used.static final StringProperty that specifies the user name to be used by the HTTP data adapters with basic authentication. -
Constructor Summary
ConstructorsConstructorDescriptionHttpDataService(ParameterContributorContext context, HttpDataLocation dataLocation) -
Method Summary
Modifier and TypeMethodDescriptionprotected List<org.apache.http.NameValuePair> collectHeaders(Map<String, Object> reportParameters) protected List<org.apache.http.NameValuePair> collectParameters(List<HttpLocationParameter> dataAdapterParameters, Map<String, Object> parameterValues, String propertyName, String parameterPrefix) protected List<org.apache.http.NameValuePair> collectPostParameters(Map<String, Object> reportParameters) protected List<org.apache.http.NameValuePair> collectUrlParameters(Map<String, Object> reportParameters) protected org.apache.http.client.methods.HttpGetcreateGetRequest(URI requestURI) protected org.apache.http.impl.client.CloseableHttpClientcreateHttpClient(Map<String, Object> parameters) protected org.apache.http.client.methods.HttpPostcreatePostRequest(URI requestURI, String body) protected org.apache.http.client.methods.HttpPostcreatePostRequest(URI requestURI, List<org.apache.http.NameValuePair> postParameters) protected org.apache.http.client.methods.HttpPutcreatePutRequest(URI requestURI, String body) protected org.apache.http.client.methods.HttpPutcreatePutRequest(URI requestURI, List<org.apache.http.NameValuePair> postParameters) protected org.apache.http.client.methods.HttpRequestBasecreateRequest(Map<String, Object> parameters) protected org.apache.http.HttpEntitycreateRequestEntity(String body) protected org.apache.http.HttpEntitycreateRequestEntity(List<org.apache.http.NameValuePair> postParameters) protected StringgetDataFileConnection(Map<String, Object> parameters) protected RequestMethodprotected StringgetPassword(Map<String, Object> parameters) protected Stringprotected URIgetRequestURI(Map<String, Object> parameters) protected Stringprotected StringgetUsername(Map<String, Object> parameters) protected voidsetAuthentication(Map<String, Object> parameters, org.apache.http.impl.client.HttpClientBuilder clientBuilder) protected StringtoHttpParameterValue(Object value)
-
Field Details
-
HTTP_DATA_SERVICE_NAME
- See Also:
-
EXCEPTION_MESSAGE_KEY_NO_HTTP_URL_SET
- See Also:
-
EXCEPTION_MESSAGE_KEY_UNKNOWN_REQUEST_METHOD
- See Also:
-
PARAMETER_URL
Deprecated.Replaced byPROPERTY_URL.- See Also:
-
PARAMETER_USERNAME
Deprecated.Replaced byPROPERTY_USERNAME.- See Also:
-
PARAMETER_PASSWORD
Deprecated.Replaced byPROPERTY_PASSWORD.- See Also:
-
PARAMETER_PREFIX_URL_PARAMETER
Deprecated.Replaced byPROPERTY_URL_PARAMETER.- See Also:
-
PARAMETER_PREFIX_POST_PARAMETER
Deprecated.Replaced byPROPERTY_POST_PARAMETER.- See Also:
-
PROPERTY_METHOD
Property that specifies the HTTP request method to be used by the HTTP data adapters. When used at parameter level, it does not need to provide a value, but is just used to mark the parameter that will provide the HTTP method.- See Also:
-
PROPERTY_URL
Property that specifies the base URL to be used by the HTTP data adapters. When used at parameter level, it does not need to provide a value, but is just used to mark the parameter that will provide the URL value.- See Also:
-
PROPERTY_USERNAME
Property that specifies the user name to be used by the HTTP data adapters with basic authentication. When used at parameter level, it does not need to provide a value, but is just used to mark the parameter that will provide the user name value.- See Also:
-
PROPERTY_PASSWORD
Property that specifies the password to be used by the HTTP data adapters with basic authentication. When used at parameter level, it does not need to provide a value, but is just used to mark the parameter that will provide the user password value.- See Also:
-
PROPERTY_URL_PARAMETER
Property that specifies the name of the request parameter to be added to the URL when HTTP data adapter is used. If the property is present, but has no value, the name of the request parameter is the same as the report parameter name.- See Also:
-
PROPERTY_BODY
Property that specifies the POST/PUT request body to be sent when HTTP data adapter is used. When used at parameter level, it does not need to provide a value, but is just used to mark the parameter that will provide the POST/PUT request body value.- See Also:
-
PROPERTY_POST_PARAMETER
Property that specifies the name of the request POST parameter to be sent when HTTP data adapter is used. If the property is present, but has no value, the name of the request parameter is the same as the report parameter name.- See Also:
-
PROPERTY_HEADER
Property that specifies the name of the request header to be sent when HTTP data adapter is used. If the property is present, but has no value, the name of the request header is the same as the report parameter name.- See Also:
-
-
Constructor Details
-
HttpDataService
-
-
Method Details
-
getDataFileConnection
- Specified by:
getDataFileConnectionin interfaceDataFileService- Throws:
JRException
-
createHttpClient
-
setAuthentication
-
getUsername
-
getPassword
-
createRequest
-
createGetRequest
-
createPostRequest
-
createPostRequest
-
createPutRequest
-
createPutRequest
-
createRequestEntity
-
createRequestEntity
protected org.apache.http.HttpEntity createRequestEntity(List<org.apache.http.NameValuePair> postParameters) -
collectUrlParameters
-
collectPostParameters
-
collectHeaders
-
collectParameters
-
getRequestURI
-
getURL
-
getMethod
-
getBody
-
getPropertyOrParameterValue
-
toHttpParameterValue
-
PROPERTY_PASSWORD.