/** * Sets the given retry policy on the underlying transport * <a href="https://github.com/Azure/azure-iot-sdk-java/blob/master/device/iot-device-client/devdoc/requirement_docs/com/microsoft/azure/iothub/retryPolicy.md"> * See more details about the default retry policy and about using custom retry policies here</a> * @param retryPolicy the new interval in milliseconds */ public void setRetryPolicy(RetryPolicy retryPolicy) { //Codes_SRS_INTERNALCLIENT_28_001: [The function shall set the device config's RetryPolicy .] this.config.setRetryPolicy(retryPolicy); }
/** * Sets the given retry policy on the underlying transport * Sets the given retry policy on the underlying transport * <a href="https://github.com/Azure/azure-iot-sdk-java/blob/master/device/iot-device-client/devdoc/requirement_docs/com/microsoft/azure/iothub/retryPolicy.md"> * See more details about the default retry policy and about using custom retry policies here</a> * @param retryPolicy the new interval in milliseconds * @throws UnsupportedOperationException if no device client has been registered yet. */ public void setRetryPolicy(RetryPolicy retryPolicy) { if (deviceClientList.size() == 0) { // Codes_SRS_TRANSPORTCLIENT_28_001: [The function shall throw UnsupportedOperationException if there is no registered device client] throw new UnsupportedOperationException("TransportClient.setRetryPolicy only works when there is at least one registered device client."); } for (int i = 0; i < this.deviceClientList.size(); i++) { // Codes_SRS_TRANSPORTCLIENT_28_002: [The function shall set the retry policies to all registered device clients.] deviceClientList.get(i).getConfig().setRetryPolicy(retryPolicy); } logger.LogInfo("Retry policy updated successfully in the transport client, method name is %s ", logger.getMethodName()); }