默认的凭证的刷新服务,类似token失效,它是一个周期性的服务, token续约的服务, 使用Function <Duration, Long> refreshDelayStrategy, 一旦凭证提供者已经续约了,将会回调注册,重新发送一个新的秘密到AMQP的连接 , 这里也使用构造器模式
- DefaultCredentialsRefreshService 实现了CredentialsRefreshService接口
1、CredentialsRefreshService 接口
- 凭证续约接口
1.1、方法
| 方法名 | 描述 | 图示 |
|---|---|---|
| String register | 注册需要续约实体 | |
| void unregister | 取消注册 | |
| boolean isApprochingExpiration | 是否过期失效 |
2、DefaultCredentialsRefreshService
2.1、成员变量
| 变量名 | 值 | 描述 |
|---|---|---|
| SheduledExecutorService scheduler | 周期刷新token续约 | |
| ConcurrentMap<CredentialsProvider, CredentialsProviderState> credentialsProviderStates | 证书提供状态map | |
| boolean privateSheduler | 是否为私有周期任务(传入,还默认生成的) | |
| Function<3, Duration> refreshDelayStrategy | 延迟刷新策略 | |
| Function<Duration, Boolean> approachingExpirationStrategy | 是否失效,一般需要提前续约 |
2.2、方法
| 方法名 | 描述 | 图示 |
|---|---|---|
| 构造方法 | 一般使用Defa |

最低0.47元/天 解锁文章
2667

被折叠的 条评论
为什么被折叠?



