public class AGHTTPClient extends Object implements AutoCloseable
Uses an unlimited pool of connections to allow safe, concurrent access.
Also contains methods for accessing AG services that operate above the repository level - such as managing repositories.
| Modifier and Type | Field and Description |
|---|---|
static String |
PROP_HTTP_NUM_RETRIES
Number of times an HTTP GET request is automatically retried,
not counting the initial (failed) attempt, in case of errors
caused by a connection timeout.
|
| Constructor and Description |
|---|
AGHTTPClient(String serverURL) |
AGHTTPClient(String serverURL,
org.apache.commons.httpclient.HttpConnectionManager manager) |
AGHTTPClient(String serverURL,
org.apache.commons.httpclient.params.HttpConnectionManagerParams params) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
delete(String url,
org.apache.commons.httpclient.Header[] headers,
org.apache.commons.httpclient.NameValuePair[] params,
AGResponseHandler handler) |
void |
deleteCatalog(String catalogURL) |
void |
deleteRepository(String repositoryURL) |
String[] |
generateURIs(String repositoryURL,
String namespace,
int amount) |
void |
get(String url,
org.apache.commons.httpclient.Header[] headers,
org.apache.commons.httpclient.NameValuePair[] params,
AGResponseHandler handler) |
String[] |
getBlankNodes(String repositoryURL,
int amount) |
org.apache.commons.httpclient.HttpClient |
getHttpClient() |
List<String> |
getListOfStrings(String url) |
String |
getServerURL() |
String |
getString(String url) |
String[] |
getStringArray(String url) |
TupleQueryResult |
getTupleQueryResult(String url) |
String[] |
getUsernameAndPassword()
Retrieve the username and password previously set by setUsernameAndPassword.
|
String |
openSession(String spec,
boolean autocommit) |
void |
post(String url,
org.apache.commons.httpclient.Header[] headers,
org.apache.commons.httpclient.NameValuePair[] params,
org.apache.commons.httpclient.methods.RequestEntity requestEntity,
AGResponseHandler handler) |
void |
put(String url,
org.apache.commons.httpclient.Header[] headers,
org.apache.commons.httpclient.NameValuePair[] params,
org.apache.commons.httpclient.methods.RequestEntity requestEntity,
AGResponseHandler handler) |
void |
putCatalog(String catalogURL) |
void |
putRepository(String repositoryURL) |
void |
setMasqueradeAsUser(String user)
Sets the AG user for X-Masquerade-As-User requests.
|
void |
setUsernameAndPassword(String username,
String password)
Set the username and password for authentication with the remote server.
|
String |
toString() |
public static final String PROP_HTTP_NUM_RETRIES
public AGHTTPClient(String serverURL)
public AGHTTPClient(String serverURL, org.apache.commons.httpclient.HttpConnectionManager manager)
public AGHTTPClient(String serverURL, org.apache.commons.httpclient.params.HttpConnectionManagerParams params)
public String getServerURL()
public org.apache.commons.httpclient.HttpClient getHttpClient()
public void post(String url, org.apache.commons.httpclient.Header[] headers, org.apache.commons.httpclient.NameValuePair[] params, org.apache.commons.httpclient.methods.RequestEntity requestEntity, AGResponseHandler handler) throws AGHttpException
AGHttpExceptionpublic void get(String url, org.apache.commons.httpclient.Header[] headers, org.apache.commons.httpclient.NameValuePair[] params, AGResponseHandler handler) throws AGHttpException
AGHttpExceptionpublic void delete(String url, org.apache.commons.httpclient.Header[] headers, org.apache.commons.httpclient.NameValuePair[] params, AGResponseHandler handler) throws AGHttpException
AGHttpExceptionpublic void put(String url, org.apache.commons.httpclient.Header[] headers, org.apache.commons.httpclient.NameValuePair[] params, org.apache.commons.httpclient.methods.RequestEntity requestEntity, AGResponseHandler handler) throws AGHttpException
AGHttpExceptionpublic void setUsernameAndPassword(String username, String password)
username - the usernamepassword - the passwordpublic String[] getUsernameAndPassword()
public void setMasqueradeAsUser(String user)
For AG superusers only. This allows AG superusers to run requests as another user in a dedicated session.
user - the user for X-Masquerade-As-User requestspublic void putCatalog(String catalogURL) throws AGHttpException
AGHttpExceptionpublic void deleteCatalog(String catalogURL) throws AGHttpException
AGHttpExceptionpublic void putRepository(String repositoryURL) throws AGHttpException
AGHttpExceptionpublic void deleteRepository(String repositoryURL) throws AGHttpException
AGHttpExceptionpublic TupleQueryResult getTupleQueryResult(String url) throws AGHttpException
AGHttpExceptionpublic String[] getBlankNodes(String repositoryURL, int amount) throws AGHttpException
AGHttpExceptionpublic String getString(String url) throws AGHttpException
AGHttpExceptionpublic String[] getStringArray(String url) throws AGHttpException
AGHttpExceptionpublic List<String> getListOfStrings(String url) throws AGHttpException
AGHttpExceptionpublic String openSession(String spec, boolean autocommit) throws AGHttpException
AGHttpExceptionpublic void close()
close in interface AutoCloseablepublic String[] generateURIs(String repositoryURL, String namespace, int amount) throws AGHttpException
AGHttpExceptionCopyright © 2020 Franz Inc.. All rights reserved.