java.lang.Object |
↳ |
com.microstrategy.web.app.utils.usher.NetworkRequest |
Known Direct Subclasses
|
Class Overview
Generic network request. It allows a subclass to add parameters in the url and read the response.
Summary
Public Constructors |
|
NetworkRequest(String baseURLIn, int whichHandle, boolean isPost)
|
|
NetworkRequest(String baseURL, String extraPath, int whichHandle, boolean isPost)
|
[Expand]
Inherited Methods |
From class
java.lang.Object
Object
|
clone()
|
boolean
|
equals(Object arg0)
|
void
|
finalize()
|
final
Class<?>
|
getClass()
|
int
|
hashCode()
|
final
void
|
notify()
|
final
void
|
notifyAll()
|
String
|
toString()
|
final
void
|
wait(long arg0, int arg1)
|
final
void
|
wait(long arg0)
|
final
void
|
wait()
|
|
Constants
public
static
final
String
FORMAT_JSON
public
static
final
String
FORMAT_XML
public
static
final
String
HTTP_USHER_HEADER_ERROR
Constant Value:
"X-FW-Exception"
Fields
protected
String
jsonDataParam
protected
Map<String, String>
requestParams
protected
Map<String, String>
requestProps
protected
Map<String, List<String>>
responseHeaderFields
Public Constructors
public
NetworkRequest
(String baseURLIn, int whichHandle, boolean isPost)
public
NetworkRequest
(String baseURL, String extraPath, int whichHandle, boolean isPost)
Public Methods
public
String
executeStringContentType
()
public
static
String
getCookieFromResponseHeader
(Map<String, List<String>> headers, String cookieName)
public
static
String
getErrorDetails
(HttpURLConnection urlConn)
In case of error gets error details
Returns
- StringBuilder with error details
public
String
getResponseFromRequest
()
public
static
void
handleErrorCodes
(int responseCode, String errorDetails)
Throws the appropriate Usher Error code depending on type of error
public
static
String
makePath
(String url, String params)
Helper function to generate new URL by connecting a path with a given URL. If the given URL does not have "/" at the then,
it will append "/" at the end of the URL.
Parameters
url |
The URL link string |
params |
The second part of the link |
Returns
- A full URL constructed with given url and the second part path
public
void
setResponseFromRequest
(String responseFromRequest)
Protected Methods
protected
void
addBody
(OutputStream out)
protected
void
addJsonDataParam
()
protected
abstract
void
addRequestParameters
()
protected
abstract
void
addRequestProperties
()
protected
URL
buildURL
(Map<String, String> params, boolean isPost, boolean sanitize)
builds up the query to be executed with any additional parameters specified by the child request@return
Throws
| UnsupportedEncodingException |
MalformedURLException
| |
UnsupportedEncodingException
| |
protected
String
getJsonStringIfExists
(JSONObject json, String key)
protected
abstract
void
handleResponse
(String result)
protected
abstract
void
handleResponse
(InputStream imageStream, String contentType, Map<String, List<String>> headers)