public class AnalyticsClient
extends java.lang.Object
Constructor and Description |
---|
AnalyticsClient(java.lang.String clientId,
java.lang.String clientSecret,
java.lang.String refreshToken)
Creates a new
AnalyticsClient instance. |
Modifier and Type | Method and Description |
---|---|
static void |
close(java.io.Closeable... args) |
BulkAPI |
getBulkInstance(long orgId,
long workspaceId)
Creates a new
BulkAPI instance. |
int |
getConnectionTimeout()
Returns the timeout until a connection is established.
|
org.json.JSONObject |
getDashboards()
Returns list of all accessible dashboards.
|
OrgAPI |
getOrgInstance(long orgId)
Creates a new
OrgAPI instance. |
org.json.JSONArray |
getOrgs()
Returns list of all accessible organizations.
|
org.json.JSONArray |
getOwnedDashboards()
Returns list of owned dashboards.
|
org.json.JSONArray |
getOwnedWorkspaces()
Returns list of owned workspaces.
|
int |
getReadTimeout()
Returns the read timeout value which will wait for the packet to receive from the server end.
|
org.json.JSONArray |
getRecentViews()
Returns list of recently accessed views.
|
org.json.JSONArray |
getSharedDashboards()
Returns list of shared dashboards.
|
org.json.JSONArray |
getSharedWorkspaces()
Returns list of shared workspaces.
|
org.json.JSONObject |
getViewDetails(long viewId,
org.json.JSONObject config)
Returns details of the specified view.
|
ViewAPI |
getViewInstance(long orgId,
long workspaceId,
long viewId)
Creates a new
ViewAPI instance. |
org.json.JSONObject |
getWorkspaceDetails(long workspaceId)
Returns details of the specified workspace.
|
WorkspaceAPI |
getWorkspaceInstance(long orgId,
long workspaceId)
Creates a new
WorkspaceAPI instance. |
org.json.JSONObject |
getWorkspaces()
Returns list of all accessible workspaces.
|
org.json.JSONObject |
importDataInBatches(java.lang.String endPoint,
org.json.JSONObject config,
java.util.Map<java.lang.String,java.lang.String> reqHeaders,
java.io.File csvFile,
int batchSize,
org.json.JSONObject toolConfig) |
protected org.json.JSONObject |
sendAPIRequest(java.lang.String reqMethod,
java.lang.String endPoint,
org.json.JSONObject config,
java.util.Map<java.lang.String,java.lang.String> reqHeaders)
Internal method to send API request.
|
protected org.json.JSONObject |
sendBatchImportAPIRequest(java.lang.String endPoint,
org.json.JSONObject config,
java.util.Map<java.lang.String,java.lang.String> reqHeaders,
java.lang.Object dataHandler)
Internal method to send API request.
|
protected org.json.JSONObject |
sendExportAPIRequest(java.lang.String endPoint,
org.json.JSONObject config,
java.util.Map<java.lang.String,java.lang.String> reqHeaders,
java.lang.Object dataHandler)
Internal method to send API request.
|
protected org.json.JSONObject |
sendImportAPIRequest(java.lang.String endPoint,
org.json.JSONObject config,
java.util.Map<java.lang.String,java.lang.String> reqHeaders,
java.lang.Object dataHandler)
Internal method to send API request.
|
void |
setAccountsServerURL(java.lang.String serverURL)
Sets the accounts server URL.
|
void |
setAnalyticsServerURL(java.lang.String serverURL)
Sets the analytics server URL.
|
void |
setConnectionTimeout(int timeout)
Sets the timeout until a connection is established.
|
void |
setProxy(java.lang.String proxyHost,
int proxyPort,
java.lang.String proxyUsername,
java.lang.String proxyPassword)
To specify the proxy server details.
|
void |
setReadTimeout(int timeout)
Sets the read timeout which will wait for data response from the server end.
|
protected void |
writeLine(java.lang.Appendable writer,
java.lang.String curLine) |
public AnalyticsClient(java.lang.String clientId, java.lang.String clientSecret, java.lang.String refreshToken)
AnalyticsClient
instance.clientId
- The client ID string that has been obtained during the client registration.clientSecret
- The client secret string that has been obtained during the client registration.refreshToken
- The refresh token string that has been obtained through accounts API.public OrgAPI getOrgInstance(long orgId)
OrgAPI
instance.orgId
- The ID of the organization.public WorkspaceAPI getWorkspaceInstance(long orgId, long workspaceId)
WorkspaceAPI
instance.orgId
- The ID of the organization.workspaceId
- The ID of the workspace.public ViewAPI getViewInstance(long orgId, long workspaceId, long viewId)
ViewAPI
instance.orgId
- The ID of the organization.workspaceId
- The ID of the workspace.viewId
- The ID of the view.public BulkAPI getBulkInstance(long orgId, long workspaceId)
BulkAPI
instance.orgId
- The ID of the organization.workspaceId
- The ID of the workspace.public org.json.JSONArray getOrgs() throws ServerException, ParseException, java.io.IOException, org.json.JSONException
JSONArray
of organizations list.ServerException
- If the server has received the request but did not process the request, due to some error.ParseException
- If the server has responded but the client was not able to parse the response.java.io.IOException
- If any communication related errors like request time out occurs, when trying to contact the service.org.json.JSONException
- If any errors while processing the JSON data.public org.json.JSONObject getWorkspaces() throws ServerException, ParseException, java.io.IOException, org.json.JSONException
JSONObject
of workspaces list.ServerException
- If the server has received the request but did not process the request, due to some error.ParseException
- If the server has responded but the client was not able to parse the response.java.io.IOException
- If any communication related errors like request time out occurs, when trying to contact the service.org.json.JSONException
- If any errors while processing the JSON data.public org.json.JSONArray getOwnedWorkspaces() throws ServerException, ParseException, java.io.IOException, org.json.JSONException
JSONArray
of owned workspaces list.ServerException
- If the server has received the request but did not process the request, due to some error.ParseException
- If the server has responded but the client was not able to parse the response.java.io.IOException
- If any communication related errors like request time out occurs, when trying to contact the service.org.json.JSONException
- If any errors while processing the JSON data.public org.json.JSONArray getSharedWorkspaces() throws ServerException, ParseException, java.io.IOException, org.json.JSONException
JSONArray
of shared workspaces list.ServerException
- If the server has received the request but did not process the request, due to some error.ParseException
- If the server has responded but the client was not able to parse the response.java.io.IOException
- If any communication related errors like request time out occurs, when trying to contact the service.org.json.JSONException
- If any errors while processing the JSON data.public org.json.JSONArray getRecentViews() throws ServerException, ParseException, java.io.IOException, org.json.JSONException
JSONArray
of recent views list.ServerException
- If the server has received the request but did not process the request, due to some error.ParseException
- If the server has responded but the client was not able to parse the response.java.io.IOException
- If any communication related errors like request time out occurs, when trying to contact the service.org.json.JSONException
- If any errors while processing the JSON data.public org.json.JSONObject getDashboards() throws ServerException, ParseException, java.io.IOException, org.json.JSONException
JSONObject
of dashboards list.ServerException
- If the server has received the request but did not process the request, due to some error.ParseException
- If the server has responded but the client was not able to parse the response.java.io.IOException
- If any communication related errors like request time out occurs, when trying to contact the service.org.json.JSONException
- If any errors while processing the JSON data.public org.json.JSONArray getOwnedDashboards() throws ServerException, ParseException, java.io.IOException, org.json.JSONException
JSONArray
of owned dashboards list.ServerException
- If the server has received the request but did not process the request, due to some error.ParseException
- If the server has responded but the client was not able to parse the response.java.io.IOException
- If any communication related errors like request time out occurs, when trying to contact the service.org.json.JSONException
- If any errors while processing the JSON data.public org.json.JSONArray getSharedDashboards() throws ServerException, ParseException, java.io.IOException, org.json.JSONException
JSONArray
of shared dashboards list.ServerException
- If the server has received the request but did not process the request, due to some error.ParseException
- If the server has responded but the client was not able to parse the response.java.io.IOException
- If any communication related errors like request time out occurs, when trying to contact the service.org.json.JSONException
- If any errors while processing the JSON data.public org.json.JSONObject getWorkspaceDetails(long workspaceId) throws ServerException, ParseException, java.io.IOException, org.json.JSONException
workspaceId
- The ID of the workspace.JSONObject
of workspace details.ServerException
- If the server has received the request but did not process the request, due to some error.ParseException
- If the server has responded but the client was not able to parse the response.java.io.IOException
- If any communication related errors like request time out occurs, when trying to contact the service.org.json.JSONException
- If any errors while processing the JSON data.public org.json.JSONObject getViewDetails(long viewId, org.json.JSONObject config) throws ServerException, ParseException, java.io.IOException, org.json.JSONException
viewId
- The ID of the view.config
- Contains any additional control configurations. Can be null.JSONObject
of view details.ServerException
- If the server has received the request but did not process the request, due to some error.ParseException
- If the server has responded but the client was not able to parse the response.java.io.IOException
- If any communication related errors like request time out occurs, when trying to contact the service.org.json.JSONException
- If any errors while processing the JSON data.public void setAnalyticsServerURL(java.lang.String serverURL)
serverURL
- The server URL.public void setAccountsServerURL(java.lang.String serverURL)
serverURL
- The server URL.public int getConnectionTimeout()
int
value.public void setConnectionTimeout(int timeout)
timeout
- Contains connection timeout value.public int getReadTimeout()
int
value.public void setReadTimeout(int timeout)
timeout
- Contains read timeout value.public void setProxy(java.lang.String proxyHost, int proxyPort, java.lang.String proxyUsername, java.lang.String proxyPassword)
proxyHost
- The hostname/IP address of the proxy server.proxyPort
- The proxy server port.proxyUsername
- The user name for proxy-server authentication.proxyPassword
- The password for proxy server authentication.protected org.json.JSONObject sendAPIRequest(java.lang.String reqMethod, java.lang.String endPoint, org.json.JSONObject config, java.util.Map<java.lang.String,java.lang.String> reqHeaders) throws ServerException, ParseException, java.io.IOException, org.json.JSONException
ServerException
ParseException
java.io.IOException
org.json.JSONException
protected org.json.JSONObject sendExportAPIRequest(java.lang.String endPoint, org.json.JSONObject config, java.util.Map<java.lang.String,java.lang.String> reqHeaders, java.lang.Object dataHandler) throws ServerException, ParseException, java.io.IOException, org.json.JSONException
ServerException
ParseException
java.io.IOException
org.json.JSONException
protected org.json.JSONObject sendImportAPIRequest(java.lang.String endPoint, org.json.JSONObject config, java.util.Map<java.lang.String,java.lang.String> reqHeaders, java.lang.Object dataHandler) throws ServerException, ParseException, java.io.IOException, org.json.JSONException
ServerException
ParseException
java.io.IOException
org.json.JSONException
protected org.json.JSONObject sendBatchImportAPIRequest(java.lang.String endPoint, org.json.JSONObject config, java.util.Map<java.lang.String,java.lang.String> reqHeaders, java.lang.Object dataHandler) throws ServerException, ParseException, java.io.IOException, org.json.JSONException
ServerException
ParseException
java.io.IOException
org.json.JSONException
public org.json.JSONObject importDataInBatches(java.lang.String endPoint, org.json.JSONObject config, java.util.Map<java.lang.String,java.lang.String> reqHeaders, java.io.File csvFile, int batchSize, org.json.JSONObject toolConfig) throws java.io.IOException, ServerException, ParseException, java.lang.Exception
java.io.IOException
ServerException
ParseException
java.lang.Exception
protected void writeLine(java.lang.Appendable writer, java.lang.String curLine) throws java.io.IOException
java.io.IOException
public static void close(java.io.Closeable... args)
Copyright © 2023 AdventNet Inc. All Rights Reserved.