Class DelayedNetworkService<T>

java.lang.Object
fr.paris.lutece.plugins.identitystore.service.network.DelayedNetworkService<T>
Type Parameters:
T - the return type of the response to be handled

public class DelayedNetworkService<T> extends 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 Details

    • DelayedNetworkService

      public DelayedNetworkService()
  • Method Details

    • call

      public T call(NetworkSupplier<T> method, 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, 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()