public abstract class AbstractClient extends Object
Modifier and Type | Field and Description |
---|---|
static String |
DELETE_METHOD |
static String |
GET_METHOD |
static String |
LIVE_API |
static String |
POST_METHOD |
static String |
PUT_METHOD |
static String |
SANDBOX_API |
Modifier | Constructor and Description |
---|---|
protected |
AbstractClient(String apiBaseUrl,
String apiAccessKey,
String apiAccessSecret) |
Modifier and Type | Method and Description |
---|---|
void |
authorize(Authorization authorization) |
void |
authorize(String accessToken,
String accessTokenSecret) |
Authorization |
authorizeAfterVerification(String requestToken,
String requestTokenSecret,
String verificationCode) |
Authorization |
authorizeAfterVerification(Verification verification,
String verificationCode) |
protected oauth.signpost.OAuthConsumer |
buildOAuthConsumer(String apiAccessKey,
String apiAccessSecret) |
protected oauth.signpost.OAuthProvider |
buildOAuthProvider(String apiBaseUrl) |
Verification |
fetchVerification()
Fetch URL for access verification.
|
Verification |
fetchVerification(String callbackUrl)
Fetch URL for access verification.
|
String |
getApiBaseUrl() |
oauth.signpost.OAuthConsumer |
getAuthConsumer() |
oauth.signpost.OAuthProvider |
getAuthProvider() |
String |
getEncodedParameterValue(String value) |
String |
getEncoding() |
protected abstract Response |
sendVideoUploadRequest(URL url,
RequestMethod method,
String auth,
InputStream input,
String fileName,
long fileSize)
Sends video with an authentication value to a webservice.
|
protected abstract Response |
sendXmlAttachmentRequest(URL url,
RequestMethod method,
String xml,
InputStream input,
String fileName,
String mimeType)
Sends XML string together with a file to a webservice.
|
protected abstract Response |
sendXmlRequest(URL url,
RequestMethod method,
String xml)
Sends XML string to a webservice.
|
public static final String GET_METHOD
public static final String POST_METHOD
public static final String PUT_METHOD
public static final String DELETE_METHOD
public static final String LIVE_API
public static final String SANDBOX_API
public final void authorize(Authorization authorization) throws oauth.signpost.exception.OAuthException
oauth.signpost.exception.OAuthException
public final void authorize(String accessToken, String accessTokenSecret) throws oauth.signpost.exception.OAuthException
oauth.signpost.exception.OAuthException
public final Authorization authorizeAfterVerification(Verification verification, String verificationCode) throws oauth.signpost.exception.OAuthException
oauth.signpost.exception.OAuthException
public final Authorization authorizeAfterVerification(String requestToken, String requestTokenSecret, String verificationCode) throws oauth.signpost.exception.OAuthException
oauth.signpost.exception.OAuthException
protected oauth.signpost.OAuthConsumer buildOAuthConsumer(String apiAccessKey, String apiAccessSecret)
protected oauth.signpost.OAuthProvider buildOAuthProvider(String apiBaseUrl)
public final Verification fetchVerification() throws oauth.signpost.exception.OAuthException
oauth.signpost.exception.OAuthException
public final Verification fetchVerification(String callbackUrl) throws oauth.signpost.exception.OAuthException
callbackUrl
- oauth.signpost.exception.OAuthException
public final String getApiBaseUrl()
public final oauth.signpost.OAuthConsumer getAuthConsumer() throws oauth.signpost.exception.OAuthNotAuthorizedException
oauth.signpost.exception.OAuthNotAuthorizedException
public final oauth.signpost.OAuthProvider getAuthProvider() throws oauth.signpost.exception.OAuthNotAuthorizedException
oauth.signpost.exception.OAuthNotAuthorizedException
public final String getEncoding()
protected abstract Response sendXmlRequest(URL url, RequestMethod method, String xml) throws IOException, oauth.signpost.exception.OAuthException
url
- the URL of the websericemethod
- the HTTP method of the outgoing requestxml
- the XML string, that is sent to the webserviceIOException
oauth.signpost.exception.OAuthException
protected abstract Response sendXmlAttachmentRequest(URL url, RequestMethod method, String xml, InputStream input, String fileName, String mimeType) throws IOException, oauth.signpost.exception.OAuthException
url
- the URL of the websericemethod
- the HTTP method of the outgoing requestxml
- the XML string, that is sent to the webserviceinput
- the file content, that is sent to the webservicefileName
- the name of the file, that is sent to the webservicemimeType
- the MIME-type of the file, that is sent to the webserviceIOException
oauth.signpost.exception.OAuthException
protected abstract Response sendVideoUploadRequest(URL url, RequestMethod method, String auth, InputStream input, String fileName, long fileSize) throws IOException, oauth.signpost.exception.OAuthException
url
- the URL of the websericemethod
- the HTTP method of the outgoing requestauth
- the authentication value, that is sent to the webserviceinput
- the file content, that is sent to the webservicefileName
- the name of the file, that is sent to the webservicefileSize
- the size of the file, that is sent to the webservice (in bytes)IOException
oauth.signpost.exception.OAuthException
Copyright © 2014 OpenEstate. All rights reserved.