All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.microsoft.azure.sdk.iot.device.transport.NoRetry Maven / Gradle / Ivy

There is a newer version: 2.5.0
Show newest version
/*
 *
 *  Copyright (c) Microsoft. All rights reserved.
 *  Licensed under the MIT license. See LICENSE file in the project root for full license information.
 *
 */

package com.microsoft.azure.sdk.iot.device.transport;

import lombok.extern.slf4j.Slf4j;

/**
  * Represents a retry policy that performs no retries.
  */
@Slf4j
public class NoRetry implements RetryPolicy
{
    public NoRetry()
    {
        log.info("NOTE: A new instance of NoRetry has been created, the client will not perform any retries on disconnect.");
    }
    /**
     * Always says to not retry.
     *
     * @param currentRetryCount the number of retries for the given operation
     * @param lastException the last exception encountered
     * @return the retry decision.
     */
    public RetryDecision getRetryDecision(int currentRetryCount, TransportException lastException)
    {
        return new RetryDecision(false, 0);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy