|
32 | 32 | import java.net.URLDecoder; |
33 | 33 | import java.security.KeyManagementException; |
34 | 34 | import java.security.NoSuchAlgorithmException; |
35 | | -import java.util.Arrays; |
36 | | -import java.util.Collections; |
37 | | -import java.util.HashMap; |
38 | | -import java.util.List; |
39 | | -import java.util.Map; |
40 | | -import java.util.Properties; |
41 | | -import java.util.concurrent.ExecutorService; |
42 | | -import java.util.concurrent.Executors; |
43 | | -import java.util.concurrent.ScheduledExecutorService; |
44 | | -import java.util.concurrent.ThreadFactory; |
45 | | -import java.util.concurrent.TimeoutException; |
| 35 | +import java.util.*; |
| 36 | +import java.util.concurrent.*; |
46 | 37 | import java.util.function.Predicate; |
47 | 38 |
|
48 | 39 | import static java.util.concurrent.TimeUnit.MINUTES; |
@@ -848,6 +839,21 @@ public MetricsCollector getMetricsCollector() { |
848 | 839 | return metricsCollector; |
849 | 840 | } |
850 | 841 |
|
| 842 | + /** |
| 843 | + * Set a {@link CredentialsRefreshService} instance to handle credentials refresh if appropriate. |
| 844 | + * <p> |
| 845 | + * Each created connection will register to the refresh service to send an AMQP <code>update.secret</code> |
| 846 | + * frame when credentials are about to expire. This is the refresh service responsibility to schedule |
| 847 | + * credentials refresh and <code>udpate.secret</code> frame sending, based on the information provided |
| 848 | + * by the {@link CredentialsProvider}. |
| 849 | + * <p> |
| 850 | + * Note the {@link CredentialsRefreshService} is used only when the {@link CredentialsProvider} |
| 851 | + * signals credentials can expire, by returning a non-null value from {@link CredentialsProvider#getTimeBeforeExpiration()}. |
| 852 | + * |
| 853 | + * @param credentialsRefreshService the refresh service to use |
| 854 | + * @see #setCredentialsProvider(CredentialsProvider) |
| 855 | + * @see DefaultCredentialsRefreshService |
| 856 | + */ |
851 | 857 | public void setCredentialsRefreshService(CredentialsRefreshService credentialsRefreshService) { |
852 | 858 | this.credentialsRefreshService = credentialsRefreshService; |
853 | 859 | } |
|
0 commit comments