Package com.foxinmy.weixin4j.token
Class TicketManager
- java.lang.Object
-
- com.foxinmy.weixin4j.token.TicketManager
-
- Direct Known Subclasses:
PerTicketManager
public class TicketManager extends Object
第三方应用ticket的存取- Since:
- JDK 1.6
- Author:
- jinyu(foxinmy@gmail.com)
-
-
Constructor Summary
Constructors Constructor Description TicketManager(String thirdId, String thirdSecret, CacheStorager<Token> cacheStorager)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
cachingTicket(String ticket)
缓存ticketString
getAccessTicket()
获取ticketString
getCacheKey()
获取ticket的keyCacheStorager<Token>
getCacheStorager()
String
getThirdId()
String
getThirdSecret()
Token
getTicket()
获取ticket对象
-
-
-
Constructor Detail
-
TicketManager
public TicketManager(String thirdId, String thirdSecret, CacheStorager<Token> cacheStorager)
- Parameters:
thirdId
- 第三方ID suiteId/componentIdthirdSecret
- 第三方secretcacheStorager
- ticket存储策略
-
-
Method Detail
-
getTicket
public Token getTicket() throws WeixinException
获取ticket对象- Returns:
- token对象
- Throws:
WeixinException
-
getAccessTicket
public String getAccessTicket() throws WeixinException
获取ticket- Returns:
- ticket
- Throws:
WeixinException
-
getCacheKey
public String getCacheKey()
获取ticket的key- Returns:
-
cachingTicket
public void cachingTicket(String ticket) throws WeixinException
缓存ticket- Parameters:
ticket
- 票据凭证- Throws:
WeixinException
-
getThirdId
public String getThirdId()
-
getThirdSecret
public String getThirdSecret()
-
getCacheStorager
public CacheStorager<Token> getCacheStorager()
-
-