public class AbstractConnectOptions extends Object implements IMimeTypes
| Modifier and Type | Field and Description |
|---|---|
static String |
ACCEPT_HEADER
The Request Header value
|
static String |
DEFAULT_BOOLEAN_ACCEPT_HEADER
Used for
BooleanQueryResultFormat responses. |
static String |
DEFAULT_GRAPH_ACCEPT_HEADER
Used for
RDFFormat responses. |
static String |
DEFAULT_SOLUTIONS_ACCEPT_HEADER
Used for
TupleQueryResultFormat responses. |
String |
method
The HTTP method (GET, POST, etc).
|
Map<String,String> |
requestHeaders
Optional request headers.
|
Map<String,String[]> |
requestParams
Request parameters to be formatted as URL query parameters.
|
String |
serviceURL
The URL of the remote REST service.
|
boolean |
update
When
true, the request is a non-idempotent operation (an
UPDATE request or some kind) and must be directed to the leader for HA. |
MIME_APPLICATION_JSON, MIME_APPLICATION_URL_ENCODED, MIME_APPLICATION_XML, MIME_DEFAULT_BINARY, MIME_GRAPH_ML, MIME_PROPERTIES_XML, MIME_TEXT_HTML, MIME_TEXT_JAVASCRIPT, MIME_TEXT_PLAIN| Constructor and Description |
|---|
AbstractConnectOptions(String serviceURL) |
| Modifier and Type | Method and Description |
|---|---|
static void |
addQueryParams(StringBuilder urlString,
Map<String,String[]> requestParams)
Add any URL query parameters (for a GET request).
|
void |
addRequestParam(String name) |
void |
addRequestParam(String name,
String val) |
void |
addRequestParam(String name,
String[] vals) |
String |
getAcceptHeader() |
static org.apache.http.HttpEntity |
getFormEntity(Map<String,String[]> requestParams)
Variant of
addQueryParams(StringBuilder, Map) that returns an
entity for a POST request. |
String |
getHeader(String name) |
String |
getRequestParam(String name) |
void |
setAcceptHeader(String value) |
void |
setHeader(String name,
String val) |
String |
toString() |
static String |
urlEncode(String in)
Apply a UTF8 encoding to a component of a URL.
|
public final String serviceURL
public String method
public static final transient String ACCEPT_HEADER
public boolean update
true, the request is a non-idempotent operation (an
UPDATE request or some kind) and must be directed to the leader for HA.
When false, the request is an idempotent operation and
should be load balanced over the available service for HA. This option
is ignored for non-HA requests.public static final String DEFAULT_GRAPH_ACCEPT_HEADER
RDFFormat responses.public static final String DEFAULT_SOLUTIONS_ACCEPT_HEADER
TupleQueryResultFormat responses.public static final String DEFAULT_BOOLEAN_ACCEPT_HEADER
BooleanQueryResultFormat responses.public Map<String,String[]> requestParams
public AbstractConnectOptions(String serviceURL)
public void addRequestParam(String name)
public void setAcceptHeader(String value)
public String getAcceptHeader()
public static void addQueryParams(StringBuilder urlString, Map<String,String[]> requestParams) throws UnsupportedEncodingException
UnsupportedEncodingException(Extension REST API does not support multiple context values),
getFormEntity(Map)public static org.apache.http.HttpEntity getFormEntity(Map<String,String[]> requestParams) throws Exception
addQueryParams(StringBuilder, Map) that returns an
entity for a POST request.
Add query params to an IMimeTypes.MIME_APPLICATION_URL_ENCODED
entity.
public static String urlEncode(String in)
in - The text to be encoded.RuntimeException - if the RemoteRepositoryDecls.UTF8 encoding is not
available.NullPointerException - if the argument is null.Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.