Package com.microstrategy.webapi.restApi
Class RestClient
- java.lang.Object
-
- com.microstrategy.webapi.restApi.RestClient
-
- Direct Known Subclasses:
IServerRestClient
public class RestClient extends java.lang.Object
Invokes a REST API call.use a
RestClientBuilder
/IServerRestClientBuilder
to create an instance of this class
-
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_HTTP_CONNECT_TIMEOUT
static int
DEFAULT_HTTP_READ_TIMEOUT
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description SimpleResponseWrapper
execute()
Executes the API call based on the method types provided and returns a responseSimpleResponseWrapper
getResponseWrapper()
Get the response objectstatic void
initializeConnection(java.lang.Integer readTimeout, java.lang.Integer connectTimeout)
override the connection properties globallystatic void
setSSLSocketFactory(javax.net.ssl.SSLSocketFactory sFactory)
Deprecated.SSLSocketFactory
does not expose itsX509TrustManager
, which is a field that OkHttp needs to build a clean certificate chain.static void
setSSLSocketFactory(javax.net.ssl.SSLSocketFactory sFactory, java.util.List<javax.net.ssl.TrustManager> trustManagers)
Set the SSLSocketFactory globally which applies to all connection.java.lang.String
toString()
-
-
-
Field Detail
-
DEFAULT_HTTP_CONNECT_TIMEOUT
public static final int DEFAULT_HTTP_CONNECT_TIMEOUT
- See Also:
- Constant Field Values
-
DEFAULT_HTTP_READ_TIMEOUT
public static int DEFAULT_HTTP_READ_TIMEOUT
-
-
Method Detail
-
initializeConnection
public static void initializeConnection(java.lang.Integer readTimeout, java.lang.Integer connectTimeout)
override the connection properties globally
-
setSSLSocketFactory
public static void setSSLSocketFactory(javax.net.ssl.SSLSocketFactory sFactory)
Deprecated.SSLSocketFactory
does not expose itsX509TrustManager
, which is a field that OkHttp needs to build a clean certificate chain. This method instead must use reflection to extract the trust manager. Applications should prefer to call#setSSLSocketFactory(SSLSocketFactory, TrustManager[])
, which avoids such reflection.Set the SSLSocketFactory globally which applies to all connection.
-
setSSLSocketFactory
public static void setSSLSocketFactory(javax.net.ssl.SSLSocketFactory sFactory, java.util.List<javax.net.ssl.TrustManager> trustManagers) throws MSTRRestAPIException
Set the SSLSocketFactory globally which applies to all connection.- Parameters:
sFactory
- SSLSocketFactory to usetms
- A list of TrustManager, the X509TrustManager inside will be retrieved. If this field is null, a system default X509TrustManager will be created automatically.- Throws:
MSTRRestAPIException
-
getResponseWrapper
public SimpleResponseWrapper getResponseWrapper()
Get the response object- Returns:
-
execute
public SimpleResponseWrapper execute() throws java.io.IOException, MSTRRestAPIException
Executes the API call based on the method types provided and returns a response- Returns:
- Throws:
java.io.IOException
MSTRRestAPIException
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-