Package com.zoho.analytics.client
Class BulkAPI
java.lang.Object
com.zoho.analytics.client.BulkAPI
BulkAPI contains bulk data operation.
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBulkAPI(AnalyticsClient ac, long orgId, long workspaceId) Creates a newBulkAPIinstance. -
Method Summary
Modifier and TypeMethodDescriptionvoidexportBulkData(long jobId, OutputStream stream) Download the exported data for the mentioned job id.voidexportBulkData(long jobId, String filePath) Download the exported data for the mentioned job id.voidexportData(long viewId, String responseFormat, OutputStream stream, org.json.JSONObject config) Export the mentioned table (or) view data.voidexportData(long viewId, String responseFormat, String filePath, org.json.JSONObject config) Export the mentioned table (or) view data.voidexportDataUsingSQL(String sqlQuery, String responseFormat, OutputStream stream, org.json.JSONObject config) Internally used in JDBC drivervoidexportDataUsingSQL(String sqlQuery, String responseFormat, String filePath, org.json.JSONObject config) Internally used in JDBC driverorg.json.JSONObjectgetExportJobDetails(long jobId) Returns the details of the export job.org.json.JSONObjectgetImportJobDetails(long jobId) Returns the details of the import job.org.json.JSONObjecthandleCustomBatchImport(long viewId, String filePath, org.json.JSONObject config) longimportBulkData(long viewId, String importType, String fileType, boolean autoIdentify, String filePath, org.json.JSONObject config) Asynchronously import the data contained in the mentioned file into the table.longimportBulkDataInNewTable(String tableName, String fileType, boolean autoIdentify, String filePath, org.json.JSONObject config) Asynchronously create a new table and import the data contained in the mentioned file into the created table.org.json.JSONObjectimportData(long viewId, String importType, String fileType, boolean autoIdentify, String filePath, org.json.JSONObject config) Import the data contained in the mentioned file into the table.longimportDataAsBatches(long viewId, String importType, boolean autoIdentify, String filePath, int batchSize, org.json.JSONObject config, org.json.JSONObject toolConfig) Asynchronously import the data contained in the mentioned file into the table.org.json.JSONObjectimportDataInNewTable(String tableName, String fileType, boolean autoIdentify, String filePath, org.json.JSONObject config) Create a new table and import the data contained in the mentioned file into the created table.longimportDataInNewTableAsBatches(String tableName, boolean autoIdentify, String filePath, int batchSize, org.json.JSONObject config, org.json.JSONObject toolConfig) Create a new table and import the data contained in the mentioned file into the created table.org.json.JSONObjectimportRawData(long viewId, String importType, String fileType, boolean autoIdentify, String data, org.json.JSONObject config) Import the raw data provided into the table.org.json.JSONObjectimportRawDataInNewTable(String tableName, String fileType, boolean autoIdentify, String data, org.json.JSONObject config) Create a new table and import the raw data provided into the created table.longinitiateBulkExport(long viewId, String responseFormat, org.json.JSONObject config) Initiate asynchronous export for the mentioned table (or) view data.longinitiateBulkExportUsingSQL(String sqlQuery, String responseFormat, org.json.JSONObject config) Initiate asynchronous export with the given SQL Query.
-
Constructor Details
-
BulkAPI
Creates a newBulkAPIinstance.- Parameters:
ac-AnalyticsClientinstance.orgId- The ID of the organization.workspaceId- The ID of the workspace.
-
-
Method Details
-
importDataInNewTable
public org.json.JSONObject importDataInNewTable(String tableName, String fileType, boolean autoIdentify, String filePath, org.json.JSONObject config) throws ServerException, ParseException, IOException, org.json.JSONException Create a new table and import the data contained in the mentioned file into the created table.- Parameters:
tableName- Name of the new table to be created.fileType- Type of the file to be imported.autoIdentify- Used to specify whether to auto identify the CSV format.filePath- Path of the file to be imported.config- Contains any additional control configurations. Can be null.- Returns:
- A
JSONObjectof import result. - Throws:
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.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.
-
importData
public org.json.JSONObject importData(long viewId, String importType, String fileType, boolean autoIdentify, String filePath, org.json.JSONObject config) throws ServerException, ParseException, IOException, org.json.JSONException Import the data contained in the mentioned file into the table.- Parameters:
viewId- Id of the view where the data to be imported.importType- The type of import. Can be one of- append
- truncateadd
- updateadd
fileType- Type of the file to be imported.autoIdentify- Used to specify whether to auto identify the CSV format.filePath- Path of the file to be imported.config- Contains any additional control configurations. Can be null.- Returns:
- A
JSONObjectof import result. - Throws:
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.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.
-
importRawDataInNewTable
public org.json.JSONObject importRawDataInNewTable(String tableName, String fileType, boolean autoIdentify, String data, org.json.JSONObject config) throws ServerException, ParseException, IOException, org.json.JSONException Create a new table and import the raw data provided into the created table.- Parameters:
tableName- Name of the new table to be created.fileType- Type of the file to be imported.autoIdentify- Used to specify whether to auto identify the CSV format.data- Raw data to be imported.config- Contains any additional control configurations. Can be null.- Returns:
- A
JSONObjectof import result. - Throws:
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.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.
-
importRawData
public org.json.JSONObject importRawData(long viewId, String importType, String fileType, boolean autoIdentify, String data, org.json.JSONObject config) throws ServerException, ParseException, IOException, org.json.JSONException Import the raw data provided into the table.- Parameters:
viewId- Id of the view where the data to be imported.importType- The type of import. Can be one of- APPEND
- TRUNCATEADD
- UPDATEADD
fileType- Type of the file to be imported.autoIdentify- Used to specify whether to auto identify the CSV format.data- Raw data to be imported.config- Contains any additional control configurations. Can be null.- Returns:
- A
JSONObjectof import result. - Throws:
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.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.
-
importBulkDataInNewTable
public long importBulkDataInNewTable(String tableName, String fileType, boolean autoIdentify, String filePath, org.json.JSONObject config) throws ServerException, ParseException, IOException, org.json.JSONException Asynchronously create a new table and import the data contained in the mentioned file into the created table.- Parameters:
tableName- Name of the new table to be created.fileType- Type of the file to be imported.autoIdentify- Used to specify whether to auto identify the CSV format.filePath- Path of the file to be imported.config- Contains any additional control configurations. Can be null.- Returns:
- A
longof the job id created. - Throws:
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.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.
-
importBulkData
public long importBulkData(long viewId, String importType, String fileType, boolean autoIdentify, String filePath, org.json.JSONObject config) throws ServerException, ParseException, IOException, org.json.JSONException Asynchronously import the data contained in the mentioned file into the table.- Parameters:
viewId- Id of the view where the data to be imported.importType- The type of import. Can be one of- APPEND
- TRUNCATEADD
- UPDATEADD
fileType- Type of the file to be imported.autoIdentify- Used to specify whether to auto identify the CSV format.filePath- Path of the file to be imported.config- Contains any additional control configurations. Can be null.- Returns:
- A
longof job id created. - Throws:
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.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.
-
getImportJobDetails
public org.json.JSONObject getImportJobDetails(long jobId) throws ServerException, ParseException, IOException, org.json.JSONException Returns the details of the import job.- Parameters:
jobId- Id of the import job.- Returns:
- A
JSONObjectof import result. - Throws:
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.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.
-
exportData
public void exportData(long viewId, String responseFormat, String filePath, org.json.JSONObject config) throws ServerException, ParseException, IOException, org.json.JSONException Export the mentioned table (or) view data.- Parameters:
viewId- Id of the view to be exported.responseFormat- The format in which the data is to be exported.filePath- Path of the file where the data exported to be stored.config- Contains any additional control configurations. Can be null.- Throws:
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.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.
-
exportData
public void exportData(long viewId, String responseFormat, OutputStream stream, org.json.JSONObject config) throws ServerException, ParseException, IOException, org.json.JSONException Export the mentioned table (or) view data.- Parameters:
viewId- Id of the view to be exported.responseFormat- The format in which the data is to be exported.stream- Outputstream where the data exported to be stored.config- Contains any additional control configurations. Can be null.- Throws:
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.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.
-
exportDataUsingSQL
public void exportDataUsingSQL(String sqlQuery, String responseFormat, OutputStream stream, org.json.JSONObject config) throws ServerException, ParseException, IOException, org.json.JSONException Internally used in JDBC driver- Throws:
ServerExceptionParseExceptionIOExceptionorg.json.JSONException
-
exportDataUsingSQL
public void exportDataUsingSQL(String sqlQuery, String responseFormat, String filePath, org.json.JSONObject config) throws ServerException, ParseException, IOException, org.json.JSONException Internally used in JDBC driver- Throws:
ServerExceptionParseExceptionIOExceptionorg.json.JSONException
-
initiateBulkExport
public long initiateBulkExport(long viewId, String responseFormat, org.json.JSONObject config) throws ServerException, ParseException, IOException, org.json.JSONException Initiate asynchronous export for the mentioned table (or) view data.- Parameters:
viewId- Id of the view to be exported.responseFormat- The format in which the data is to be exported.config- Contains any additional control configurations. Can be null.- Throws:
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.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.
-
initiateBulkExportUsingSQL
public long initiateBulkExportUsingSQL(String sqlQuery, String responseFormat, org.json.JSONObject config) throws ServerException, ParseException, IOException, org.json.JSONException Initiate asynchronous export with the given SQL Query.- Parameters:
sqlQuery- The SQL Query whose output is exported.responseFormat- The format in which the data is to be exported.config- Contains any additional control configurations. Can be null.- Throws:
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.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.
-
getExportJobDetails
public org.json.JSONObject getExportJobDetails(long jobId) throws ServerException, ParseException, IOException, org.json.JSONException Returns the details of the export job.- Parameters:
jobId- Id of the export job.- Returns:
- A
JSONObjectof export job details. - Throws:
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.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.
-
exportBulkData
public void exportBulkData(long jobId, String filePath) throws ServerException, ParseException, IOException, org.json.JSONException Download the exported data for the mentioned job id.- Parameters:
jobId- Id of the job to be exported.filePath- Path of the file where the data exported to be stored.- Throws:
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.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.
-
exportBulkData
public void exportBulkData(long jobId, OutputStream stream) throws ServerException, ParseException, IOException, org.json.JSONException Download the exported data for the mentioned job id.- Parameters:
jobId- Id of the job to be exported.stream- Outputstream where the data exported to be stored.- Throws:
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.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.
-
importDataInNewTableAsBatches
public long importDataInNewTableAsBatches(String tableName, boolean autoIdentify, String filePath, int batchSize, org.json.JSONObject config, org.json.JSONObject toolConfig) throws ServerException, ParseException, IOException, org.json.JSONException, Exception Create a new table and import the data contained in the mentioned file into the created table.- Parameters:
tableName- Name of the new table to be created.autoIdentify- Used to specify whether to auto identify the CSV format.filePath- Path of the file to be imported.batchSize- Number of lines per batch.config- Contains any additional control configurations. Can be null.toolConfig- Contains any additional control configurations for the parser tool. Can be null.- Returns:
- A
longof the job id created. - Throws:
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.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.Exception
-
importDataAsBatches
public long importDataAsBatches(long viewId, String importType, boolean autoIdentify, String filePath, int batchSize, org.json.JSONObject config, org.json.JSONObject toolConfig) throws ServerException, ParseException, IOException, org.json.JSONException, Exception Asynchronously import the data contained in the mentioned file into the table.- Parameters:
viewId- Id of the view where the data to be imported.importType- The type of import. Can be one of- APPEND
- TRUNCATEADD
- UPDATEADD
autoIdentify- Used to specify whether to auto identify the CSV format.filePath- Path of the file to be imported.batchSize- Number of lines per batch.config- Contains any additional control configurations. Can be null.toolConfig- Contains any additional control configurations for the parser tool. Can be null.- Returns:
- A
longof job id created. - Throws:
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.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.Exception
-
handleCustomBatchImport
public org.json.JSONObject handleCustomBatchImport(long viewId, String filePath, org.json.JSONObject config) throws ServerException, ParseException, IOException, org.json.JSONException, Exception - Throws:
ServerExceptionParseExceptionIOExceptionorg.json.JSONExceptionException
-