共用方式為


FileUploadCompletionNotification Class

  • java.lang.Object
    • com.microsoft.azure.sdk.iot.deps.serializer.FileUploadCompletionNotification

public class FileUploadCompletionNotification

The request payload to send to IoT Hub to notify it when a file upload is completed, whether successful or not. Must set setSuccess(Boolean success) and setCorrelationId(String correlationId), but all other fields are optional.

Constructor Summary

Constructor Description
FileUploadCompletionNotification()

Empty constructor: Used only to keep GSON happy.

FileUploadCompletionNotification(String json)

Construct this notification with json

FileUploadCompletionNotification(String correlationId, Boolean isSuccess)

Create an instance of the FileUploadCompletionNotification for a single file upload operation using Azure Storage.

FileUploadCompletionNotification(String correlationId, Boolean isSuccess, Integer statusCode, String statusDescription)

Create an instance of the FileUploadCompletionNotification for a single file upload operation using Azure Storage.

Method Summary

Modifier and Type Method and Description
java.lang.String getCorrelationId()
java.lang.Integer getStatusCode()
java.lang.String getStatusDescription()
java.lang.Boolean getSuccess()
void setCorrelationId(String correlationId)

Set the correlationId that correlates this FileUploadCompletionNotification to the earlier request to get the SAS URI for this upload from IoT Hub.

void setStatusCode(Integer statusCode)

Set the status code associated with this file upload request

void setStatusDescription(String statusDescription)

Set the status description associated with this file upload request

void setSuccess(Boolean success)

Set if the file upload was a success

java.lang.String toJson()

Convert this class to json.

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

Constructor Details

FileUploadCompletionNotification

public FileUploadCompletionNotification()

Empty constructor: Used only to keep GSON happy.

FileUploadCompletionNotification

public FileUploadCompletionNotification(String json)

Construct this notification with json

Parameters:

json - the json to parse.

FileUploadCompletionNotification

public FileUploadCompletionNotification(String correlationId, Boolean isSuccess)

Create an instance of the FileUploadCompletionNotification for a single file upload operation using Azure Storage.

Parameters:

correlationId - the correlationId that correlates this FileUploadCompletionNotification to the earlier request to get the SAS URI for this upload from IoT Hub. This field is mandatory. Must equal getCorrelationId().
isSuccess - whether the file was uploaded successfully. This field is mandatory.

FileUploadCompletionNotification

public FileUploadCompletionNotification(String correlationId, Boolean isSuccess, Integer statusCode, String statusDescription)

Create an instance of the FileUploadCompletionNotification for a single file upload operation using Azure Storage.

Parameters:

correlationId - the correlationId that correlates this FileUploadCompletionNotification to the earlier request to get the SAS URI for this upload from IoT Hub. This field is mandatory. Must equal getCorrelationId().
isSuccess - whether the file was uploaded successfully. This field is mandatory.
statusCode - is the status for the upload of the file to storage.
statusDescription - is the description of the status code.

Method Details

getCorrelationId

public String getCorrelationId()

Returns:

the correlationId that correlates this FileUploadCompletionNotification to the earlier request to get the SAS URI

getStatusCode

public Integer getStatusCode()

Returns:

get the status code associated with this file upload.

getStatusDescription

public String getStatusDescription()

Returns:

get the status description associated with this file upload.

getSuccess

public Boolean getSuccess()

Returns:

Get if the file upload was successful

setCorrelationId

public void setCorrelationId(String correlationId)

Set the correlationId that correlates this FileUploadCompletionNotification to the earlier request to get the SAS URI for this upload from IoT Hub. Must equal getCorrelationId().

Parameters:

correlationId - the unique identifier that correlates this file upload status to a SAS URI that IoT Hub retreived from Azure Storage earlier.

setStatusCode

public void setStatusCode(Integer statusCode)

Set the status code associated with this file upload request

Parameters:

statusCode - The status code associated with this file upload request

setStatusDescription

public void setStatusDescription(String statusDescription)

Set the status description associated with this file upload request

Parameters:

statusDescription - The status description associated with this file upload request

setSuccess

public void setSuccess(Boolean success)

Set if the file upload was a success

Parameters:

success - true if the file upload was a success. False otherwise.

toJson

public String toJson()

Convert this class to json.

Returns:

json that represents the content of this class.

Applies to