FileUploadNotificationProcessorClient Class
- java.
lang. Object - com.
microsoft. azure. sdk. iot. service. messaging. FileUploadNotificationProcessorClient
- com.
public class FileUploadNotificationProcessorClient
A client for handling file upload notifications. For more details on what file upload notifications are, see this document.
This client relies on a persistent amqp/amqp_ws connection to IoT Hub that may break due to network instability. While optional to monitor, users are highly encouraged to utilize the errorProcessorHandler defined in the FileUploadNotificationProcessorClientOptions when constructing this client in order to monitor the connection state and to re-open the connection when needed. See the message feedback processor client sample in this repo for best practices for monitoring and handling disconnection events.
Constructor Summary
Method Summary
Modifier and Type | Method and Description |
---|---|
synchronized boolean |
isRunning()
Returns true if this client's underlying amqp connection is currently open and false otherwise. This client may lose connectivity due to network issues, so this value may be false even if you have not closed the client yourself. Monitoring the optional errorProcessor that can be set in FileUploadNotificationProcessorClientOptions will provide the context on when connection loss events occur, and why they occurred. |
synchronized void |
start()
Open this client so that it can begin processing file upload notifications. When you want to stop processing file upload notifications, you should should call stop() to free up network resources. If this client is already started, then this function will do nothing. |
synchronized void |
start(int timeoutMilliseconds)
Open this client so that it can begin processing file upload notifications. When you want to stop processing file upload notifications, you should should call stop() to free up network resources. If this client is already started, then this function will do nothing. |
synchronized void |
stop()
Stops this client from processing any more file upload notifications and releases all network resources tied to it. Once stopped, this client can be restarted by calling start(). If this client has already been stopped, this function will do nothing. |
synchronized void |
stop(int timeoutMilliseconds)
Stops this client from processing any more file upload notifications and releases all network resources tied to it. Once stopped, this client can be restarted by calling start(). If this client has already been stopped, this function will do nothing. |
Constructor Details
FileUploadNotificationProcessorClient
public FileUploadNotificationProcessorClient(String hostName, AzureSasCredential azureSasCredential, IotHubServiceClientProtocol protocol, Function
Construct a FileUploadNotificationProcessorClient using a AzureSasCredential instance for authentication.
Parameters:
FileUploadNotificationProcessorClient
public FileUploadNotificationProcessorClient(String hostName, AzureSasCredential azureSasCredential, IotHubServiceClientProtocol protocol, Function
Construct a FileUploadNotificationProcessorClient using a AzureSasCredential instance for authentication.
Parameters:
FileUploadNotificationProcessorClient
public FileUploadNotificationProcessorClient(String connectionString, IotHubServiceClientProtocol protocol, Function
Construct a FileUploadNotificationProcessorClient from the provided connection string.
Parameters:
FileUploadNotificationProcessorClient
public FileUploadNotificationProcessorClient(String connectionString, IotHubServiceClientProtocol protocol, Function
Construct a FileUploadNotificationProcessorClient from the provided connection string.
Parameters:
FileUploadNotificationProcessorClient
public FileUploadNotificationProcessorClient(String hostName, TokenCredential credential, IotHubServiceClientProtocol protocol, Function
Construct a FileUploadNotificationProcessorClient using a TokenCredential instance for authentication.
Parameters:
FileUploadNotificationProcessorClient
public FileUploadNotificationProcessorClient(String hostName, TokenCredential credential, IotHubServiceClientProtocol protocol, Function
Construct a FileUploadNotificationProcessorClient using a TokenCredential instance for authentication.
Parameters:
Method Details
isRunning
public synchronized boolean isRunning()
Returns true if this client's underlying amqp connection is currently open and false otherwise. This client may lose connectivity due to network issues, so this value may be false even if you have not closed the client yourself. Monitoring the optional errorProcessor that can be set in FileUploadNotificationProcessorClientOptions will provide the context on when connection loss events occur, and why they occurred.
Returns:
start
public synchronized void start()
Open this client so that it can begin processing file upload notifications. When you want to stop processing file upload notifications, you should should call stop() to free up network resources. If this client is already started, then this function will do nothing.
Throws:
start
public synchronized void start(int timeoutMilliseconds)
Open this client so that it can begin processing file upload notifications. When you want to stop processing file upload notifications, you should should call stop() to free up network resources. If this client is already started, then this function will do nothing.
Parameters:
Throws:
stop
public synchronized void stop()
Stops this client from processing any more file upload notifications and releases all network resources tied to it. Once stopped, this client can be restarted by calling start(). If this client has already been stopped, this function will do nothing.
Throws:
stop
public synchronized void stop(int timeoutMilliseconds)
Stops this client from processing any more file upload notifications and releases all network resources tied to it. Once stopped, this client can be restarted by calling start(). If this client has already been stopped, this function will do nothing.
Parameters:
Throws:
Applies to
Azure SDK for Java