public class D1RestClient extends Object
| Modifier and Type | Field and Description |
|---|---|
protected static org.apache.commons.logging.Log |
log |
protected RestClient |
rc |
| Constructor and Description |
|---|
D1RestClient()
Default constructor to create a new instance.
|
D1RestClient(org.apache.http.impl.client.AbstractHttpClient httpClient) |
D1RestClient(org.apache.http.impl.client.AbstractHttpClient httpClient,
Session session) |
D1RestClient(Session session)
Constructor to create a new instance with given session/subject.
|
| Modifier and Type | Method and Description |
|---|---|
void |
closeIdleConnections()
Calls closeIdleConnections on the underlying connection manager.
|
InputStream |
doDeleteRequest(String url) |
InputStream |
doGetRequest(String url)
Perform an HTTP GET request, setting the headers first and parsing /filtering
exceptions to the exception stream on the response into their
respective java instances.
|
InputStream |
doGetRequest(String url,
boolean allowRedirect) |
org.apache.http.Header[] |
doGetRequestForHeaders(String url) |
org.apache.http.Header[] |
doHeadRequest(String url) |
InputStream |
doPostRequest(String url,
SimpleMultipartEntity entity) |
InputStream |
doPutRequest(String url,
SimpleMultipartEntity entity) |
HashMap<String,String> |
getAddedHeaders() |
org.apache.http.client.HttpClient |
getHttpClient()
Gets the AbstractHttpClient instance used to make the connection
|
String |
getLatestRequestUrl()
Gets the string representation of the latest http call made by the
underlying RestClient
|
void |
setHeader(String name,
String value) |
void |
setTimeouts(int milliseconds)
Sets the CONNECTION_TIMEOUT and SO_TIMEOUT values for the underlying httpClient.
|
void |
setupSSL(Session session)
Method used by the constructors to setup the connection with SSL.
|
protected static org.apache.commons.logging.Log log
protected RestClient rc
public D1RestClient()
public D1RestClient(org.apache.http.impl.client.AbstractHttpClient httpClient)
public D1RestClient(Session session)
public D1RestClient(org.apache.http.impl.client.AbstractHttpClient httpClient,
Session session)
public org.apache.http.client.HttpClient getHttpClient()
public String getLatestRequestUrl()
public void closeIdleConnections()
public void setTimeouts(int milliseconds)
milliseconds - public void setupSSL(Session session)
Calling from a D1RestClient instance should override previous connection setups
session - public InputStream doGetRequest(String url) throws AuthenticationTimeout, IdentifierNotUnique, InsufficientResources, InvalidCredentials, InvalidRequest, InvalidSystemMetadata, InvalidToken, NotAuthorized, NotFound, NotImplemented, ServiceFailure, SynchronizationFailed, UnsupportedMetadataType, UnsupportedType, IllegalStateException, org.apache.http.client.ClientProtocolException, IOException, org.apache.http.HttpException, VersionMismatch
url - - the encoded url stringAuthenticationTimeoutIdentifierNotUniqueInsufficientResourcesInvalidCredentialsInvalidRequestInvalidSystemMetadataInvalidTokenNotAuthorizedNotFoundNotImplementedServiceFailureSynchronizationFailedUnsupportedMetadataTypeUnsupportedQueryTypeUnsupportedTypeIllegalStateExceptionorg.apache.http.client.ClientProtocolExceptionIOExceptionorg.apache.http.HttpExceptionVersionMismatchpublic InputStream doGetRequest(String url, boolean allowRedirect) throws AuthenticationTimeout, IdentifierNotUnique, InsufficientResources, InvalidCredentials, InvalidRequest, InvalidSystemMetadata, InvalidToken, NotAuthorized, NotFound, NotImplemented, ServiceFailure, SynchronizationFailed, UnsupportedMetadataType, UnsupportedType, IllegalStateException, org.apache.http.client.ClientProtocolException, IOException, org.apache.http.HttpException, VersionMismatch
AuthenticationTimeoutIdentifierNotUniqueInsufficientResourcesInvalidCredentialsInvalidRequestInvalidSystemMetadataInvalidTokenNotAuthorizedNotFoundNotImplementedServiceFailureSynchronizationFailedUnsupportedMetadataTypeUnsupportedTypeIllegalStateExceptionorg.apache.http.client.ClientProtocolExceptionIOExceptionorg.apache.http.HttpExceptionVersionMismatchpublic org.apache.http.Header[] doGetRequestForHeaders(String url) throws AuthenticationTimeout, IdentifierNotUnique, InsufficientResources, InvalidCredentials, InvalidRequest, InvalidSystemMetadata, InvalidToken, NotAuthorized, NotFound, NotImplemented, ServiceFailure, SynchronizationFailed, UnsupportedMetadataType, UnsupportedType, IllegalStateException, org.apache.http.client.ClientProtocolException, IOException, org.apache.http.HttpException, VersionMismatch
AuthenticationTimeoutIdentifierNotUniqueInsufficientResourcesInvalidCredentialsInvalidRequestInvalidSystemMetadataInvalidTokenNotAuthorizedNotFoundNotImplementedServiceFailureSynchronizationFailedUnsupportedMetadataTypeUnsupportedTypeIllegalStateExceptionorg.apache.http.client.ClientProtocolExceptionIOExceptionorg.apache.http.HttpExceptionVersionMismatchpublic InputStream doDeleteRequest(String url) throws AuthenticationTimeout, IdentifierNotUnique, InsufficientResources, InvalidCredentials, InvalidRequest, InvalidSystemMetadata, InvalidToken, NotAuthorized, NotFound, NotImplemented, ServiceFailure, SynchronizationFailed, UnsupportedMetadataType, UnsupportedType, IllegalStateException, org.apache.http.client.ClientProtocolException, IOException, org.apache.http.HttpException, VersionMismatch
AuthenticationTimeoutIdentifierNotUniqueInsufficientResourcesInvalidCredentialsInvalidRequestInvalidSystemMetadataInvalidTokenNotAuthorizedNotFoundNotImplementedServiceFailureSynchronizationFailedUnsupportedMetadataTypeUnsupportedTypeIllegalStateExceptionorg.apache.http.client.ClientProtocolExceptionIOExceptionorg.apache.http.HttpExceptionVersionMismatchpublic org.apache.http.Header[] doHeadRequest(String url) throws AuthenticationTimeout, IdentifierNotUnique, InsufficientResources, InvalidCredentials, InvalidRequest, InvalidSystemMetadata, InvalidToken, NotAuthorized, NotFound, NotImplemented, ServiceFailure, SynchronizationFailed, UnsupportedMetadataType, UnsupportedType, IllegalStateException, org.apache.http.client.ClientProtocolException, IOException, org.apache.http.HttpException, VersionMismatch
AuthenticationTimeoutIdentifierNotUniqueInsufficientResourcesInvalidCredentialsInvalidRequestInvalidSystemMetadataInvalidTokenNotAuthorizedNotFoundNotImplementedServiceFailureSynchronizationFailedUnsupportedMetadataTypeUnsupportedTypeIllegalStateExceptionorg.apache.http.client.ClientProtocolExceptionIOExceptionorg.apache.http.HttpExceptionVersionMismatchpublic InputStream doPutRequest(String url, SimpleMultipartEntity entity) throws AuthenticationTimeout, IdentifierNotUnique, InsufficientResources, InvalidCredentials, InvalidRequest, InvalidSystemMetadata, InvalidToken, NotAuthorized, NotFound, NotImplemented, ServiceFailure, SynchronizationFailed, UnsupportedMetadataType, UnsupportedType, IllegalStateException, org.apache.http.client.ClientProtocolException, IOException, org.apache.http.HttpException, VersionMismatch
AuthenticationTimeoutIdentifierNotUniqueInsufficientResourcesInvalidCredentialsInvalidRequestInvalidSystemMetadataInvalidTokenNotAuthorizedNotFoundNotImplementedServiceFailureSynchronizationFailedUnsupportedMetadataTypeUnsupportedTypeIllegalStateExceptionorg.apache.http.client.ClientProtocolExceptionIOExceptionorg.apache.http.HttpExceptionVersionMismatchpublic InputStream doPostRequest(String url, SimpleMultipartEntity entity) throws AuthenticationTimeout, IdentifierNotUnique, InsufficientResources, InvalidCredentials, InvalidRequest, InvalidSystemMetadata, InvalidToken, NotAuthorized, NotFound, NotImplemented, ServiceFailure, SynchronizationFailed, UnsupportedMetadataType, UnsupportedType, IllegalStateException, org.apache.http.client.ClientProtocolException, IOException, org.apache.http.HttpException, VersionMismatch
AuthenticationTimeoutIdentifierNotUniqueInsufficientResourcesInvalidCredentialsInvalidRequestInvalidSystemMetadataInvalidTokenNotAuthorizedNotFoundNotImplementedServiceFailureSynchronizationFailedUnsupportedMetadataTypeUnsupportedTypeIllegalStateExceptionorg.apache.http.client.ClientProtocolExceptionIOExceptionorg.apache.http.HttpExceptionVersionMismatchCopyright © 2014. All Rights Reserved.