FileUploadCompletionNotification Class

  • java.lang.Object
    • com.microsoft.azure.sdk.iot.device.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 whether the file upload was a success or not, and must set the correlation Id, but all other fields are optional.

Constructor Summary

Constructor Description
FileUploadCompletionNotification()

Empty constructor: Used only to keep GSON happy.

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
String getCorrelationId()
Integer getStatusCode()
String getStatusDescription()
Boolean isSuccess()
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 the correlation Id set in the FileUploadSasUriResponse associated with this file upload.

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

String toJson()

Convert this class to json.

Constructor Details

FileUploadCompletionNotification

public FileUploadCompletionNotification()

Empty constructor: Used only to keep GSON happy.

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 the correlation Id set in the FileUploadSasUriResponse associated with this file upload.
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 the correlation Id set in the FileUploadSasUriResponse associated with this file upload.
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.

isSuccess

public Boolean isSuccess()

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 the correlation Id set in the FileUploadSasUriResponse associated with this file upload.

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