public class OfficeClient
extends java.lang.Object
| Constructor and Description |
|---|
OfficeClient(Credentials credentials)
Instantiates a new Office client.
|
OfficeClient(Credentials credentials,
Logger logger)
Instantiates a new Office client.
|
| Modifier and Type | Method and Description |
|---|---|
protected com.google.common.util.concurrent.ListenableFuture<byte[]> |
executeRequest(java.lang.String url,
java.lang.String method)
Execute request.
|
protected com.google.common.util.concurrent.ListenableFuture<byte[]> |
executeRequest(java.lang.String url,
java.lang.String method,
java.util.Map<java.lang.String,java.lang.String> headers,
byte[] payload)
Execute request.
|
protected com.google.common.util.concurrent.ListenableFuture<org.json.JSONObject> |
executeRequestJson(java.lang.String url,
java.lang.String method)
Execute request json.
|
protected com.google.common.util.concurrent.ListenableFuture<org.json.JSONObject> |
executeRequestJson(java.lang.String url,
java.lang.String method,
java.util.Map<java.lang.String,java.lang.String> headers,
byte[] payload)
Execute request json.
|
protected java.lang.String |
generateODataQueryString(Query query)
Generate o data query string.
|
protected Credentials |
getCredentials()
Gets credentials.
|
com.google.common.util.concurrent.ListenableFuture<java.util.List<DiscoveryInformation>> |
getDiscoveryInfo()
Gets discovery info.
|
com.google.common.util.concurrent.ListenableFuture<java.util.List<DiscoveryInformation>> |
getDiscoveryInfo(java.lang.String discoveryEndpoint)
Gets discovery info.
|
protected Logger |
getLogger()
Gets logger.
|
protected static boolean |
isValidStatus(int status)
Is valid status.
|
protected void |
log(java.lang.String message,
LogLevel level)
Log void.
|
protected void |
log(java.lang.Throwable error)
Log void.
|
protected void |
prepareRequest(Request request)
Prepare request.
|
protected java.lang.String |
queryEncode(java.lang.String query)
Query encode.
|
protected java.lang.String |
urlEncode(java.lang.String str)
Url encode.
|
protected java.lang.String |
UUIDtoString(java.util.UUID id)
UUI dto string.
|
public OfficeClient(Credentials credentials)
credentials - the credentialspublic OfficeClient(Credentials credentials, Logger logger)
credentials - the credentialslogger - the loggerprotected void log(java.lang.String message,
LogLevel level)
message - the messagelevel - the levelprotected void log(java.lang.Throwable error)
error - the errorprotected Logger getLogger()
protected Credentials getCredentials()
protected java.lang.String generateODataQueryString(Query query)
query - the queryprotected com.google.common.util.concurrent.ListenableFuture<byte[]> executeRequest(java.lang.String url,
java.lang.String method)
url - the urlmethod - the methodprotected com.google.common.util.concurrent.ListenableFuture<byte[]> executeRequest(java.lang.String url,
java.lang.String method,
java.util.Map<java.lang.String,java.lang.String> headers,
byte[] payload)
url - the urlmethod - the methodheaders - the headerspayload - the payloadprotected com.google.common.util.concurrent.ListenableFuture<org.json.JSONObject> executeRequestJson(java.lang.String url,
java.lang.String method)
url - the urlmethod - the methodprotected com.google.common.util.concurrent.ListenableFuture<org.json.JSONObject> executeRequestJson(java.lang.String url,
java.lang.String method,
java.util.Map<java.lang.String,java.lang.String> headers,
byte[] payload)
url - the urlmethod - the methodheaders - the headerspayload - the payloadpublic com.google.common.util.concurrent.ListenableFuture<java.util.List<DiscoveryInformation>> getDiscoveryInfo()
public com.google.common.util.concurrent.ListenableFuture<java.util.List<DiscoveryInformation>> getDiscoveryInfo(java.lang.String discoveryEndpoint)
discoveryEndpoint - the discovery endpointprotected void prepareRequest(Request request)
request - the requestprotected static boolean isValidStatus(int status)
status - the statusprotected java.lang.String queryEncode(java.lang.String query)
query - the queryprotected java.lang.String urlEncode(java.lang.String str)
str - the strprotected java.lang.String UUIDtoString(java.util.UUID id)
id - the id