public class

BulkConnection

extends Object
java.lang.Object
   ↳ com.sforce.async.BulkConnection

Class Overview

RestConnection

Summary

Constants
String CSV_CONTENT_TYPE
String NAMESPACE
String SESSION_ID
String XML_CONTENT_TYPE
String ZIP_CSV_CONTENT_TYPE
String ZIP_XML_CONTENT_TYPE
Fields
public static final QName BATCH_LIST_QNAME
public static final QName BATCH_QNAME
public static final QName ERROR_QNAME
public static final QName JOB_QNAME
private ConnectorConfig config
private HashMap<String, String> headers
public static final TypeMapper typeMapper
Public Constructors
BulkConnection(ConnectorConfig config)
Public Methods
JobInfo abortJob(String jobId)
void addHeader(String headerName, String headerValue)
JobInfo closeJob(String jobId)
BatchRequest createBatch(JobInfo job)
BatchInfo createBatchFromDir(JobInfo job, InputStream batchContent, File attachmentDir)
BatchInfo createBatchFromStream(JobInfo jobInfo, InputStream input)
BatchInfo createBatchFromZipStream(JobInfo jobInfo, InputStream zipInput)
BatchInfo createBatchWithFileAttachments(JobInfo jobInfo, InputStream batchContent, Map<String, File> attachedFiles)
BatchInfo createBatchWithFileAttachments(JobInfo jobInfo, InputStream batchContent, File rootDirectory, String... files)
BatchInfo createBatchWithInputStreamAttachments(JobInfo jobInfo, InputStream batchContent, Map<String, InputStream> attachments)
JobInfo createJob(String object, String operation)
JobInfo createJob(JobInfo job)
BatchInfo getBatchInfo(String jobId, String batchId)
BatchInfoList getBatchInfoList(String jobId)
InputStream getBatchRequestInputStream(String jobId, String batchId)
BatchResult getBatchResult(String jobId, String batchId)
InputStream getBatchResultStream(String jobId, String batchId)
ConnectorConfig getConfig()
JobInfo getJobStatus(String jobId)
QueryResultList getQueryResultList(String jobId, String batchId)
InputStream getQueryResultStream(String jobId, String batchId, String resultId)
JobInfo updateJob(JobInfo job)
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final String CSV_CONTENT_TYPE

Constant Value: "text/csv"

public static final String NAMESPACE

Constant Value: "http://www.force.com/2009/06/asyncapi/dataload"

public static final String SESSION_ID

Constant Value: "X-SFDC-Session"

public static final String XML_CONTENT_TYPE

Constant Value: "application/xml"

public static final String ZIP_CSV_CONTENT_TYPE

Constant Value: "zip/csv"

public static final String ZIP_XML_CONTENT_TYPE

Constant Value: "zip/xml"

Fields

public static final QName BATCH_LIST_QNAME

public static final QName BATCH_QNAME

public static final QName ERROR_QNAME

public static final QName JOB_QNAME

private ConnectorConfig config

private HashMap<String, String> headers

public static final TypeMapper typeMapper

Public Constructors

public BulkConnection (ConnectorConfig config)

Parameters
config

Public Methods

public JobInfo abortJob (String jobId)

Parameters
jobId

public void addHeader (String headerName, String headerValue)

Parameters
headerName
headerValue

public JobInfo closeJob (String jobId)

Parameters
jobId

public BatchRequest createBatch (JobInfo job)

Parameters
job

public BatchInfo createBatchFromDir (JobInfo job, InputStream batchContent, File attachmentDir)

Parameters
job
batchContent
attachmentDir

public BatchInfo createBatchFromStream (JobInfo jobInfo, InputStream input)

Parameters
jobInfo
input

public BatchInfo createBatchFromZipStream (JobInfo jobInfo, InputStream zipInput)

Parameters
jobInfo
zipInput

public BatchInfo createBatchWithFileAttachments (JobInfo jobInfo, InputStream batchContent, Map<String, File> attachedFiles)

Parameters
jobInfo
batchContent
attachedFiles

public BatchInfo createBatchWithFileAttachments (JobInfo jobInfo, InputStream batchContent, File rootDirectory, String... files)

Parameters
jobInfo
batchContent
rootDirectory
files

public BatchInfo createBatchWithInputStreamAttachments (JobInfo jobInfo, InputStream batchContent, Map<String, InputStream> attachments)

Parameters
jobInfo Parent job for new batch.
batchContent InputStream containing the xml or csv content of the batch, or null only if request.txt is contained in attachments map
attachments Map of attachments where the key is the filename to be used in the zip file and the value is the InputStream representing that file.
Returns
  • BatchInfo of uploaded batch.

public JobInfo createJob (String object, String operation)

Parameters
object
operation

public JobInfo createJob (JobInfo job)

Parameters
job

public BatchInfo getBatchInfo (String jobId, String batchId)

Parameters
jobId
batchId

public BatchInfoList getBatchInfoList (String jobId)

Parameters
jobId

public InputStream getBatchRequestInputStream (String jobId, String batchId)

Parameters
jobId
batchId

public BatchResult getBatchResult (String jobId, String batchId)

Parameters
jobId
batchId

public InputStream getBatchResultStream (String jobId, String batchId)

Parameters
jobId
batchId

public ConnectorConfig getConfig ()

public JobInfo getJobStatus (String jobId)

Parameters
jobId

public QueryResultList getQueryResultList (String jobId, String batchId)

Parameters
jobId
batchId

public InputStream getQueryResultStream (String jobId, String batchId, String resultId)

Parameters
jobId
batchId
resultId

public JobInfo updateJob (JobInfo job)

Parameters
job