BatchRequestContent Class

  • java.lang.Object
    • com.microsoft.graph.content.BatchRequestContent

public class BatchRequestContent

Respresents the content of a JSON batch request

Field Summary

Modifier and Type Field and Description
protected static final java.util.regex.Pattern protocolAndHostReplacementPattern

pattern to replace the protocol and host part of the request if specified

java.util.List<BatchRequestStep<?>> requests

Steps part of the batch request

Constructor Summary

Constructor Description
BatchRequestContent()

Method Summary

Modifier and Type Method and Description
java.lang.String addBatchRequestStep(IHttpRequest request, HttpMethod httpMethod, T serializableBody)

Adds a request as a step to the current batch

java.lang.String addBatchRequestStep(IHttpRequest request, HttpMethod httpMethod, T serializableBody, String[] dependsOnRequestsIds)

Adds a request as a step to the current batch

BatchRequestStep<T> getStepById(String stepId)

Gets a step by its step id

java.lang.String addBatchRequestStep(IHttpRequest request)

Adds a request as a step to the current batch.

java.lang.String addBatchRequestStep(IHttpRequest request, HttpMethod httpMethod)

Adds a request as a step to the current batch

protected java.lang.String getNextRequestId()

Generates a randomly available request id

void removeBatchRequestStepWithId(String[] stepIds)

Removes requests from the requests to be executed by the batch.

Methods inherited from java.lang.Object

java.lang.Object.clone java.lang.Object.equals java.lang.Object.finalize java.lang.Object.getClass java.lang.Object.hashCode java.lang.Object.notify java.lang.Object.notifyAll java.lang.Object.toString java.lang.Object.wait java.lang.Object.wait java.lang.Object.wait

Field Details

protocolAndHostReplacementPattern

protected static final Pattern protocolAndHostReplacementPattern

pattern to replace the protocol and host part of the request if specified

requests

public List> requests

Steps part of the batch request

Constructor Details

BatchRequestContent

public BatchRequestContent()

Method Details

addBatchRequestStep

public String addBatchRequestStep(IHttpRequest request, HttpMethod httpMethod, T serializableBody)

Adds a request as a step to the current batch

Parameters:

request - the request to add as a step
httpMethod - the HttpMethod to execute the request with
serializableBody - the body of the request to be serialized

Returns:

the id of the step that was just added to the batch

addBatchRequestStep

public String addBatchRequestStep(IHttpRequest request, HttpMethod httpMethod, T serializableBody, String[] dependsOnRequestsIds)

Adds a request as a step to the current batch

Parameters:

request - the request to add as a step
httpMethod - the HttpMethod to execute the request with
serializableBody - the body of the request to be serialized
dependsOnRequestsIds - the ids of steps this request depends on

Returns:

the id of the step that was just added to the batch

getStepById

public BatchRequestStep getStepById(String stepId)

Gets a step by its step id

Parameters:

stepId - the request step id returned from the add method

Returns:

the request corresponding to the provided id or null

addBatchRequestStep

public String addBatchRequestStep(IHttpRequest request)

Adds a request as a step to the current batch. Defaults to GET if the HTTP method is not set in the request.

Parameters:

request - the request to add as a step

Returns:

the id of the step that was just added to the batch

addBatchRequestStep

public String addBatchRequestStep(IHttpRequest request, HttpMethod httpMethod)

Adds a request as a step to the current batch

Parameters:

request - the request to add as a step
httpMethod - the HttpMethod to execute the request with

Returns:

the id of the step that was just added to the batch

getNextRequestId

protected String getNextRequestId()

Generates a randomly available request id

Returns:

a random request id

removeBatchRequestStepWithId

public void removeBatchRequestStepWithId(String[] stepIds)

Removes requests from the requests to be executed by the batch. Also removes any dependency references that might exist.

Parameters:

stepIds - ids of steps to be removed.

Applies to