Package com.zoho.analytics.client
Class BulkAPI
- java.lang.Object
-
- com.zoho.analytics.client.BulkAPI
-
public class BulkAPI extends java.lang.ObjectBulkAPI contains bulk data operation.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedBulkAPI(AnalyticsClient ac, long orgId, long workspaceId)Creates a newBulkAPIinstance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidexportBulkData(long jobId, java.io.OutputStream stream)Download the exported data for the mentioned job id.voidexportBulkData(long jobId, java.lang.String filePath)Download the exported data for the mentioned job id.voidexportData(long viewId, java.lang.String responseFormat, java.io.OutputStream stream, org.json.JSONObject config)Export the mentioned table (or) view data.voidexportData(long viewId, java.lang.String responseFormat, java.lang.String filePath, org.json.JSONObject config)Export the mentioned table (or) view data.voidexportDataUsingSQL(java.lang.String sqlQuery, java.lang.String responseFormat, java.io.OutputStream stream, org.json.JSONObject config)Internally used in JDBC drivervoidexportDataUsingSQL(java.lang.String sqlQuery, java.lang.String responseFormat, java.lang.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, java.lang.String filePath, org.json.JSONObject config)longimportBulkData(long viewId, java.lang.String importType, java.lang.String fileType, boolean autoIdentify, java.lang.String filePath, org.json.JSONObject config)Asynchronously import the data contained in the mentioned file into the table.longimportBulkDataInNewTable(java.lang.String tableName, java.lang.String fileType, boolean autoIdentify, java.lang.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, java.lang.String importType, java.lang.String fileType, boolean autoIdentify, java.lang.String filePath, org.json.JSONObject config)Import the data contained in the mentioned file into the table.longimportDataAsBatches(long viewId, java.lang.String importType, boolean autoIdentify, java.lang.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(java.lang.String tableName, java.lang.String fileType, boolean autoIdentify, java.lang.String filePath, org.json.JSONObject config)Create a new table and import the data contained in the mentioned file into the created table.longimportDataInNewTableAsBatches(java.lang.String tableName, boolean autoIdentify, java.lang.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, java.lang.String importType, java.lang.String fileType, boolean autoIdentify, java.lang.String data, org.json.JSONObject config)Import the raw data provided into the table.org.json.JSONObjectimportRawDataInNewTable(java.lang.String tableName, java.lang.String fileType, boolean autoIdentify, java.lang.String data, org.json.JSONObject config)Create a new table and import the raw data provided into the created table.longinitiateBulkExport(long viewId, java.lang.String responseFormat, org.json.JSONObject config)Initiate asynchronous export for the mentioned table (or) view data.longinitiateBulkExportUsingSQL(java.lang.String sqlQuery, java.lang.String responseFormat, org.json.JSONObject config)Initiate asynchronous export with the given SQL Query.
-
-
-
Constructor Detail
-
BulkAPI
protected BulkAPI(AnalyticsClient ac, long orgId, long workspaceId)
Creates a newBulkAPIinstance.- Parameters:
ac-AnalyticsClientinstance.orgId- The ID of the organization.workspaceId- The ID of the workspace.
-
-
Method Detail
-
importDataInNewTable
public org.json.JSONObject importDataInNewTable(java.lang.String tableName, java.lang.String fileType, boolean autoIdentify, java.lang.String filePath, org.json.JSONObject config) throws ServerException, ParseException, java.io.IOException, org.json.JSONExceptionCreate 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.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.
-
importData
public org.json.JSONObject importData(long viewId, java.lang.String importType, java.lang.String fileType, boolean autoIdentify, java.lang.String filePath, org.json.JSONObject config) throws ServerException, ParseException, java.io.IOException, org.json.JSONExceptionImport 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.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.
-
importRawDataInNewTable
public org.json.JSONObject importRawDataInNewTable(java.lang.String tableName, java.lang.String fileType, boolean autoIdentify, java.lang.String data, org.json.JSONObject config) throws ServerException, ParseException, java.io.IOException, org.json.JSONExceptionCreate 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.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.
-
importRawData
public org.json.JSONObject importRawData(long viewId, java.lang.String importType, java.lang.String fileType, boolean autoIdentify, java.lang.String data, org.json.JSONObject config) throws ServerException, ParseException, java.io.IOException, org.json.JSONExceptionImport 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.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.
-
importBulkDataInNewTable
public long importBulkDataInNewTable(java.lang.String tableName, java.lang.String fileType, boolean autoIdentify, java.lang.String filePath, org.json.JSONObject config) throws ServerException, ParseException, java.io.IOException, org.json.JSONExceptionAsynchronously 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.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.
-
importBulkData
public long importBulkData(long viewId, java.lang.String importType, java.lang.String fileType, boolean autoIdentify, java.lang.String filePath, org.json.JSONObject config) throws ServerException, ParseException, java.io.IOException, org.json.JSONExceptionAsynchronously 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.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.
-
getImportJobDetails
public org.json.JSONObject getImportJobDetails(long jobId) throws ServerException, ParseException, java.io.IOException, org.json.JSONExceptionReturns 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.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.
-
exportData
public void exportData(long viewId, java.lang.String responseFormat, java.lang.String filePath, org.json.JSONObject config) throws ServerException, ParseException, java.io.IOException, org.json.JSONExceptionExport 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.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.
-
exportData
public void exportData(long viewId, java.lang.String responseFormat, java.io.OutputStream stream, org.json.JSONObject config) throws ServerException, ParseException, java.io.IOException, org.json.JSONExceptionExport 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.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.
-
exportDataUsingSQL
public void exportDataUsingSQL(java.lang.String sqlQuery, java.lang.String responseFormat, java.io.OutputStream stream, org.json.JSONObject config) throws ServerException, ParseException, java.io.IOException, org.json.JSONExceptionInternally used in JDBC driver- Throws:
ServerExceptionParseExceptionjava.io.IOExceptionorg.json.JSONException
-
exportDataUsingSQL
public void exportDataUsingSQL(java.lang.String sqlQuery, java.lang.String responseFormat, java.lang.String filePath, org.json.JSONObject config) throws ServerException, ParseException, java.io.IOException, org.json.JSONExceptionInternally used in JDBC driver- Throws:
ServerExceptionParseExceptionjava.io.IOExceptionorg.json.JSONException
-
initiateBulkExport
public long initiateBulkExport(long viewId, java.lang.String responseFormat, org.json.JSONObject config) throws ServerException, ParseException, java.io.IOException, org.json.JSONExceptionInitiate 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.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.
-
initiateBulkExportUsingSQL
public long initiateBulkExportUsingSQL(java.lang.String sqlQuery, java.lang.String responseFormat, org.json.JSONObject config) throws ServerException, ParseException, java.io.IOException, org.json.JSONExceptionInitiate 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.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.
-
getExportJobDetails
public org.json.JSONObject getExportJobDetails(long jobId) throws ServerException, ParseException, java.io.IOException, org.json.JSONExceptionReturns 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.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.
-
exportBulkData
public void exportBulkData(long jobId, java.lang.String filePath) throws ServerException, ParseException, java.io.IOException, org.json.JSONExceptionDownload 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.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.
-
exportBulkData
public void exportBulkData(long jobId, java.io.OutputStream stream) throws ServerException, ParseException, java.io.IOException, org.json.JSONExceptionDownload 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.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.
-
importDataInNewTableAsBatches
public long importDataInNewTableAsBatches(java.lang.String tableName, boolean autoIdentify, java.lang.String filePath, int batchSize, org.json.JSONObject config, org.json.JSONObject toolConfig) throws ServerException, ParseException, java.io.IOException, org.json.JSONException, java.lang.ExceptionCreate 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.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.java.lang.Exception
-
importDataAsBatches
public long importDataAsBatches(long viewId, java.lang.String importType, boolean autoIdentify, java.lang.String filePath, int batchSize, org.json.JSONObject config, org.json.JSONObject toolConfig) throws ServerException, ParseException, java.io.IOException, org.json.JSONException, java.lang.ExceptionAsynchronously 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.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.java.lang.Exception
-
handleCustomBatchImport
public org.json.JSONObject handleCustomBatchImport(long viewId, java.lang.String filePath, org.json.JSONObject config) throws ServerException, ParseException, java.io.IOException, org.json.JSONException, java.lang.Exception- Throws:
ServerExceptionParseExceptionjava.io.IOExceptionorg.json.JSONExceptionjava.lang.Exception
-
-