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 java.lang.ObjectThis 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 Summary
Constructors Constructor Description DelayedNetworkService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Tcall(NetworkSupplier<T> method, java.lang.String serviceName)Tcall(NetworkSupplier<T> method, java.lang.String serviceName, LoggingTask logger)intgetNbRetry()
-
-
-
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()
-
-