View Javadoc
1   package net.avcompris.commons3.core;
2   
3   import javax.annotation.Nullable;
4   
5   import net.avcompris.commons3.api.User;
6   import net.avcompris.commons3.api.exception.ServiceException;
7   
8   public interface CorrelationService {
9   
10  	/**
11  	 * Get a non-null correlationId from the HTTP request, or create a new
12  	 * correlationId if needed.
13  	 *
14  	 * @param correlationIdParam  the "correlationId", if any, passed as a parameter
15  	 *                            in the HTTP URL’s query (overwrite
16  	 *                            correlationIdHeader)
17  	 * @param correlationIdHeader the "correlationId", if any, passed as a Header in
18  	 *                            the HTTP Request
19  	 */
20  	String getCorrelationId(@Nullable String correlationIdParam, @Nullable String correlationIdHeader)
21  			throws ServiceException;
22  
23  	void purgeOlderThanSec(String correlationId, User user, int seconds) throws ServiceException;
24  }