TokenManager.java 845 Bytes
Newer Older
shenggui.li committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
package com.reyun.security;

/**
 * Created by nolan on 11/11/2016.
 * description:
 */
public interface TokenManager {

    void delMultiRelationshipByKey(String key);
    /**
     * 通过key删除关联关系
     *
     * @param key
     */
    void delRelationshipByKey(String key);

    /**
     * 通过token删除关联关系
     *
     * @param token
     */
    void delRelationshipByToken(String token);

    /**
     * 通过token获得对应的key
     *
     * @param token
     * @return
     */
    String getKeyFromToken(String token);

    /**
     * 通过key获得对应token
     * @param key
     * @return
     */
    String getTokenFromKey(String key);

    /**
     * 根据key生成对应token
     * @param key
     * @return
     */
    String createToken(String key);
}