com.foxinmy.weixin4j.token
Class TicketManager

java.lang.Object
  extended by com.foxinmy.weixin4j.token.TicketManager
Direct Known Subclasses:
PerTicketManager

public class TicketManager
extends Object

第三方应用ticket的存取

Since:
JDK 1.6
Author:
jinyu(foxinmy@gmail.com)
See Also:

Constructor Summary
TicketManager(String thirdId, String thirdSecret, CacheStorager<Token> cacheStorager)
           
 
Method Summary
 void cachingTicket(String ticket)
          缓存ticket
 String getAccessTicket()
          获取ticket
 String getCacheKey()
          获取ticket的key
 CacheStorager<Token> getCacheStorager()
           
 String getThirdId()
           
 String getThirdSecret()
           
 Token getTicket()
          获取ticket对象
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TicketManager

public TicketManager(String thirdId,
                     String thirdSecret,
                     CacheStorager<Token> cacheStorager)
Parameters:
thirdId - 第三方ID suiteId/componentId
thirdSecret - 第三方secret
cacheStorager - 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()


Copyright © 2014–2017. All rights reserved.