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.ObjectInvokes a REST API call.use a
RestClientBuilder/IServerRestClientBuilderto create an instance of this class
-
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_HTTP_CONNECT_TIMEOUTstatic intDEFAULT_HTTP_READ_TIMEOUT
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description SimpleResponseWrapperexecute()Executes the API call based on the method types provided and returns a responseSimpleResponseWrappergetResponseWrapper()Get the response objectstatic voidinitializeConnection(java.lang.Integer readTimeout, java.lang.Integer connectTimeout)override the connection properties globallystatic voidsetSSLSocketFactory(javax.net.ssl.SSLSocketFactory sFactory)Deprecated.SSLSocketFactorydoes not expose itsX509TrustManager, which is a field that OkHttp needs to build a clean certificate chain.static voidsetSSLSocketFactory(javax.net.ssl.SSLSocketFactory sFactory, java.util.List<javax.net.ssl.TrustManager> trustManagers)Set the SSLSocketFactory globally which applies to all connection.java.lang.StringtoString()
-
-
-
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.SSLSocketFactorydoes 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 MSTRRestAPIExceptionSet 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.IOExceptionMSTRRestAPIException
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-