Class DelayedNetworkService<T>

  • Type Parameters:
    T - the return type of the response to be handled

    public class DelayedNetworkService<T>
    extends java.lang.Object
    This generic class is a retry pattern aimed to call method that could fail or need to be slow down.
    Properties:
    • Default max retries is set to 500 but can be overridden by the user through identitystore.network.retry.max property.
    • Default delay is set to 10ms but can be overridden by the user through identitystore.network.delay property. This delay is always used in retries
    • Default delay activated is set to false but can be overridden by the user through identitystore.network.delay.activated property. When set to true, the delay is applied after each call.
    • Constructor Detail

      • DelayedNetworkService

        public DelayedNetworkService()
    • Method Detail

      • call

        public T call​(NetworkSupplier<T> method,
                      java.lang.String serviceName)
               throws fr.paris.lutece.plugins.identitystore.web.exception.IdentityStoreException
        Throws:
        fr.paris.lutece.plugins.identitystore.web.exception.IdentityStoreException
      • call

        public T call​(NetworkSupplier<T> method,
                      java.lang.String serviceName,
                      LoggingTask logger)
               throws fr.paris.lutece.plugins.identitystore.web.exception.IdentityStoreException
        Throws:
        fr.paris.lutece.plugins.identitystore.web.exception.IdentityStoreException
      • getNbRetry

        public int getNbRetry()