public class BulkOperation extends Object
Each operation corresponds to a single HTTP request against a Resource endpoint. REQUIRED. method The HTTP method of the current operation. Possible values are POST, PUT, PATCH or DELETE. REQUIRED. bulkId The transient identifier of a newly created Resource, unique within a bulk request and created by the Consumer. The bulkId serves as a surrogate Resource id enabling Consumers to uniquely identify newly created Resources in the Response and cross reference new Resources in and across operations within a bulk request. REQUIRED when method is POST. version The current Resource version. Version is REQUIRED if the Service Provider supports ETags and the method is PUT, DELETE, or PATCH. path The Resource's relative path. If the method is POST the value must specify a Resource type endpoint; e.g., /Users or /Groups whereas all other method values must specify the path to a specific Resource; e.g., /Users/2819c223-7f76-453a-919d-413861904646. REQUIRED in a request. location The Resource endpoint URL. REQUIRED in a response, except in the event of a POST failure. data The Resource data as it would appear for a single POST, PUT or PATCH Resource operation. REQUIRED in a request when method is POST, PUT and PATCH. status A complex type that contains information about the success or failure of one operation within the bulk job. REQUIRED in a response. code The HTTP response code that would have been returned if a single HTTP request would have been used. REQUIRED. description A human readable error message. REQUIRED when an error occurred.
Modifier and Type | Class and Description |
---|---|
static class |
BulkOperation.Method
The different methods that are supported within bulk operations.
|
Constructor and Description |
---|
BulkOperation(BulkOperation.Method method,
String bulkId,
String version,
String path,
String location,
BaseResource data,
Status status)
Construct a new BulkOperation object.
|
Modifier and Type | Method and Description |
---|---|
static BulkOperation |
createRequest(BulkOperation.Method method,
String bulkId,
String version,
String path,
BaseResource data)
Create a new operation for a bulk request.
|
static BulkOperation |
createResponse(BulkOperation.Method method,
String bulkId,
String version,
String location,
Status status)
Create a new operation for a bulk response.
|
String |
getBulkId()
Retrieve the bulk operation identifier, required when the method is POST.
|
BaseResource |
getData()
Retrieve the resource data as it would appear for a single POST, PUT or
PATCH operation.
|
String |
getLocation()
Retrieve the resource endpoint URL, or
null if this is a request,
or if this is the response to a failed POST operation. |
BulkOperation.Method |
getMethod()
Retrieve HTTP method of the operation.
|
String |
getPath()
Retrieve the The relative path of the resource, or
null if this
is a response. |
Status |
getStatus()
Retrieve information about the success or failure of the operation, or
null if this is a request. |
String |
getVersion()
Retrieve the The current resource version, or
null if not provided. |
String |
toString() |
public BulkOperation(BulkOperation.Method method, String bulkId, String version, String path, String location, BaseResource data, Status status)
method
- The HTTP method of the operation. Possible values are
POST, PUT, PATCH or DELETE.bulkId
- The bulk operation identifier, required when the method
is POST.version
- The current resource version, or null
if not
provided.path
- The relative path of the resource, or null
if
this is a response.location
- The resource endpoint URL, or {code null} if this is a
request, or if this is the response to a failed POST
operation.data
- The resource data as it would appear for a single POST,
PUT or PATCH operation.status
- Information about the success or failure of the
operation, or null
if this is a request.public static BulkOperation createRequest(BulkOperation.Method method, String bulkId, String version, String path, BaseResource data)
method
- The HTTP method of the operation. Possible values are
POST, PUT, PATCH or DELETE.bulkId
- The bulk operation identifier, required when the method
is POST.version
- The current resource version, or null
if not
provided.path
- The relative path of the resource, or null
if
this is a response.data
- The resource data as it would appear for a single POST,
PUT or PATCH operation.public static BulkOperation createResponse(BulkOperation.Method method, String bulkId, String version, String location, Status status)
method
- The HTTP method of the operation. Possible values are
POST, PUT, PATCH or DELETE.bulkId
- The bulk operation identifier, required when the method
is POST.version
- The resource version, or null
if version is
not available or not supported.location
- The resource endpoint URL, or null
if this is
the response to a DELETE operation or a failed POST
operation.status
- Information about the success or failure of the
operation.public BulkOperation.Method getMethod()
public String getBulkId()
public String getVersion()
null
if not provided.null
if not provided.public String getPath()
null
if this
is a response.null
if this
is a response.public String getLocation()
null
if this is a request,
or if this is the response to a failed POST operation.null
if this is a request,
or if this is the response to a failed POST operation.public BaseResource getData()
public Status getStatus()
null
if this is a request.null
if this is a request.Copyright © 2011-2015 UnboundID. All Rights Reserved.