public class WxChannelDefaultConfigImpl extends Object implements WxChannelConfig
| 限定符和类型 | 字段和说明 |
|---|---|
protected Lock |
accessTokenLock |
protected String |
appid |
protected File |
tmpDirFile
临时文件目录.
|
protected String |
token |
| 构造器和说明 |
|---|
WxChannelDefaultConfigImpl() |
| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
autoRefreshToken()
是否自动刷新token
|
void |
expireAccessToken()
强制将access token过期掉
|
protected long |
expiresAheadInMillis(int expiresInSeconds)
会过期的数据提前过期时间,默认预留200秒的时间
|
String |
getAccessToken()
Gets access token.
|
Lock |
getAccessTokenLock()
Gets access token lock.
|
String |
getAesKey()
Gets aes key.
|
ApacheHttpClientBuilder |
getApacheHttpClientBuilder()
http client builder
|
String |
getAppid()
Gets appid.
|
long |
getExpiresTime()
Gets expires time.
|
String |
getHttpProxyHost()
Gets http proxy host.
|
String |
getHttpProxyPassword()
Gets http proxy password.
|
int |
getHttpProxyPort()
Gets http proxy port.
|
String |
getHttpProxyUsername()
Gets http proxy username.
|
int |
getMaxRetryTimes()
http 请求最大重试次数
BaseWxChannelService.setMaxRetryTimes(int)
|
String |
getMsgDataFormat()
Gets msg data format.
|
int |
getRetrySleepMillis()
http 请求重试间隔
BaseWxChannelService#setRetrySleepMillis(int)(int)
|
String |
getSecret()
Gets secret.
|
String |
getToken()
Gets token.
|
boolean |
isAccessTokenExpired()
Is access token expired boolean.
|
protected boolean |
isExpired(long expiresTime)
判断 expiresTime 是否已经过期
|
boolean |
isStableAccessToken()
Is use stable access token api
|
void |
setAccessToken(String accessToken) |
void |
setAccessTokenLock(Lock accessTokenLock) |
void |
setAccessTokenUrl(String accessTokenUrl)
设置自定义的获取accessToken地址 可用于设置获取accessToken的自定义服务
|
void |
setAesKey(String aesKey) |
void |
setApacheHttpClientBuilder(ApacheHttpClientBuilder apacheHttpClientBuilder) |
void |
setApiHostUrl(String apiHostUrl)
设置自定义的apiHost地址
具体取值,可以参考https://developers.weixin.qq.com/doc/offiaccount/Basic_Information/Interface_field_description.html
|
void |
setAppid(String appid) |
void |
setExpiresTime(long expiresTime) |
void |
setHttpProxyHost(String httpProxyHost) |
void |
setHttpProxyPassword(String httpProxyPassword) |
void |
setHttpProxyPort(int httpProxyPort) |
void |
setHttpProxyUsername(String httpProxyUsername) |
void |
setMaxRetryTimes(int maxRetryTimes) |
void |
setMsgDataFormat(String msgDataFormat) |
void |
setRetrySleepMillis(int retrySleepMillis) |
void |
setSecret(String secret) |
void |
setStableAccessToken(boolean stableAccessToken) |
void |
setToken(String token) |
String |
toString() |
void |
updateAccessToken(String accessToken,
int expiresInSeconds)
应该是线程安全的
|
void |
updateAccessToken(WxAccessToken accessToken)
应该是线程安全的
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetAccessTokenUrl, getApiHostUrlprotected volatile String appid
protected volatile String token
protected Lock accessTokenLock
protected volatile File tmpDirFile
protected long expiresAheadInMillis(int expiresInSeconds)
protected boolean isExpired(long expiresTime)
public String getAccessToken()
WxChannelConfiggetAccessToken 在接口中 WxChannelConfigpublic void setAccessToken(String accessToken)
public boolean isStableAccessToken()
WxChannelConfigisStableAccessToken 在接口中 WxChannelConfigpublic void setStableAccessToken(boolean stableAccessToken)
public Lock getAccessTokenLock()
WxChannelConfiggetAccessTokenLock 在接口中 WxChannelConfigpublic void setAccessTokenLock(Lock accessTokenLock)
public boolean isAccessTokenExpired()
WxChannelConfigisAccessTokenExpired 在接口中 WxChannelConfigpublic void updateAccessToken(WxAccessToken accessToken)
WxChannelConfigupdateAccessToken 在接口中 WxChannelConfigaccessToken - 要更新的WxAccessToken对象public void updateAccessToken(String accessToken, int expiresInSeconds)
WxChannelConfigupdateAccessToken 在接口中 WxChannelConfigaccessToken - 新的accessToken值expiresInSeconds - 过期时间,以秒为单位public void expireAccessToken()
WxChannelConfigexpireAccessToken 在接口中 WxChannelConfigpublic String getSecret()
WxChannelConfiggetSecret 在接口中 WxChannelConfigpublic void setSecret(String secret)
public String getToken()
WxChannelConfiggetToken 在接口中 WxChannelConfigpublic void setToken(String token)
public long getExpiresTime()
WxChannelConfiggetExpiresTime 在接口中 WxChannelConfigpublic void setExpiresTime(long expiresTime)
public String getAesKey()
WxChannelConfiggetAesKey 在接口中 WxChannelConfigpublic void setAesKey(String aesKey)
public String getMsgDataFormat()
WxChannelConfiggetMsgDataFormat 在接口中 WxChannelConfigpublic void setMsgDataFormat(String msgDataFormat)
public String getHttpProxyHost()
WxChannelConfiggetHttpProxyHost 在接口中 WxChannelConfigpublic void setHttpProxyHost(String httpProxyHost)
public int getHttpProxyPort()
WxChannelConfiggetHttpProxyPort 在接口中 WxChannelConfigpublic void setHttpProxyPort(int httpProxyPort)
public String getHttpProxyUsername()
WxChannelConfiggetHttpProxyUsername 在接口中 WxChannelConfigpublic void setHttpProxyUsername(String httpProxyUsername)
public String getHttpProxyPassword()
WxChannelConfiggetHttpProxyPassword 在接口中 WxChannelConfigpublic void setHttpProxyPassword(String httpProxyPassword)
public int getRetrySleepMillis()
WxChannelConfig
BaseWxChannelService#setRetrySleepMillis(int)(int)
getRetrySleepMillis 在接口中 WxChannelConfigpublic void setRetrySleepMillis(int retrySleepMillis)
public int getMaxRetryTimes()
WxChannelConfig
BaseWxChannelService.setMaxRetryTimes(int)
getMaxRetryTimes 在接口中 WxChannelConfigpublic void setMaxRetryTimes(int maxRetryTimes)
public ApacheHttpClientBuilder getApacheHttpClientBuilder()
WxChannelConfiggetApacheHttpClientBuilder 在接口中 WxChannelConfigpublic void setApacheHttpClientBuilder(ApacheHttpClientBuilder apacheHttpClientBuilder)
public boolean autoRefreshToken()
WxChannelConfigautoRefreshToken 在接口中 WxChannelConfigpublic void setApiHostUrl(String apiHostUrl)
WxChannelConfigsetApiHostUrl 在接口中 WxChannelConfigapiHostUrl - api域名地址public void setAccessTokenUrl(String accessTokenUrl)
WxChannelConfigsetAccessTokenUrl 在接口中 WxChannelConfigaccessTokenUrl - 自定义的获取accessToken地址public String getAppid()
WxChannelConfiggetAppid 在接口中 WxChannelConfigpublic void setAppid(String appid)
Copyright © 2025. All rights reserved.